From 73fbbcb01fb5869348781918f7a2eb6668aea849 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 20 Jan 2021 08:34:06 +0100 Subject: [PATCH 1/2] fix linter warnings --- check_process | 4 +--- manifest.json | 4 ++-- scripts/backup | 2 -- scripts/restore | 2 +- scripts/upgrade | 6 ++++++ 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/check_process b/check_process index f159030..8672ecd 100644 --- a/check_process +++ b/check_process @@ -37,7 +37,7 @@ setup_public=1 upgrade=1 backup_restore=1 - multi_instance=0 + multi_instance=1 port_already_use=1 (9001) change_url=1 actions=1 @@ -85,8 +85,6 @@ useldap=0 ; Checks setup_root=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=change diff --git a/manifest.json b/manifest.json index 83daae7..8df7210 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online editor providing collaborative editing in real-time.", "fr": "Éditeur en ligne fournissant l'édition collaborative en temps réel." }, - "version": "1.8.4~ynh1", + "version": "1.8.4~ynh2", "url": "https://framapad.org", "license": "Apache-2.0", "maintainer": { @@ -18,7 +18,7 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 3.6" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/backup b/scripts/backup index 1b563c6..a446a3e 100644 --- a/scripts/backup +++ b/scripts/backup @@ -36,7 +36,6 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -CHECK_SIZE "$final_path" ynh_backup --src_path="$final_path" #================================================= @@ -51,7 +50,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql -CHECK_SIZE "db.sql" #================================================= # SPECIFIC BACKUP diff --git a/scripts/restore b/scripts/restore index 1510ced..248d03c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -149,7 +149,7 @@ yunohost service add $app --log "/var/log/$app/etherpad.log" ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # RESTORE FAIL2BAN CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 79e4cf0..23f0a3b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -358,6 +358,12 @@ chmod 600 "$final_path/credentials.json" # Restrict access to credentials.json chown $app -R /var/log/$app/etherpad.log +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add $app --log "/var/log/$app/etherpad.log" + #================================================= # UPGRADE FAIL2BAN #================================================= From f5117015c92267313090c35c7422bc42db6af361 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 20 Jan 2021 08:35:19 +0100 Subject: [PATCH 2/2] Update _common.sh --- scripts/_common.sh | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 5d01975..dd120b1 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,28 +4,6 @@ # PERSONAL HELPERS #================================================= -#================================================= -# BACKUP -#================================================= - -HUMAN_SIZE () { # Transforme une taille en Ko en une taille lisible pour un humain - human=$(numfmt --to=iec --from-unit=1K $1) - echo $human -} - -CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant - file_to_analyse=$1 - backup_size=$(du --summarize "$file_to_analyse" | cut -f1) - free_space=$(df --output=avail "/home/yunohost.backup" | sed 1d) - - if [ $free_space -le $backup_size ] - then - ynh_print_err "Espace insuffisant pour sauvegarder $file_to_analyse." - ynh_print_err "Espace disponible : $(HUMAN_SIZE $free_space)" - ynh_die "Espace nécessaire : $(HUMAN_SIZE $backup_size)" - fi -} - #================================================= # FUTUR OFFICIAL HELPERS #=================================================