Thanks for your response. This is a fresh default install and I’ve not installed any plugins or created any jobs. Which logs am I best to look at? Sorry I’m a bit of a noob.
I have had trouble using that as well, both for enabling and disabling readonly mode. The last time I ended up running Discourse.enable_readonly_mode in rails.
It’s always an emergency when it happens and I haven’t investigated what the issue might be.
Thanks JammyDodger! The info and link were very helpful. I’m not sure what constitutes a container restart - as far as I know my container is not restarting every ~1:30 which is as long as the RO mode stays enabled when using discourse enable_readonly i.e. Discourse.enable_readonly_mode(Discourse::READONLY_MODE_KEY)
I can confirm however that Discourse.enable_readonly_mode(Discourse::USER_READONLY_MODE_KEY) “sticks” indefinitely, which is what I was trying to achieve
- name: Set read-only mode for live forum host
ansible.builtin.shell: |
docker exec app bash -c 'echo Discourse.enable_readonly_mode\(Discourse::USER_READONLY_MODE_KEY\) | rails c'
register: enable_readonly_output