Skip to content

Commit 67aadab

Browse files
committed
DEV: Remove automatic_backups_enabled setting
1 parent 3604aa2 commit 67aadab

File tree

7 files changed

+8
-10
lines changed

7 files changed

+8
-10
lines changed

app/jobs/scheduled/schedule_backup.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ class ScheduleBackup < ::Jobs::Scheduled
77

88
def execute(args)
99
delete_prior_to_n_days
10-
return unless SiteSetting.enable_backups? && SiteSetting.automatic_backups_enabled?
10+
return if !SiteSetting.enable_backups?
11+
return if SiteSetting.backup_frequency.blank?
1112

1213
store = BackupRestore::BackupStore.create
1314
if latest_backup = store.latest_file

config/locales/server.en.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,8 +2024,7 @@ en:
20242024
allow_restore: "Allow restore, which can replace ALL site data! Leave disabled unless you plan to restore a backup"
20252025
maximum_backups: "The maximum amount of backups to keep. Older backups are automatically deleted"
20262026
remove_older_backups: "Remove backups older than the specified number of days. Leave blank to disable."
2027-
automatic_backups_enabled: "Run automatic backups as defined in backup frequency"
2028-
backup_frequency: "Specifies the interval, in days, at which automatic backups of the site are created. If set to 7, for example, a new backup will be generated every week. The activation of this setting is contingent upon `automatic_backups_enabled`."
2027+
backup_frequency: "Specifies the interval, in days, at which automatic backups of the site are created. If set to 7, for example, a new backup will be generated every week. Leave blank to disable."
20292028
s3_backup_bucket: "The remote bucket to hold backups. WARNING: Make sure it is a private bucket."
20302029
s3_endpoint: "The endpoint can be modified to backup to an S3 compatible service like DigitalOcean Spaces or Minio. WARNING: Leave blank if using AWS S3."
20312030
s3_configure_tombstone_policy: "Enable automatic deletion policy for tombstone uploads. IMPORTANT: If disabled, no space will be reclaimed after uploads are deleted."

config/site_settings.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3089,8 +3089,6 @@ backups:
30893089
remove_older_backups:
30903090
client: true
30913091
default: ""
3092-
automatic_backups_enabled:
3093-
default: true
30943092
backup_frequency:
30953093
min: 1
30963094
max: 30

script/bulk_import/vanilla.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def execute
6363

6464
# SiteSetting.port = 3000
6565
# SiteSetting.permalink_normalizations = "/discussion\/(\d+)\/.*/discussion/\1"
66-
# SiteSetting.automatic_backups_enabled = false
66+
# SiteSetting.backup_frequency = nil
6767
# SiteSetting.disable_emails = "non-staff"
6868
# SiteSetting.authorized_extensions = '*'
6969
# SiteSetting.max_image_size_kb = 102400

script/bulk_import/vbulletin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def initialize
4848

4949
def execute
5050
# enable as per requirement:
51-
# SiteSetting.automatic_backups_enabled = false
51+
# SiteSetting.backup_frequency = nil
5252
# SiteSetting.disable_emails = "non-staff"
5353
# SiteSetting.authorized_extensions = '*'
5454
# SiteSetting.max_image_size_kb = 102400

script/bulk_import/vbulletin5.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def initialize
5858

5959
def execute
6060
# enable as per requirement:
61-
#SiteSetting.automatic_backups_enabled = false
61+
#SiteSetting.backup_frequency = nil
6262
#SiteSetting.disable_emails = "non-staff"
6363
#SiteSetting.authorized_extensions = '*'
6464
#SiteSetting.max_image_size_kb = 102400

spec/lib/backup_restore/shared_examples_for_backup_store.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
expect(store.files).to eq([backup1])
171171
end
172172

173-
it "runs if SiteSetting.automatic_backups_enabled? is true" do
173+
it "runs if SiteSetting.backup_frequency is configured" do
174174
base_backup_s3_url = "https://s3-backup-bucket.s3.dualstack.us-west-1.amazonaws.com"
175175
stub_request(:get, "#{base_backup_s3_url}/?list-type=2&prefix=default/").to_return(
176176
status: 200,
@@ -180,7 +180,7 @@
180180
)
181181
stub_request(:head, "#{base_backup_s3_url}/").to_return(status: 200, body: "", headers: {})
182182

183-
SiteSetting.automatic_backups_enabled = true
183+
SiteSetting.backup_frequency = 1
184184
scheduleBackup = Jobs::ScheduleBackup.new
185185
scheduleBackup.expects(:delete_prior_to_n_days)
186186
scheduleBackup.perform

0 commit comments

Comments
 (0)