FEATURE: Add SiteSetting to disable readonly mode during backup.
This commit is contained in:
parent
374592d599
commit
1adfa0a4b5
3 changed files with 4 additions and 1 deletions
|
@ -1008,6 +1008,7 @@ en:
|
||||||
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
|
github_client_id: "Client id for Github authentication, registered at https://github.com/settings/applications"
|
||||||
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"
|
github_client_secret: "Client secret for Github authentication, registered at https://github.com/settings/applications"
|
||||||
|
|
||||||
|
readonly_mode_during_backup: "Enable read only mode while taking a backup"
|
||||||
allow_restore: "Allow restore, which can replace ALL site data! Leave false unless you plan to restore a backup"
|
allow_restore: "Allow restore, which can replace ALL site data! Leave false unless you plan to restore a backup"
|
||||||
maximum_backups: "The maximum amount of backups to keep on disk. Older backups are automatically deleted"
|
maximum_backups: "The maximum amount of backups to keep on disk. Older backups are automatically deleted"
|
||||||
automatic_backups_enabled: "Run automatic backups as defined in backup frequency"
|
automatic_backups_enabled: "Run automatic backups as defined in backup frequency"
|
||||||
|
|
|
@ -970,6 +970,8 @@ legal:
|
||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
backups:
|
backups:
|
||||||
|
readonly_mode_during_backup:
|
||||||
|
default: true
|
||||||
allow_restore:
|
allow_restore:
|
||||||
default: false
|
default: false
|
||||||
maximum_backups:
|
maximum_backups:
|
||||||
|
|
|
@ -89,7 +89,7 @@ module BackupRestore
|
||||||
@archive_directory = File.join(Rails.root, "public", "backups", @current_db)
|
@archive_directory = File.join(Rails.root, "public", "backups", @current_db)
|
||||||
@archive_basename = File.join(@archive_directory, "#{SiteSetting.title.parameterize}-#{@timestamp}")
|
@archive_basename = File.join(@archive_directory, "#{SiteSetting.title.parameterize}-#{@timestamp}")
|
||||||
@logs = []
|
@logs = []
|
||||||
@readonly_mode_was_enabled = Discourse.readonly_mode?
|
@readonly_mode_was_enabled = Discourse.readonly_mode? || !SiteSetting.readonly_mode_during_backup
|
||||||
end
|
end
|
||||||
|
|
||||||
def listen_for_shutdown_signal
|
def listen_for_shutdown_signal
|
||||||
|
|
Reference in a new issue