Disable read-only mode in Discourse from the rails console
A Discourse instance can be set in read-only mode for backups. I had used this for a global read-only maintenance. The admin session was on one of my computers which timed out after a while.
In order to regain access to the Discourse instance, and being able to login as an administrator, I had to follow these instructions:
ssh root@server.com
cd /var/discourse
./launcher enter app
rails c
Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)
quit
ctrl+d
Navigate back to the site and you can login again.