From b70ce4af12a5fb056e5a7238d92780b5406f423b Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 12:34:01 +0100 Subject: [PATCH 01/53] use ynh_add_config for CRON file --- scripts/install | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index d1bae3d..f4587a4 100755 --- a/scripts/install +++ b/scripts/install @@ -135,9 +135,6 @@ ynh_store_file_checksum --file="$config_file" #================================================= ynh_script_progression --message="Configuring the cron file..." -cp ../conf/cron /etc/cron.d/$app -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app -ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app if [ "$frequency" = "Daily" ]; then cron_freq="0 2 * * *" run_freq="every day" @@ -154,7 +151,8 @@ else # Monthly cron_freq="0 2 1 * *" run_freq="once a month on the first sunday" fi -ynh_replace_string --match_string="__FREQUENCY__" --replace_string="$cron_freq" --target_file=/etc/cron.d/$app + +ynh_add_config --template="cron" --destination="/etc/cron.d/$app" # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="/etc/cron.d/$app" From 8437d6ff7356b97575fd93d2bfbe0457ef7bc119 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 12:40:12 +0100 Subject: [PATCH 02/53] Create Backup_list.conf.default --- conf/Backup_list.conf.default | 139 ++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 conf/Backup_list.conf.default diff --git a/conf/Backup_list.conf.default b/conf/Backup_list.conf.default new file mode 100644 index 0000000..406777f --- /dev/null +++ b/conf/Backup_list.conf.default @@ -0,0 +1,139 @@ +## OPTIONS + +# Backup directory. +backup_dir="__BACKUP_DIR__" + +# Encrypted backup directory. +# Usually just next to the backup directory +enc_backup_dir="__ENC_BACKUP_DIR__" + +# Encryption +# true/false +encrypt=__ENCRYPT__ +# Password for encryption +# This file should be set at chmod 400 +cryptpass="__PASSKEY__" + +# Compression algorithm to use +# gzip +# Standard compression algorithm. +# Fast and light on ressources. +# lzop +# Very fast algorithm. +# Low efficency +# zstd +# Zstandard algorithm +# Similar to gzip but faster +# bzip2 +# Very slow but very effective. +# Light on ressources. +# lzma +# Faster than bzip2 and even more effective. +# But demanding in resources. +# lzip +# Similar to lzma. +# xz +# Similar to lzma but more recent. +# +# none +# No compression +# Concatenation in a tar file only +# symlink +# No compression +# Symbolic link to the YunoHost tar file from /home/yunohost.backup/archives +# The symbolic link is used only for the local $backup_dir of archivist. +# Real tar files are send to recipients. +# +# This mode allow archivist to not duplicate locally the backup if not compressed. +# WARNING: Does not work with encryption ! +# +# Default: gzip +ynh_compression_mode=gzip +files_compression_mode=gzip + +# -------------------------------------------------------------------------------------- +## YUNOHOST BACKUPS + +# YunoHost backups +# Specific backup made by 'yunohost backup' command +# ynh_core_backup=__CORE_BACKUP__: Make a backup of the core of YunoHost, without any apps. +ynh_core_backup=true +ynh_core_pre_backup= +ynh_core_post_backup= + +# ynh_app_backup=APP: Make a backup of an app. +# You can add as many lines as you want to save multiple apps. +# List all apps with sudo yunohost app list --installed | grep "id: " +# ynh_app_backup=wordpress +# If you don't want an app with a lot of data to backup those big files, please add 'do_not_backup_data' after the app name. +# ynh_app_backup=transmission do_not_backup_data +ynh_app_pre_backup= +ynh_app_post_backup= +ynh_app_backup= + +# -------------------------------------------------------------------------------------- +## FILES BACKUPS + +# Max size for each backup in Mb. +# Be carreful, it's only a soft limit, that means the script will try to limit each backup. +# Because, it will never made more than one backup for a single directory (Even if it's a real big directory without subdirectories). And the same if there's files next to subdirectories, only one backup will be made for all this files. +max_size=500 + +# Backup of files and directories +# Add as many lines as you want for each directory or file you want to be backuped. +# Exclude a directory, a file, or multiples files with a regex with the exclude_backup instruction. +# file_to_backup="/directory/to backup" +# file_to_backup=/file/to backup +# exclude_backup="/directory/to exclude" +# exclude_backup=/file/to exclude +# exclude_backup="/exclude/all/tarball/in_this_directory/.tar.gz$" +files_pre_backup= +files_post_backup= +file_to_backup= +exclude_backup= + +# -------------------------------------------------------------------------------------- +## BACKUPS RECIPIENTS + +# All options following a recipient name will be enabled for this recipient only. +# > recipient name=Name of this recipient. +# type=Choose between one of the scripts in the "senders" directory. +# destination directory=Directory where to put the backup in the other side. +# encrypt=Override main option for encryption. (true/false) (Optionnal option) +# specific option for type=See the chosen script to know what's the options. +# exclude backup=Exclude a backup file or a directory from the backup. This option can be duplicated. (Optionnal option) +# include backup=Choose the only file or directory which be send. This option can be duplicated. (Optionnal option) + +# > recipient name=local example +# type=local +# destination directory=/my/local/backup +# encrypt=false +# pre_backup= +# post_backup= +# exclude backup=/exclude/dir +# include backup= + +# > recipient name=rsync ssh example +# type=rsync_ssh +# destination directory=backup +# encrypt=false +# ssh_host=domain.tld +# ssh_user=user +# ssh_port=22 +# ssh_key=/home/user/.ssh/id_rsa +# ssh_pwd= +# ssh_options= +# pre_backup= +# post_backup= +# exclude backup=/exclude/dir +# include backup= + +# > recipient name=b2 example +# type=b2 +# destination directory=backup +# encrypt=false +# b2_bucket=my-bucket +# pre_backup= +# post_backup= +# exclude backup=/exclude/dir +# include backup= From 69c2ea1019e37ce35d4ebecf86d1d55261b0a42e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 12:42:35 +0100 Subject: [PATCH 03/53] use ynh_add_config for Backup_list --- scripts/install | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index f4587a4..43ffe31 100755 --- a/scripts/install +++ b/scripts/install @@ -91,10 +91,6 @@ mkdir -p "$backup_dir" ynh_script_progression --message="Configuring Archivist..." --weight=2 config_file="$final_path/Backup_list.conf" -cp "$final_path/Backup_list.conf.default" "$config_file" - -ynh_replace_string --match_string="^backup_dir=.*" --replace_string="backup_dir=$backup_dir" --target_file="$config_file" -ynh_replace_string --match_string="^enc_backup_dir=.*" --replace_string="enc_backup_dir=$enc_backup_dir" --target_file="$config_file" if [ $encrypt -eq 1 ] then @@ -107,8 +103,7 @@ else encrypt=false passkey=na fi -ynh_replace_string --match_string="^encrypt=.*" --replace_string="encrypt=$encrypt" --target_file="$config_file" -ynh_replace_string --match_string="^cryptpass=.*" --replace_string="cryptpass=$passkey" --target_file="$config_file" + if [ $core_backup -eq 1 ] then @@ -116,7 +111,8 @@ then else core_backup=false fi -ynh_replace_string --match_string="^ynh_core_backup=.*" --replace_string="ynh_core_backup=$core_backup" --target_file="$config_file" + +ynh_add_config --template="Backup_list.conf.default" --destination="$config_file" if [ $apps_backup -eq 1 ] then From c8073c748ba29c586276dd21f04a484cdc455c31 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 12:45:20 +0100 Subject: [PATCH 04/53] fix chown to root --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 43ffe31..1422da9 100755 --- a/scripts/install +++ b/scripts/install @@ -158,7 +158,7 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" #================================================= # Set permissions to app files -chown -R root: $final_path +chown -R $app: $final_path #================================================= # GENERIC FINALIZATION From 9971eb97e71bb96211e1632b982792ca15c33b0e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 12:45:55 +0100 Subject: [PATCH 05/53] fix chown to root --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 55db47e..c69782f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,7 +149,7 @@ fi #================================================= # Set permissions on app files -chown -R root: $final_path +chown -R $app: $final_path #================================================= # GENERIC FINALIZATION From 75cc971fd1fca9e6c037ed4107815e730536ebb1 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 12:47:44 +0100 Subject: [PATCH 06/53] use ynh_add_config for cron --- scripts/upgrade | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c69782f..173bed1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,10 +118,7 @@ if [ $overwrite_cron -eq 1 ] then # Verify the checksum and backup the file if it's different ynh_backup_if_checksum_is_different --file="/etc/cron.d/$app" - - cp ../conf/cron /etc/cron.d/$app - ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app - ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app + if [ "$frequency" = "Daily" ]; then cron_freq="0 2 * * *" run_freq="every day" @@ -138,7 +135,8 @@ then cron_freq="0 2 1 * *" run_freq="once a month on the first sunday" fi - ynh_replace_string --match_string="__FREQUENCY__" --replace_string="$cron_freq" --target_file=/etc/cron.d/$app + + ynh_add_config --template="cron" --destination="/etc/cron.d/$app" # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum --file="/etc/cron.d/$app" From c137e001254389dedb09d93c9c36957af54c6fc4 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 13:06:39 +0100 Subject: [PATCH 07/53] test --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1422da9..6ff4ac2 100755 --- a/scripts/install +++ b/scripts/install @@ -158,7 +158,7 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" #================================================= # Set permissions to app files -chown -R $app: $final_path +# chown -R $app: $final_path #================================================= # GENERIC FINALIZATION From 537af64cfd8136ec0055b2ee577e4c3403c5c22e Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 13:12:30 +0100 Subject: [PATCH 08/53] debug --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 6ff4ac2..bb6fb04 100755 --- a/scripts/install +++ b/scripts/install @@ -159,6 +159,7 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" # Set permissions to app files # chown -R $app: $final_path +ynh_exec_warn ls -l #================================================= # GENERIC FINALIZATION From 3e577079e2303057d7867d90879d6f62b0af2824 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 13:13:06 +0100 Subject: [PATCH 09/53] debug 2 --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index bb6fb04..b1948e2 100755 --- a/scripts/install +++ b/scripts/install @@ -159,7 +159,7 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" # Set permissions to app files # chown -R $app: $final_path -ynh_exec_warn ls -l +ynh_exec_warn ls -l $final_path #================================================= # GENERIC FINALIZATION From ddc9681e6f700ce7249def90ce5e021a7d5426bf Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 13:21:20 +0100 Subject: [PATCH 10/53] debug --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index b1948e2..c874e3d 100755 --- a/scripts/install +++ b/scripts/install @@ -159,7 +159,10 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" # Set permissions to app files # chown -R $app: $final_path +## Debug ynh_exec_warn ls -l $final_path +ynh_system_user_exists --username=$app +chmod 777 $final_path #================================================= # GENERIC FINALIZATION From 5b55d1f2317aed1ab13e8e01dcea7e567ffd4541 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 13:23:51 +0100 Subject: [PATCH 11/53] use select type --- config_panel.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config_panel.toml b/config_panel.toml index f6a516d..9c5e51f 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -23,11 +23,13 @@ name = "Archivist configuration" [main.compression.ynh] ask = "Choose the compression algorithm for YunoHost backups" + type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" [main.compression.files] ask = "Choose the compression algorithm for files and directories backups" + type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" @@ -50,6 +52,7 @@ name = "Archivist configuration" [main.backup_options.frequency] ask = "Choose the frequency of your backups ?" + type = "select" choices = ["Daily", "Each 3 days", "Weekly", "Biweekly", "Monthly"] default = "Weekly" From f44761e7403a3e91906862bc624a06125bed9fd0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 13:24:14 +0100 Subject: [PATCH 12/53] use boolean instead of 0/1 --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index e0909d3..6d66784 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,9 @@ ;; Test complet ; Manifest - encrypt=1 + encrypt=true encryption_pwd="password" - core_backup=1 - apps_backup=1 + core_backup=true + apps_backup=true frequency="Weekly" ; Checks pkg_linter=1 From 46eb5ac3c9f3e688c8663a7200d5a979ad52e6c6 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 13:30:33 +0100 Subject: [PATCH 13/53] fix outdated test + debug --- scripts/install | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index c874e3d..61ca16c 100755 --- a/scripts/install +++ b/scripts/install @@ -92,10 +92,8 @@ ynh_script_progression --message="Configuring Archivist..." --weight=2 config_file="$final_path/Backup_list.conf" -if [ $encrypt -eq 1 ] +if [ $encrypt ] then - encrypt=true - passkey="$final_path/passkey" echo "$encryption_pwd" > "$passkey" chmod 400 "$passkey" @@ -104,14 +102,6 @@ else passkey=na fi - -if [ $core_backup -eq 1 ] -then - core_backup=true -else - core_backup=false -fi - ynh_add_config --template="Backup_list.conf.default" --destination="$config_file" if [ $apps_backup -eq 1 ] @@ -161,7 +151,7 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" # chown -R $app: $final_path ## Debug ynh_exec_warn ls -l $final_path -ynh_system_user_exists --username=$app +# ynh_system_user_exists --username=$app chmod 777 $final_path #================================================= From eb9ba03598a46ae4a54281f253f97bd5490714d0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 14:45:21 +0100 Subject: [PATCH 14/53] no longer used --- scripts/config | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/config b/scripts/config index 97f4dff..bf4c13a 100644 --- a/scripts/config +++ b/scripts/config @@ -13,8 +13,6 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -app=$YNH_APP_INSTANCE_NAME - final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= From ca9361fa88edadfdf49ee0559468b5eb96bfb8fe Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 14:50:02 +0100 Subject: [PATCH 15/53] debug 3 --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 61ca16c..fe40bdb 100755 --- a/scripts/install +++ b/scripts/install @@ -148,10 +148,10 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" #================================================= # Set permissions to app files -# chown -R $app: $final_path +chown -R $app: $final_path ## Debug ynh_exec_warn ls -l $final_path -# ynh_system_user_exists --username=$app +ynh_system_user_exists --username=$app chmod 777 $final_path #================================================= From 3924b8e68102b244c92d1ad5797a4e8a6f1755ff Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 16:31:30 +0100 Subject: [PATCH 16/53] debug 4 --- scripts/install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index fe40bdb..447c380 100755 --- a/scripts/install +++ b/scripts/install @@ -148,11 +148,12 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" #================================================= # Set permissions to app files -chown -R $app: $final_path +#chown -R $app: $final_path ## Debug ynh_exec_warn ls -l $final_path -ynh_system_user_exists --username=$app +#ynh_system_user_exists --username=$app chmod 777 $final_path +ynh_exec_warn ls -l $final_path #================================================= # GENERIC FINALIZATION From 63e94a033c78a94e11eff5eda97d8325e4d4af72 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 16:31:45 +0100 Subject: [PATCH 17/53] Rename config to config.bak for debug --- scripts/{config => config.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{config => config.bak} (100%) diff --git a/scripts/config b/scripts/config.bak similarity index 100% rename from scripts/config rename to scripts/config.bak From bbfd1e123d51fbc9e373a40d58da0e241ac3a4c3 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 16:39:51 +0100 Subject: [PATCH 18/53] Rename config.bak to config --- scripts/{config.bak => config} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{config.bak => config} (100%) diff --git a/scripts/config.bak b/scripts/config similarity index 100% rename from scripts/config.bak rename to scripts/config From 9d483271d2e399507108c769b2a20cd04b522b03 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 16:40:08 +0100 Subject: [PATCH 19/53] Rename config to config.bak --- scripts/{config => config.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{config => config.bak} (100%) diff --git a/scripts/config b/scripts/config.bak similarity index 100% rename from scripts/config rename to scripts/config.bak From b36285ec0fef2023203e2975a2d04c2c654ca48a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 16:49:19 +0100 Subject: [PATCH 20/53] fix typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 447c380..9165ef1 100755 --- a/scripts/install +++ b/scripts/install @@ -152,7 +152,7 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" ## Debug ynh_exec_warn ls -l $final_path #ynh_system_user_exists --username=$app -chmod 777 $final_path +chmod -R 777 $final_path ynh_exec_warn ls -l $final_path #================================================= From 8020d9fd0a4d77f4966498bce65e2da1e41d95a2 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 16:52:28 +0100 Subject: [PATCH 21/53] fix tests --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9165ef1..1764d46 100755 --- a/scripts/install +++ b/scripts/install @@ -36,7 +36,7 @@ ynh_script_progression --message="Validating installation parameters..." final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -if [ $encrypt -eq 1 ]; then +if [ $encrypt ]; then test -n "$encryption_pwd" || ynh_die --message="encryption_pwd can't be empty if you choose to enable encryption." fi @@ -104,7 +104,7 @@ fi ynh_add_config --template="Backup_list.conf.default" --destination="$config_file" -if [ $apps_backup -eq 1 ] +if [ $apps_backup ] then # Add all current applications to the backup while read backup_app From 30e4cc33b253cb2a824727202d7d23073e2381e9 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:01:19 +0100 Subject: [PATCH 22/53] save encryption pwd as setting (debug) --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 1764d46..3971808 100755 --- a/scripts/install +++ b/scripts/install @@ -47,6 +47,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=frequency --value="$frequency" ynh_app_setting_set --app=$app --key=encrypt --value="$encrypt" +ynh_app_setting_set --app=$app --key=encryption_pwd --value="$encryption_pwd" ynh_app_setting_set --app=$app --key=core_backup --value="$core_backup" ynh_app_setting_set --app=$app --key=apps_backup --value="$apps_backup" From b13b89bf47b877a93018f94ec43d6e809ddc9ac7 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:09:41 +0100 Subject: [PATCH 23/53] read encryption_pwd from file --- config_panel.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config_panel.toml b/config_panel.toml index cf5efa7..c233ba1 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -16,6 +16,7 @@ name = "Archivist configuration" type = "password" optional = true help = "A password is needed if encryption is activated." + bind = "/var/www/__APP__/passkey" [main.compression] name = "Compression algorithm" From 69d4afee1c631614b09a4d4cc08c44f45c6b9785 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:10:05 +0100 Subject: [PATCH 24/53] remove debug encryption_pwd --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 3971808..0eec22b 100755 --- a/scripts/install +++ b/scripts/install @@ -47,7 +47,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=frequency --value="$frequency" ynh_app_setting_set --app=$app --key=encrypt --value="$encrypt" -ynh_app_setting_set --app=$app --key=encryption_pwd --value="$encryption_pwd" + ynh_app_setting_set --app=$app --key=core_backup --value="$core_backup" ynh_app_setting_set --app=$app --key=apps_backup --value="$apps_backup" From 8279708d685e613e6fb186097a6778e61c7d8435 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:13:38 +0100 Subject: [PATCH 25/53] better option naming --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index c233ba1..e27752a 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -21,13 +21,13 @@ name = "Archivist configuration" [main.compression] name = "Compression algorithm" - [main.compression.ynh] + [main.compression.compress_core] ask = "Choose the compression algorithm for YunoHost backups" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" - [main.compression.files] + [main.compression.compress_files] ask = "Choose the compression algorithm for files and directories backups" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] From 565f1345d9694e6d11a171f4e033b7a758850435 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:17:27 +0100 Subject: [PATCH 26/53] fix naming --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index e27752a..cde357b 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -21,7 +21,7 @@ name = "Archivist configuration" [main.compression] name = "Compression algorithm" - [main.compression.compress_core] + [main.compression.compress_ynh] ask = "Choose the compression algorithm for YunoHost backups" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] From ad73beeef6f0f73494e5463cec75f6d80e1a1362 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:17:49 +0100 Subject: [PATCH 27/53] set compression --- conf/Backup_list.conf.default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/Backup_list.conf.default b/conf/Backup_list.conf.default index 406777f..f8bb8eb 100644 --- a/conf/Backup_list.conf.default +++ b/conf/Backup_list.conf.default @@ -48,8 +48,8 @@ cryptpass="__PASSKEY__" # WARNING: Does not work with encryption ! # # Default: gzip -ynh_compression_mode=gzip -files_compression_mode=gzip +ynh_compression_mode=__COMPRESS_YNH__ +files_compression_mode=__COMPRESS_FILES__ # -------------------------------------------------------------------------------------- ## YUNOHOST BACKUPS From 92cd9e0bd0405ab99884cbf21961fc3645e5f4b5 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:24:39 +0100 Subject: [PATCH 28/53] store all config panel settings --- scripts/install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index 0eec22b..25edd26 100755 --- a/scripts/install +++ b/scripts/install @@ -46,6 +46,7 @@ fi ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=frequency --value="$frequency" +ynh_app_setting_set --app=$app --key=max_size --value=$max_size ynh_app_setting_set --app=$app --key=encrypt --value="$encrypt" ynh_app_setting_set --app=$app --key=core_backup --value="$core_backup" @@ -54,6 +55,9 @@ ynh_app_setting_set --app=$app --key=apps_backup --value="$apps_backup" ynh_app_setting_set --app=$app --key=overwrite_cron --value=1 ynh_app_setting_set --app=$app --key=admin_mail_html --value=1 +ynh_app_setting_set --app=$app --key=compress_ynh --value=$compress_ynh +ynh_app_setting_set --app=$app --key=compress_files --value=$compress_files + #================================================= # STANDARD MODIFICATIONS #================================================= From 283c89d263d80a023e6e615e2f38ff6bb302442d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:44:51 +0100 Subject: [PATCH 29/53] bring back config --- scripts/{config.bak => config} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{config.bak => config} (100%) diff --git a/scripts/config.bak b/scripts/config similarity index 100% rename from scripts/config.bak rename to scripts/config From 666af727511838e14fe4f505a41884b3b546a96a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:58:52 +0100 Subject: [PATCH 30/53] add max_size parameter --- manifest.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manifest.json b/manifest.json index cc9fb77..ef9da7a 100644 --- a/manifest.json +++ b/manifest.json @@ -78,6 +78,15 @@ "choices" : ["Daily", "Each 3 days", "Weekly", "Biweekly", "Monthly"], "default" : "Weekly" } + { + "name": "max_size", + "type": "select", + "ask": { + "en": "Specify the max size of each files backup (soft limit) in Mb. This will try to split the backup by its subdirectories to avoid to have only one big backup.", + }, + "choices" : ["50", "100", "500", "1000", "5000"], + "default" : "500" + } ] } } From 36dfeff51c01e79a30e40bd6d6ab110734ccca06 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 17:59:19 +0100 Subject: [PATCH 31/53] add max_size --- check_process | 1 + 1 file changed, 1 insertion(+) diff --git a/check_process b/check_process index 6d66784..d0b41c5 100644 --- a/check_process +++ b/check_process @@ -5,6 +5,7 @@ core_backup=true apps_backup=true frequency="Weekly" + max_size=500 ; Checks pkg_linter=1 setup_sub_dir=0 From b7c6cf61f1e84a4f5e86b0794932342f2b7b6ec7 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 18:02:30 +0100 Subject: [PATCH 32/53] typo --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index ef9da7a..86bb53f 100644 --- a/manifest.json +++ b/manifest.json @@ -77,7 +77,7 @@ }, "choices" : ["Daily", "Each 3 days", "Weekly", "Biweekly", "Monthly"], "default" : "Weekly" - } + }, { "name": "max_size", "type": "select", From 24cf7d2003cb261b4dd9788f2979e7f3fa7cf723 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 18:11:51 +0100 Subject: [PATCH 33/53] typo --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 86bb53f..0344bd7 100644 --- a/manifest.json +++ b/manifest.json @@ -82,7 +82,7 @@ "name": "max_size", "type": "select", "ask": { - "en": "Specify the max size of each files backup (soft limit) in Mb. This will try to split the backup by its subdirectories to avoid to have only one big backup.", + "en": "Specify the max size of each files backup (soft limit) in Mb. This will try to split the backup by its subdirectories to avoid to have only one big backup." }, "choices" : ["50", "100", "500", "1000", "5000"], "default" : "500" From 23b00204f4226728d4d08962735a5ca641830e85 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 18:34:35 +0100 Subject: [PATCH 34/53] add extra parameters --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index d0b41c5..a77ecb2 100644 --- a/check_process +++ b/check_process @@ -26,4 +26,4 @@ Notification=change ;;; Upgrade options ; #commit=2b2793737d5e1374659cbb74838d10162a2147e6 #name=03 Nov 2017 2b2793737d5e1374659cbb74838d10162a2147e6 - manifest_arg=encrypt=1&encryption_pwd="password"&core_backup=1&apps_backup=1&frequency="Weekly"& + manifest_arg=encrypt=true&encryption_pwd="password"&core_backup=true&apps_backup=true&frequency="Weekly"&max_size=500& From 90a82f9997260df3abd36ba7520ae1f87377686d Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 18:34:48 +0100 Subject: [PATCH 35/53] typo ? --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index a77ecb2..9021b41 100644 --- a/check_process +++ b/check_process @@ -5,7 +5,7 @@ core_backup=true apps_backup=true frequency="Weekly" - max_size=500 + max_size="500" ; Checks pkg_linter=1 setup_sub_dir=0 From 6d7ba1179a171a05b8493af4fe1b54ad22c3028a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 18:47:41 +0100 Subject: [PATCH 36/53] placeholder --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 25edd26..1474809 100755 --- a/scripts/install +++ b/scripts/install @@ -46,7 +46,7 @@ fi ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=frequency --value="$frequency" -ynh_app_setting_set --app=$app --key=max_size --value=$max_size +ynh_app_setting_set --app=$app --key=max_size --value=500 #$max_size ynh_app_setting_set --app=$app --key=encrypt --value="$encrypt" ynh_app_setting_set --app=$app --key=core_backup --value="$core_backup" From 805594ad89db848f57c06204e2f8128042f593db Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 18:54:05 +0100 Subject: [PATCH 37/53] get settings --- scripts/install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1474809..0ab8cf0 100755 --- a/scripts/install +++ b/scripts/install @@ -25,6 +25,9 @@ encryption_pwd=$YNH_APP_ARG_ENCRYPTION_PWD core_backup=$YNH_APP_ARG_CORE_BACKUP apps_backup=$YNH_APP_ARG_APPS_BACKUP frequency="$YNH_APP_ARG_FREQUENCY" +max_size="$YNH_APP_ARG_MAX_SIZE" +compress_ynh="$YNH_APP_COMPRESS_YNH" +compress_files="$YNH_APP_COMPRESS_FILES" app=$YNH_APP_INSTANCE_NAME @@ -46,7 +49,7 @@ fi ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=frequency --value="$frequency" -ynh_app_setting_set --app=$app --key=max_size --value=500 #$max_size +ynh_app_setting_set --app=$app --key=max_size --value=$max_size ynh_app_setting_set --app=$app --key=encrypt --value="$encrypt" ynh_app_setting_set --app=$app --key=core_backup --value="$core_backup" From ad2466e5d549065a6b79ed699bf23dfb4c33e430 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 18:57:49 +0100 Subject: [PATCH 38/53] typo --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 0ab8cf0..0a32a8e 100755 --- a/scripts/install +++ b/scripts/install @@ -26,8 +26,8 @@ core_backup=$YNH_APP_ARG_CORE_BACKUP apps_backup=$YNH_APP_ARG_APPS_BACKUP frequency="$YNH_APP_ARG_FREQUENCY" max_size="$YNH_APP_ARG_MAX_SIZE" -compress_ynh="$YNH_APP_COMPRESS_YNH" -compress_files="$YNH_APP_COMPRESS_FILES" +compress_ynh="$YNH_APP_ARG_COMPRESS_YNH" +compress_files="$YNH_APP_ARG_COMPRESS_FILES" app=$YNH_APP_INSTANCE_NAME From 133a19cdc3f41b28d8e6a424cb75c3ef92336000 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 19:02:36 +0100 Subject: [PATCH 39/53] fix compression default value --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 0a32a8e..fea3182 100755 --- a/scripts/install +++ b/scripts/install @@ -26,8 +26,8 @@ core_backup=$YNH_APP_ARG_CORE_BACKUP apps_backup=$YNH_APP_ARG_APPS_BACKUP frequency="$YNH_APP_ARG_FREQUENCY" max_size="$YNH_APP_ARG_MAX_SIZE" -compress_ynh="$YNH_APP_ARG_COMPRESS_YNH" -compress_files="$YNH_APP_ARG_COMPRESS_FILES" +compress_ynh="gzip" # by default +compress_files="gzip" # by default app=$YNH_APP_INSTANCE_NAME From 04985e275e47eac82685dc962759db0f2ddb0155 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 19:14:40 +0100 Subject: [PATCH 40/53] bind more variables --- config_panel.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index cde357b..66a871b 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -10,13 +10,14 @@ name = "Archivist configuration" ask = "Do you want to encrypt your backups ?" type = "boolean" default = true + bind = "encrypt:/opt/yunohost/__APP__/Backup_list.conf" [main.encryption.encryption_pwd] ask = "Set the password for encryption" type = "password" optional = true help = "A password is needed if encryption is activated." - bind = "/var/www/__APP__/passkey" + bind = "/opt/yunohost/__APP__/passkey" [main.compression] name = "Compression algorithm" @@ -26,12 +27,14 @@ name = "Archivist configuration" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" - + bind = "ynh_compression_mode:/opt/yunohost/__APP__/Backup_list.conf" + [main.compression.compress_files] ask = "Choose the compression algorithm for files and directories backups" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" + bind = "files_compression_mode:/opt/yunohost/__APP__/Backup_list.conf" [main.backup_types] name = "Backup" @@ -40,6 +43,7 @@ name = "Archivist configuration" ask = "Would you like to backup your YunoHost core ?" type = "boolean" default = true + bind = "ynh_core_backup:/opt/yunohost/__APP__/Backup_list.conf" [main.backup_types.apps_backup] ask = "Would you like to backup your apps ?" From 9a950b6b80ca495e8e9068f06066915e17daf4bb Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 19:32:11 +0100 Subject: [PATCH 41/53] fix condition syntax --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 70939ea..70ddc89 100644 --- a/scripts/config +++ b/scripts/config @@ -122,7 +122,7 @@ apply_config() { #================================================= # Change the password if needed - if [ "$encrypt" ] + if [ "$encrypt" = true ] then ynh_print_OFF test -n "$encrypt_password" || ynh_die --message="The password for encryption can't be empty if you choose to enable encryption." From 3c474e4726733d47c1e6e19507be72e9466499b4 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 19:33:21 +0100 Subject: [PATCH 42/53] fix conditions --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index fea3182..9f4b0f0 100755 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,7 @@ ynh_script_progression --message="Validating installation parameters..." final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -if [ $encrypt ]; then +if [ "$encrypt" = true]; then test -n "$encryption_pwd" || ynh_die --message="encryption_pwd can't be empty if you choose to enable encryption." fi @@ -100,7 +100,7 @@ ynh_script_progression --message="Configuring Archivist..." --weight=2 config_file="$final_path/Backup_list.conf" -if [ $encrypt ] +if [ "$encrypt" = true ] then passkey="$final_path/passkey" echo "$encryption_pwd" > "$passkey" @@ -112,7 +112,7 @@ fi ynh_add_config --template="Backup_list.conf.default" --destination="$config_file" -if [ $apps_backup ] +if [ "$apps_backup" = true ] then # Add all current applications to the backup while read backup_app From 83deac04f3476ae8004efd26d53b81fbe53a2874 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 19:46:05 +0100 Subject: [PATCH 43/53] typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9f4b0f0..6ae8e90 100755 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,7 @@ ynh_script_progression --message="Validating installation parameters..." final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -if [ "$encrypt" = true]; then +if [ "$encrypt" = true ]; then test -n "$encryption_pwd" || ynh_die --message="encryption_pwd can't be empty if you choose to enable encryption." fi From a82d7ed04628ea227cf13459feea7ed15d05f983 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 19:48:11 +0100 Subject: [PATCH 44/53] use $final_path --- config_panel.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 66a871b..1a58309 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -10,14 +10,14 @@ name = "Archivist configuration" ask = "Do you want to encrypt your backups ?" type = "boolean" default = true - bind = "encrypt:/opt/yunohost/__APP__/Backup_list.conf" + bind = "encrypt:$final_path/Backup_list.conf" [main.encryption.encryption_pwd] ask = "Set the password for encryption" type = "password" optional = true help = "A password is needed if encryption is activated." - bind = "/opt/yunohost/__APP__/passkey" + bind = "$final_path/passkey" [main.compression] name = "Compression algorithm" @@ -27,14 +27,14 @@ name = "Archivist configuration" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" - bind = "ynh_compression_mode:/opt/yunohost/__APP__/Backup_list.conf" + bind = "ynh_compression_mode:$final_path/Backup_list.conf" [main.compression.compress_files] ask = "Choose the compression algorithm for files and directories backups" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" - bind = "files_compression_mode:/opt/yunohost/__APP__/Backup_list.conf" + bind = "files_compression_mode:$final_path/Backup_list.conf" [main.backup_types] name = "Backup" @@ -43,7 +43,7 @@ name = "Archivist configuration" ask = "Would you like to backup your YunoHost core ?" type = "boolean" default = true - bind = "ynh_core_backup:/opt/yunohost/__APP__/Backup_list.conf" + bind = "ynh_core_backup:$final_path/Backup_list.conf" [main.backup_types.apps_backup] ask = "Would you like to backup your apps ?" From c655e63e28ca128ad689791234f2cad54a2a2aa0 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 19:55:26 +0100 Subject: [PATCH 45/53] fix syntax --- config_panel.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 1a58309..6debd3d 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -10,14 +10,14 @@ name = "Archivist configuration" ask = "Do you want to encrypt your backups ?" type = "boolean" default = true - bind = "encrypt:$final_path/Backup_list.conf" + bind = "encrypt:__FINAL_PATH__/Backup_list.conf" [main.encryption.encryption_pwd] ask = "Set the password for encryption" type = "password" optional = true help = "A password is needed if encryption is activated." - bind = "$final_path/passkey" + bind = "__FINAL_PATH__/passkey" [main.compression] name = "Compression algorithm" @@ -27,14 +27,14 @@ name = "Archivist configuration" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" - bind = "ynh_compression_mode:$final_path/Backup_list.conf" + bind = "ynh_compression_mode:__FINAL_PATH__/Backup_list.conf" [main.compression.compress_files] ask = "Choose the compression algorithm for files and directories backups" type = "select" choices = ["gzip", "lzop", "zstd", "bzip2", "lzma", "lzip", "xz", "No compression"] default = "gzip" - bind = "files_compression_mode:$final_path/Backup_list.conf" + bind = "files_compression_mode:__FINAL_PATH__/Backup_list.conf" [main.backup_types] name = "Backup" @@ -43,7 +43,7 @@ name = "Archivist configuration" ask = "Would you like to backup your YunoHost core ?" type = "boolean" default = true - bind = "ynh_core_backup:$final_path/Backup_list.conf" + bind = "ynh_core_backup:__FINAL_PATH__/Backup_list.conf" [main.backup_types.apps_backup] ask = "Would you like to backup your apps ?" From 08318ffe1a66331a3d23c8474fc3bcd7f74553b4 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 20:11:12 +0100 Subject: [PATCH 46/53] debug --- config_panel.toml => config_panel.toml.bak | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config_panel.toml => config_panel.toml.bak (100%) diff --git a/config_panel.toml b/config_panel.toml.bak similarity index 100% rename from config_panel.toml rename to config_panel.toml.bak From 79e91887a0506ee2125269a51cb4d3ff2722b779 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 31 Dec 2023 20:11:19 +0100 Subject: [PATCH 47/53] debug --- scripts/{config => config.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{config => config.bak} (100%) diff --git a/scripts/config b/scripts/config.bak similarity index 100% rename from scripts/config rename to scripts/config.bak From 4f88e6a2968848118234cb4a2bbd8a3e066b3885 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 14 Jan 2024 11:46:28 +0100 Subject: [PATCH 48/53] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 0344bd7..37f8501 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Automatic backups", "fr": "Sauvegardes automatiques" }, - "version": "1.3.4~ynh1", + "version": "1.3.4~ynh2", "url": "https://github.com/maniackcrudelis/archivist", "upstream": { "license": "GPL-3.0", From c9a5854ad507759e802b8725bdd8ea459d6867dd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 14 Jan 2024 10:46:31 +0000 Subject: [PATCH 49/53] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f425656..dc46b8d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Archivist is automatically launched periodicaly to update your backups and send -**Shipped version:** 1.3.4~ynh1 +**Shipped version:** 1.3.4~ynh2 ## Disclaimers / important information ## Configuration diff --git a/README_fr.md b/README_fr.md index bf61768..fdc7db2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -23,7 +23,7 @@ Vos sauvegardes peuvent être envoyées à de nombreux autres endroits, locaux o Archivist est automatiquement lancé périodiquement pour mettre à jour vos sauvegardes et envoyer les modifications aux autres emplacements. -**Version incluse :** 1.3.4~ynh1 +**Version incluse :** 1.3.4~ynh2 ## Avertissements / informations importantes ## Configuration From 02a76467af3e9966958a80b7d951791795723f6c Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 14 Jan 2024 11:51:00 +0100 Subject: [PATCH 50/53] create archivist user + debug --- scripts/install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 6ae8e90..0ccec65 100755 --- a/scripts/install +++ b/scripts/install @@ -79,6 +79,8 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 +ynh_system_user_create --username=$app --groups="admin" + ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -156,11 +158,11 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" #================================================= # Set permissions to app files -#chown -R $app: $final_path +chown -R $app: $final_path ## Debug ynh_exec_warn ls -l $final_path -#ynh_system_user_exists --username=$app -chmod -R 777 $final_path +ynh_system_user_exists --username=$app +#chmod -R 777 $final_path ynh_exec_warn ls -l $final_path #================================================= From 9e62eea64c8f751abef8fbe0c548f20a08f4bc17 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 14 Jan 2024 11:54:28 +0100 Subject: [PATCH 51/53] Create sudoer Allow only some commands to run as root --- conf/sudoer | 1 + 1 file changed, 1 insertion(+) create mode 100644 conf/sudoer diff --git a/conf/sudoer b/conf/sudoer new file mode 100644 index 0000000..a537c69 --- /dev/null +++ b/conf/sudoer @@ -0,0 +1 @@ +__APP__ ALL=(root) NOPASSWD: /usr/bin/yunohost backup create *, /usr/bin/yunohost backup restore *, /usr/bin/yunohost backup delete *, /usr/bin/yunohost app list *, /usr/bin/yunohost app remove *, /bin/ls From 5922f35e70cbf205992e8d4e6a71bc8f35e3f2bf Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 14 Jan 2024 11:57:49 +0100 Subject: [PATCH 52/53] typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 0ccec65..a21d552 100755 --- a/scripts/install +++ b/scripts/install @@ -79,7 +79,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -ynh_system_user_create --username=$app --groups="admin" +ynh_system_user_create --username=$app --groups="admins" ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src From 1648851af88ea3044a2f2d38c1d9555fd7969976 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 14 Jan 2024 12:00:29 +0100 Subject: [PATCH 53/53] Remove debug --- scripts/install | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/install b/scripts/install index a21d552..c45eeef 100755 --- a/scripts/install +++ b/scripts/install @@ -159,11 +159,6 @@ ynh_store_file_checksum --file="/etc/cron.d/$app" # Set permissions to app files chown -R $app: $final_path -## Debug -ynh_exec_warn ls -l $final_path -ynh_system_user_exists --username=$app -#chmod -R 777 $final_path -ynh_exec_warn ls -l $final_path #================================================= # GENERIC FINALIZATION