Closed vitis586 closed 1 year ago
No idea why, but I had to move the EMAIL_FROM
from the .env to the container variables. So this is how my sender looks in .env:
# E-mail settings
# Configures the global From: header whilst sending emails.
#EMAIL_FROM=noreply@example.cz
The rest of the email config is still in .env stayed in the .env
# Configure SMTP settings (@see https://nodemailer.com/smtp/).
EMAIL_SERVER_HOST=smtp.eu.mailgun.org
EMAIL_SERVER_PORT=465
EMAIL_SERVER_USER=postmaster@example.cz
EMAIL_SERVER_PASSWORD=pass
I had to do the same with the database connection details so that is where I got my idea from.
Can you help me understand what you mean by the container variables versus the .env in your case? What's your method of running/orchestrating the image? Are you relying on your .env being packaged with the image, versus provided the .env vars at runtime via docker-compose or other orchestrator?
Should help us provide better guidance overall!
Sure. Let me try. I am running containers in Docker on Unraid so there is no Compose available. When starting a container there is a form that you fill in and that is then composed into a docker run
command:
docker run
-d
--name='calcom'
--net='proxynet'
-e TZ="Europe/Budapest"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="ClearSky"
-e HOST_CONTAINERNAME="calcom"
-e 'DATABASE_URL'='postgresql://calcom:pass@clearsky.hloub/calcom'
-e 'EMAIL_FROM'='noreply@example.cz'
-e 'NEXTAUTH_URL'='https://booking.example.cz'
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.webui='http://[IP]:[PORT:3000]'
-l net.unraid.docker.icon='https://i.imgur.com/mwmNzNQ.png'
-p '3003:3000/tcp'
-v '/mnt/cache/appdata/calcom/':'/cal':'rw'
--env-file /mnt/cache/appdata/calcom/.env 'calcom/cal.com:latest'
I am running the latest Cal.com version. As you can see, some of the environment variables are passed directly and some through the .env file. There might be a term for this, but you get the point. Initially I had everything in the .env file because it is what the image authors suggested. The container could not connect to database when I had the connection detail in the .env file so I moved those details to the DATABASE_URL
variable and that worked. I did the same now with the EMAIL_FROM
.
To answer your question directly. I am actually doing both - relying on .env passed as an extra parameter and providing the env variables at runtime. I do not know why it is working that way for me. I wanted to have everything in place but it was not working for me.
I hope I got it right. I am doing this for years now but still only scratching the surface. I am still sorting one last issue. I cannot log in at all after logging out. I am getting just [ERROR] (next-collect/server) - Invalid URL TypeError [ERR_INVALID_URL]: Invalid URL
. I am able to pass the login screen with a private browser window (empty browser profile) but then I am not passing the 2FA with the same error code.
Hi guys,
I finally got it kind of a running now I am struggling with SMTP. I have all the keys in the .env file.
It seems that the container is not picking the
EMAIL_FROM
from the .env because the SMTP server refuses to sent mail fromnotifications@example.com
which I understand as I have SPF set up. I already tried starting over - deleting database and renew the secrets.I looked for similar issues and only found https://github.com/calcom/docker/issues/80 being somewhat close but that was closed due to inactivity.