diff --git a/changelogs.md b/changelogs.md index fe63222..0e5e226 100644 --- a/changelogs.md +++ b/changelogs.md @@ -8,6 +8,11 @@ ### Fixed - Resolved issue with missing Restic password file causing auto backup configuration to fail. +- Corrected permissions and ownership for the Restic password file to ensure it is accessible by the `litespeed` user. +- Updated the `installRestic` section in `manifest.jps` to generate a random password for the Restic password file during installation. +- Ensured consistent usage of the Restic password across all scripts by reading it from the `/etc/restic-password` file. +- Adjusted the `importScripts` section in `manifest.jps` to set the correct ownership for all backup-related directories to `litespeed:litespeed`. ### Updated - Updated `manifest.jps` to ensure Restic password file creation and log rotation setup. + \ No newline at end of file diff --git a/manifest.jps b/manifest.jps index 98b264a..d8aca37 100644 --- a/manifest.jps +++ b/manifest.jps @@ -288,12 +288,15 @@ actions: # Move it to a directory in your PATH sudo mv restic /usr/local/bin/ - # Create the Restic password file if it doesn't exist + # Create the Restic password file with a random password if it doesn't exist if [ ! -f /etc/restic-password ]; then - echo "YourResticPassword" | sudo tee /etc/restic-password - sudo chmod 600 /etc/restic-password + head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16 | sudo tee /etc/restic-password fi + # Set the correct permissions and ownership for the password file + sudo chown litespeed:litespeed /etc/restic-password + sudo chmod 640 /etc/restic-password + # Set up log rotation for backup logs echo "/var/log/backup_addon.log { weekly @@ -314,6 +317,7 @@ actions: - mkdir -p /home/litespeed/mb-backups/logs/auto - mkdir -p /home/litespeed/mb-backups/logs/manual - mkdir -p /home/litespeed/mb-backups/logs/restore + - chown -R litespeed:litespeed /home/litespeed/mb-backups - cd /home/jelastic/mb-backups - curl -O https://deploy-proxy.mightybox.io/addons/mb-backup-manager/raw/branch/main/scripts/imports/backup_all.sh - curl -O https://deploy-proxy.mightybox.io/addons/mb-backup-manager/raw/branch/main/scripts/imports/backup_core_files.sh @@ -323,5 +327,4 @@ actions: - curl -O https://deploy-proxy.mightybox.io/addons/mb-backup-manager/raw/branch/main/scripts/imports/manage_backup_schedule.sh - curl -O https://deploy-proxy.mightybox.io/addons/mb-backup-manager/raw/branch/main/scripts/imports/restore_backup_direct.sh - curl -O https://deploy-proxy.mightybox.io/addons/mb-backup-manager/raw/branch/main/scripts/imports/view_snapshots.sh - - curl -O https://deploy-proxy.mightybox.io/addons/mb-backup-manager/raw/branch/main/scripts/backup-logic.sh - chmod +x /home/litespeed/mb-backups/*.sh \ No newline at end of file