mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:02:45 +08:00
FEATURE: add readonly mode CLI
This commit is contained in:
parent
0caee99e8b
commit
4c941495e5
|
@ -112,6 +112,22 @@ WHERE table_schema='public' and (data_type like 'char%' or data_type like 'text%
|
||||||
puts 'Restore are now forbidden. Enable them with `enable_restore`'
|
puts 'Restore are now forbidden. Enable them with `enable_restore`'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "enable_readonly", "Enable the readonly mode"
|
||||||
|
def enable_readonly
|
||||||
|
load_rails
|
||||||
|
|
||||||
|
Discourse.enable_readonly_mode
|
||||||
|
puts 'The site is now in readonly mode.'
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "disable_readonly", "Disable the readonly mode"
|
||||||
|
def disable_readonly
|
||||||
|
load_rails
|
||||||
|
|
||||||
|
Discourse.disable_readonly_mode
|
||||||
|
puts 'The site is now fully operable.'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def load_rails
|
def load_rails
|
||||||
|
|
Loading…
Reference in New Issue
Block a user