diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 562a53af..4a65906f 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1530,6 +1530,109 @@ + +
+

S3 Backup

+
+ +
+ +

Enable backing up to Amazon S3 or compatible storage services.

+
+ +
+
+ +
+
+ +
+
+

The name of the S3 bucket to store backups.

+
+ +
+ +
+
+ +
+
+

The AWS region where your S3 bucket is located.

+
+ +
+ +
+
+ +
+
+

Custom endpoint URL for S3-compatible services like Backblaze, MinIO, etc. Leave blank for AWS S3.

+
+ +
+ +
+
+ +
+
+

Your AWS Access Key ID. Leave blank if using IAM roles.

+
+ +
+ +
+
+ +
+
+

Your AWS Secret Access Key. Leave blank if using IAM roles.

+
+ +
+ +
+
+ +
+
+

Custom S3 endpoint URL. Use this for S3-compatible services like MinIO, DigitalOcean Spaces, etc.

+
+ +
+ +
+
+ +
+
+

Path prefix for backup storage (like a folder). Should end with a forward slash '/'.

+
+ +
+ +

Keep a local copy of backups in addition to the S3 backup.

+
+ +
+ +

Test your S3 connection and credentials.

+
+
+
+ +
+
+
+
+
+
${docker_msg | n}
@@ -2408,6 +2511,64 @@ $(document).ready(function() { }); }); + // S3 Backup Options handling + $('#s3_backup_enabled').change(function() { + if ($(this).is(':checked')) { + $('#s3_backup_options').slideDown(); + } else { + $('#s3_backup_options').slideUp(); + } + }); + + $("#test_s3_connection").click(function() { + var s3_bucket = $("#s3_bucket").val(); + var s3_region = $("#s3_region").val(); + var s3_access_key = $("#s3_access_key").val(); + var s3_secret_key = $("#s3_secret_key").val(); + var s3_endpoint = $("#s3_endpoint").val(); + + if (!s3_bucket) { + showMsg(' S3 bucket name cannot be blank.', false, true, 5000, true); + return; + } + + $(this).html(' Testing').prop('disabled', true); + showMsg(' Testing S3 connection...', true, false, 0, false); + + $.ajax({ + url: 'test_s3_connection', + type: 'POST', + data: { + s3_bucket: s3_bucket, + s3_region: s3_region, + s3_access_key: s3_access_key, + s3_secret_key: s3_secret_key, + s3_endpoint: s3_endpoint + }, + cache: false, + async: true, + timeout: 15000, + error: function(jqXHR, textStatus, errorThrown) { + $("#test_s3_connection").html('Test Connection').prop('disabled', false); + var msg = 'Failed to test S3 connection.'; + if (textStatus === 'timeout') { + msg += ' Connection timed out.'; + } else { + msg += ' Error: ' + jqXHR.status; + } + showMsg(' ' + msg, false, true, 5000, true); + }, + success: function(data) { + $("#test_s3_connection").html('Test Connection').prop('disabled', false); + if (data.result === 'success') { + showMsg(' ' + data.message, false, true, 5000); + } else { + showMsg(' ' + data.message, false, true, 5000, true); + } + } + }); + }); + $('#menu_link_update_check').click(function() { $(this).html(' Checking').prop('disabled', true); checkUpdate(function () {