无法禁用只读模式

I enabled read-only mode on my forums and im not able to disable it.

I cant disable read-only mode via the /admin/backups because i cant login.


entering the docker image and disabling it via rails does not work either.

rails c
Discourse.disable_readonly_mode

entering the docker image and running

discourse disable_readonly

does not work either.


Anything im missing?

sorry if the bug category is not the correct category. I think this might be a bug

1 个赞

It depends on how you trigger readonly mode.

https://github.com/discourse/discourse/blob/master/lib/discourse.rb#L291-L295

There is a list of keys that you can pass to Postgres depending on how you trigger it

https://github.com/discourse/discourse/blob/master/lib/discourse.rb#L256-L259

3 个赞

Thanks

This command in rails did the trick

Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)

12 个赞

我在最新版本的 discourse 中遇到了同样的问题。

  1. 从 web_only 容器内部
root@forum:/var/www/discourse# discourse disable_readonly
站点现已完全可运行。
root@forum:/var/www/discourse#
  1. ./launcher enter web_only

  2. 之后,主页上仍然有“只读”横幅。

所以,问题尚未解决……

…好的,我现在可以用 rails c 命令行信息来解决了。
不过,这应该有所改进:例如,可以有一个带有令牌的特殊登录 URL,以便在只读模式下从 UX 进行管理员操作。

此主题在 2426 天后自动关闭。不再允许回复。