Native (email) Auth doesn't seem to work out-of-box
-
I tried setting up Typebot on my Cloudron instance yesterday, but couldn't get the native Email auth to work.
Keep seeing the "Set up one of the Auth Providers" message.
Configured the following env variables:
ADMIN_EMAIL SMTP_USERNAME SMTP username SMTP_PASSWORD SMTP password SMTP_HOST SMTP host. (i.e. smtp.host.com) SMTP_PORT 25 SMTP port NEXT_PUBLIC_SMTP_FROM From name and email (i.e. 'Typebot Notifications' <notifications@host.com>) SMTP_SECURE false If true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false SMTP_AUTH_DISABLED false To disable the authentication by email but still use the provided config for notifications
Then also tried setting these when the above didn't work:
DATABASE_URL * The database URL ENCRYPTION_SECRET * A 256-bit key used to encrypt sensitive data. It is strongly recommended to generate a new one. The secret should be the same between builder and viewer. NEXTAUTH_URL * The builder base URL. Should be the publicly accessible URL (i.e. https://typebot.domain.com) NEXT_PUBLIC_VIEWER_URL * The viewer base URL. Should be the publicly accessible URL (i.e. https://bot.domain.com)
Seems like i'm missing something here.
Kindly advise!
-
Ah I got now what you meant with the STMP settings. I didn't realize you can use that as the SSO provider in typebot. Well so it appears the optionalSso flag in Cloudron is not correct then, if typebot always requires an auth provider. Looking into this soon.
To get going you could install the app with Cloudron SSO so it has at least one setup.
-
So it seems that either we do not allow using external authentication in the app, or we have to rely on the users to setup some external auth provider which is not email. @shrey have you tried any of the others mentioned at https://docs.typebot.io/self-hosting/configuration ?
-
@nebulon said in Native (email) Auth doesn't seem to work out-of-box:
have you tried any of the others mentioned at https://docs.typebot.io/self-hosting/configuration ?
@nebulon Nope, as my current use-case requires the use of email based auth only.
-
So if your auth provider is required to some SMTP server, then I guess this can't work if our packaging code also sets up SMTP for transactional emails and that always goes to your Cloudron's email server.
However given that we
source /app/data/env.sh
in thestart.sh
AFTER we setup the SMTP variables, you should be able to overwrite those.I guess then it is a matter of figuring out what the correct env vars for SMTP auth are for typebot, however that is a bit out of scope for Cloudron itself.
Edit: while trying your custom settings, I guess also keep an eye on the SMTP server logs itself to get an idea why things may fail
-
I don't think this is a strictly "SMTP" related issue. Even for auth, the Cloudron configured email should work just fine.
Update:
Yes, confirmed that the issue is that the Typebot instance is not aware of the available SMTP settings at all.
Example, the following defaults in the "env.sh" have been able to get my Typebot instance going properly now:
export SMTP_USERNAME="$CLOUDRON_MAIL_SMTP_USERNAME" export SMTP_PASSWORD="$CLOUDRON_MAIL_SMTP_PASSWORD" export SMTP_HOST="$CLOUDRON_MAIL_SMTP_SERVER" export SMTP_PORT="$CLOUDRON_MAIL_SMTP_PORT" export NEXT_PUBLIC_SMTP_FROM="$CLOUDRON_MAIL_FROM_DISPLAY_NAME <$CLOUDRON_MAIL_FROM>" export SMTP_SECURE="false" export SMTP_AUTH_DISABLED="false"
Recommendation: have the above config set by default, particularly in the cases where the admin selects "User Management by app", when installing the app.
-
@shrey said in Native (email) Auth doesn't seem to work out-of-box:
Recommendation: have the above config set by default, particularly in the cases where the admin selects "User Management by app", when installing the app.
Those variables are always set already. See https://git.cloudron.io/cloudron/typebot-app/-/blob/main/start.sh?ref_type=heads#L31 . Or maybe you are suggesting that we should put this in
/app/data/env.sh
so that the user can see them?