How can I see all current settings for Discourse?

AI-generated summary

To view all current settings in a running Discourse instance, there isn’t a straightforward command. However, you can access environment variables set in the app.yml file using docker exec app env | grep DISCOURSE aas.

To view settings overridden with environment variables, you can explore the Discourse defaults configuration file and the site settings directory hawm.

Alternatively, you can use SiteSetting.all_settings in Rails Lilly. To retrieve settings set in the database, you can run docker exec -it app bash -c 'echo "SiteSetting.pluck(:name, :value)" |rails c' pfaffman. This command returns only the settings that have been changed.

I can use the following to print settings that were set via the env section of my app.yml: docker exec app env | grep DISCOURSE

How can I print all the settings that are currently being used in my running instance? It doesn’t look like there’s a command for this in the launcher script.

The environment variables will be access by the Rails app, you can override any environment variable declared in this file, in my guess.

And perhaps you may also want to explore this:

I think in rails

SiteSetting.all_settings

What do you mean? Do you really mean all of the settings? There are hundreds of them as you can see at /admin/settings. Do you mean the settings overridden with ENV variables? What you have should do that, I think.

But you can do something like this to get the settings set in the database:

docker exec -it app bash -c 'echo "SiteSetting.pluck(:name, :value)" |rails  c'

To my surprise (though it made sense after thinking about it), this is just the ones that have been changed.