Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inbucket to local setup #78

Merged
merged 7 commits into from
Nov 30, 2021
Merged

Add inbucket to local setup #78

merged 7 commits into from
Nov 30, 2021

Conversation

NixBiks
Copy link
Contributor

@NixBiks NixBiks commented Nov 25, 2021

Fixes #71

I've never written in Go so forgive me if this is bad. It seems to be working for me so that's a good start at least. There is one issue though; the generated link which is captured by inbucket have a wrong domain.

It is

http://localhost:54324/?redirect_to=http%3A%2F%2Flocalhost%3A3000%2F&token=J_H61qmv_JcfnXHvkn_QNw&type=signup

but it should be

http://localhost:8000/?redirect_to=http%3A%2F%2Flocalhost%3A3000%2F&token=J_H61qmv_JcfnXHvkn_QNw&type=signup

@NixBiks
Copy link
Contributor Author

NixBiks commented Nov 25, 2021

Last commit fixes the above issue I had.

Currently GOTRUE_SITE_URL is hardcoded to port 3000 though. It probably should be a setting instead

@NixBiks
Copy link
Contributor Author

NixBiks commented Nov 26, 2021

Great progress! 😎

Maybe you want to allow to set custom port for GOTRUE_SITE_URL as well. This is the site you'll be redirected to, right?

@soedirgo
Copy link
Member

I went ahead and made inbucket opt-in (i.e. only when you specify ports.inbucket). Can you let me know if it works?

Currently GOTRUE_SITE_URL is hardcoded to port 3000 though. It probably should be a setting instead

+1, but I'd do this after the OSS dashboard for this one, as I'd like to avoid designing the config up front. It does mean you wouldn't be redirected automatically, but at least you can confirm emails, which is at least something I guess...

@NixBiks
Copy link
Contributor Author

NixBiks commented Nov 26, 2021

Great work. I'll test after lunch here 🙏🏼

@NixBiks
Copy link
Contributor Author

NixBiks commented Nov 26, 2021

Looks pretty good @soedirgo . A couple of things though

  1. if you don't opt in then you see Inbucket URL: http://localhost: in your terminal when you start - you should remove that line.
  2. In the console there seems to be empty spaces after Inbucket URL: http://localhost:54324 so you can't click the link in your terminal. See the underline
    Screenshot 2021-11-26 at 12 41 26

If I had any golang skills then I'd go ahead and do it but I don't

Copy link
Contributor Author

@NixBiks NixBiks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good from my point of view !

@soedirgo
Copy link
Member

Thanks! Re: point 2 above, there actually isn't any space after it, so not sure why it underlined it.

@soedirgo soedirgo merged commit ea01313 into supabase:main Nov 30, 2021
@github-actions
Copy link

🎉 This PR is included in version 0.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@bhvngt
Copy link

bhvngt commented Dec 24, 2021

@mr-bjerre @soedirgo I am trying to use inbucket/inbucket:latest docker image as part of supabase docker compose. While doing so I get following error when I signup for a user by calling http://<gotrue>/auth/v1/signup.

 level=error msg="500: Error sending confirmation mail" component=api error="Error sending confirmation email: unencrypted connection" method=POST path=/signup

When I use docker container using supabase/cli, I see that inbucket works without any problem. While going through the supabase/gotrue code trail leading to golang's net/smtp implementation I realised that it is expecting TLS connection unless host is localhost.

I was wondering how you are able to bypass this requirement. I went through supabase/cli code and this PR and see that you have not used INBUCKET_SMTP_TLSENABLED flag and yet your setup works with gotrue server.

I am using exactly the same docker image and yet I keep facing this issue.

@soedirgo
Copy link
Member

I am trying to use inbucket/inbucket:latest docker image

I think that might be the issue. The CLI uses inbucket/inbucket:stable which is a couple months older.

Btw, you might want to consider raising the issue on supabase/supabase instead as the setup is different.

Also you may have better luck trying this setup, though we only use it for smoke tests.

@bhvngt
Copy link

bhvngt commented Dec 24, 2021

Thanks a ton @soedirgo. You were right. It was indeed the inbucket/inbucket:latest image. With stable, it's working out fine for me.

Btw, you might want to consider raising the issue on supabase/supabase instead as the setup is different.

Sure will do that. I guess this will still be an issue once inbucket is upgraded to v3 final version which is what is latest is pointing to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add back inbucket (supabase-mail) and disable autoconfirm
3 participants