Could I update the SMTP setting through discourse.config

AI-generated summary

In a self-hosting discussion regarding SMTP configuration, user berniegao asks if discourse.config can update settings outside of development.rb. elberet confirms that while editing /config/discourse.conf is technically possible, it is not the supported method for Docker installations. Instead, ering recommends placing mail settings in the env block of app.yml, which is parsed by the launcher. elberet also notes that settings can be passed as environment variables with a DISCOURSE_ prefix.

berniegao clarifies they are using Docker to test configurations without rebuilding containers. elberet explains that the “not supported” warning stems from the difficulty troubleshooting issues when custom configurations are unknown to support staff. Later, Blaisorblade reports that changes to /var/www/discourse/config/discourse.conf appear to be reset at container startup, possibly due to aufs filesystem behavior rather than the application itself.

Hi @sam I manually install discourse, how could I update the SMTP setting besides through the config/environment/development.rb. Does the discourse.config fit the need?

You should be putting the mail settings in the env block of the app.yml which is parsed by the launcher script.

Is there any reason not to use Docker on this machine?

Yes, setting these options in /config/discourse.conf would work, e.g.

smtp_address = 10.0.0.1
smtp_port = 25
# etc...

However, this really isn’ the supported way to install Discourse. :wink:

(All of these settings can also be given as environment variables to Unicorn; simply capitalize the setting’s name and add a DISCOURSE_ prefix.)

I am using docker which is nice tool for deployment. However in my case, I gonna quickly test some configurations variables within the docker without rebuild the container every time.

why isn’t updating the /config/discourse the supported approach? :smile:

Hm, with “not supported” I’m not saying that it won’t work, but that you may get ignored if you run into problems during the installation and ask for help. After all, anyone trying to help would be guessing at what you’ve changed and basically poking in the dark to determine what’s wrong. :smiley:

This seems to have stopped working, even though I’m changing /var/www/discourse/config/discourse.conf — it seems to be reset at container startup O_O.

I can’t be sure though — some processes are hanging in kernel-space, in aufs-related code, so changes might be just getting lost because of aufs, instead of being reset by userspace. I’ll try again later.