I get to the rails console from the server by using:
cd /var/discourse
./launcher enter app
rails c
There’s an example of changing a site setting in this topic, Enable the hidden can_permanently_delete site setting (this one is a hidden one, but the method is the same)