From fb12d31e30316b0cca44c9c6f744866f810587c5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 20:26:31 +0100 Subject: [PATCH 1/5] Upgrade to 1.12.0 --- README.md | 2 +- check_process | 4 ++++ conf/arm.src | 4 ++-- conf/arm64.src | 4 ++-- conf/i386.src | 4 ++-- conf/x86-64.src | 4 ++-- manifest.json | 2 +- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index acd508b..c827177 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet. -**Shipped version:** 1.10.0 +**Shipped version:** 1.12.0 ## Screenshots diff --git a/check_process b/check_process index 68aa782..d765378 100644 --- a/check_process +++ b/check_process @@ -30,6 +30,8 @@ upgrade=1 from_commit=73bac603324544f2ae3de05487f804a09c0a3673 # 1.8.0~ynh1 upgrade=1 from_commit=36c6b16e1ede95d51d3ddcbf8b00f6f2ee1a843f + # 1.10.0~ynh1 + upgrade=1 from_commit=f8bfd49d14a7050f30452884c6d59c972c2843ef backup_restore=1 multi_instance=0 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. @@ -57,3 +59,5 @@ Notification=all name=1.6.1~ynh1 ; commit=36c6b16e1ede95d51d3ddcbf8b00f6f2ee1a843f name=1.8.0~ynh1 + ; commit=f8bfd49d14a7050f30452884c6d59c972c2843ef + name=1.10.0~ynh1 diff --git a/conf/arm.src b/conf/arm.src index 1224cfe..c539ce2 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-linux-arm-v1.10.0.tar.gz -SOURCE_SUM=4ea920bd257377efcae1d17fb83091efb5bb3bb755782875593ccc6c7f70eac1 +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.12.0/syncthing-linux-arm-v1.12.0.tar.gz +SOURCE_SUM=53316f99af2b4c618636e64e3b28ea2fd257720806ce48bfa2ca5dbea8b3b4a7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/arm64.src b/conf/arm64.src index 3c43208..bf80ab5 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-linux-arm64-v1.10.0.tar.gz -SOURCE_SUM=7b1f0cd58eddbaac6d89df813d1f5ea13ea3240570a202db031b1bb7765269a0 +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.12.0/syncthing-linux-arm64-v1.12.0.tar.gz +SOURCE_SUM=f26f9c091e04f4337faf334ef44f8b1ca2b32a1f2e391bea3e1aa998ef3d4e87 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src index e54cefd..289aebe 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-linux-386-v1.10.0.tar.gz -SOURCE_SUM=3fcc34be89342f8e0c98e2d042e9cb320c48bf9ab37170b94ad9bc03d54e2ac5 +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.12.0/syncthing-linux-386-v1.12.0.tar.gz +SOURCE_SUM=811238f8ccc4e4a8d84aef825fd9009d34dde290712f6a0e88efdd3f930f2f6d SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/x86-64.src b/conf/x86-64.src index ab6345a..593ccc6 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-linux-amd64-v1.10.0.tar.gz -SOURCE_SUM=220e4355ed3a05461fccdddf8a96d73ee7b733b6feca34b7ba1405801676c6b8 +SOURCE_URL=https://github.com/syncthing/syncthing/releases/download/v1.12.0/syncthing-linux-amd64-v1.12.0.tar.gz +SOURCE_SUM=7ccfaa5c6d12c9974521eabc999c70556830a16f6fd2496c6bcefc0a4404ef64 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index ee47fac..b5be799 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Continuous file synchronization program.", "fr": "Programme de synchronisation de fichiers en continu." }, - "version": "1.10.0~ynh1", + "version": "1.12.0~ynh1", "url": "https://syncthing.net/", "license": "MPL-2.0", "maintainer": [ From 74fc9ed43e8fa531ddba45eb3a4741b71d46ba16 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 20:36:44 +0100 Subject: [PATCH 2/5] Please add --quiet to systemctl enable/disable commands to avoid unecessary warnings when the script runs --- scripts/restore | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 6d438b7..181cda8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -91,7 +91,7 @@ chown -R "$app": "$sync_home" 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 #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/upgrade b/scripts/upgrade index 511612e..be04a9b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,7 +71,7 @@ if [ -z $gui_port ]; then systemctl stop syncthing@$OLD_SYNCUSER.service yunohost service remove syncthing@$OLD_SYNCUSER.service - systemctl disable syncthing@$OLD_SYNCUSER.service + systemctl disable syncthing@$OLD_SYNCUSER.service --quiet ynh_secure_remove --file="/etc/apt/sources.list.d/syncthing.list" From 9de72d9d848fa76c7f1d29842d262708826f6221 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 20:38:01 +0100 Subject: [PATCH 3/5] We recommend to *not* use 'ynh_script_progression' in backup scripts --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index b77b5e3..ccef97b 100644 --- a/scripts/backup +++ b/scripts/backup @@ -59,7 +59,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= # BACKUP THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Backing up data directory..." +ynh_print_info --message="Backing up data directory..." ynh_backup --src_path="$sync_home" --is_big From 8fedbed7d201cdd069c8cde77c86dd03a17782c8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 20:38:45 +0100 Subject: [PATCH 4/5] Using option '--log_type systemd' with 'yunohost service add' is not relevant anymore --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 75c0984..e1d9ec5 100644 --- a/scripts/install +++ b/scripts/install @@ -162,7 +162,7 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" --log_type "systemd" +yunohost service add $app --description "$app daemon for Syncthing" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index 181cda8..bbb0233 100644 --- a/scripts/restore +++ b/scripts/restore @@ -98,7 +98,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" --log_type "systemd" +yunohost service add $app --description "$app daemon for Syncthing" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index be04a9b..00a379a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -180,7 +180,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" --log_type "systemd" +yunohost service add $app --description "$app daemon for Syncthing" #================================================= # GENERIC FINALIZATION From bb2dfbc96e995a65dd81f8c6295e9fbd8373e172 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 20:43:30 +0100 Subject: [PATCH 5/5] The install script expose a port on the outside with 'yunohost firewall allow' but doesn't use 'yunohost service add' with --needs_exposed_ports ... --- scripts/install | 2 +- scripts/restore | 11 ++++++++++- scripts/upgrade | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index e1d9ec5..10a1496 100644 --- a/scripts/install +++ b/scripts/install @@ -162,7 +162,7 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" +yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index bbb0233..b51c5ca 100644 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) sync_home=$(ynh_app_setting_get --app=$app --key=sync_home) +sync_port=$(ynh_app_setting_get --app=$app --key=sync_port) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -44,6 +45,14 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS +#================================================= +# OPEN A PORT +#================================================= +ynh_script_progression --message="Configuring firewall..." + +# Open the port +ynh_exec_warn_less yunohost firewall allow TCP $sync_port + #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= @@ -98,7 +107,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" +yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 00a379a..96ad24e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -180,7 +180,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Syncthing" +yunohost service add $app --description "$app daemon for Syncthing" --needs_exposed_ports $sync_port #================================================= # GENERIC FINALIZATION