From 1c74971f8cd2df8c47ca8d42c649d9feb188ec68 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Nov 2021 18:53:23 +0100 Subject: [PATCH 1/3] Remove arch helper --- .github/workflows/updater.sh | 4 ++-- conf/{x86-64.src => amd64.src} | 0 conf/{arm.src => armhf.src} | 0 manifest.json | 8 +++----- scripts/install | 1 + scripts/remove | 12 ++++++++++++ scripts/restore | 2 -- scripts/upgrade | 2 +- scripts/ynh_detect_arch__2 | 14 -------------- 9 files changed, 19 insertions(+), 24 deletions(-) rename conf/{x86-64.src => amd64.src} (100%) rename conf/{arm.src => armhf.src} (100%) delete mode 100644 scripts/ynh_detect_arch__2 diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 54a624f..dc09aa4 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -64,7 +64,7 @@ echo "Handling asset at $asset_url" # Leave $src empty to ignore the asset case $asset_url in *"linux-arm-"*) - src="arm" + src="armhf" ;; *"linux-arm64-"*) src="arm64" @@ -73,7 +73,7 @@ case $asset_url in src="i386" ;; *"linux-amd64-"*) - src="x86-64" + src="amd64" ;; *) src="" diff --git a/conf/x86-64.src b/conf/amd64.src similarity index 100% rename from conf/x86-64.src rename to conf/amd64.src diff --git a/conf/arm.src b/conf/armhf.src similarity index 100% rename from conf/arm.src rename to conf/armhf.src diff --git a/manifest.json b/manifest.json index b4508d2..fb1358e 100644 --- a/manifest.json +++ b/manifest.json @@ -25,7 +25,7 @@ } ], "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -35,8 +35,7 @@ "install": [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -46,8 +45,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" } ] } diff --git a/scripts/install b/scripts/install index e4938d0..3b21a35 100644 --- a/scripts/install +++ b/scripts/install @@ -27,6 +27,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN +architecture=$YNH_ARCH app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/remove b/scripts/remove index 455f8b1..5fb98ea 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) 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) @@ -50,6 +51,17 @@ ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the app data directory with the command `yunohost app remove syncthing --purge` +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing $app data directory..." --weight=2 + ynh_secure_remove --file="$sync_home" +fi + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index b735318..c7a2f0b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,8 +38,6 @@ sync_port=$(ynh_app_setting_get --app=$app --key=sync_port) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " diff --git a/scripts/upgrade b/scripts/upgrade index 1cd65ce..1a7d922 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ app=$YNH_APP_INSTANCE_NAME 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) +architecture=$YNH_ARCH sync_home=$(ynh_app_setting_get --app=$app --key=sync_home) sync_port=$(ynh_app_setting_get --app=$app --key=sync_port) @@ -100,7 +101,6 @@ if [ -z $gui_port ]; then ynh_remove_logrotate ynh_remove_app_dependencies - fi # Cleaning legacy permissions diff --git a/scripts/ynh_detect_arch__2 b/scripts/ynh_detect_arch__2 deleted file mode 100644 index ba04b7e..0000000 --- a/scripts/ynh_detect_arch__2 +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" -elif [ -n "$(uname -m | grep 64)" ]; then - architecture="x86-64" -elif [ -n "$(uname -m | grep 86)" ]; then - architecture="i386" -elif [ -n "$(uname -m | grep arm)" ]; then - architecture="arm" -else - ynh_die "Unable to detect your achitecture, please open a bug describing \ - your hardware and the result of the command \"uname -m\"." 1 -fi From 3c851016628690f4a12f50bdcf2ab99f54bece22 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 21 Nov 2021 08:45:57 +0100 Subject: [PATCH 2/3] remove arch helper --- scripts/install | 1 - scripts/upgrade | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3b21a35..0472aa6 100644 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_detect_arch__2 source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1a7d922..fbdda49 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_detect_arch__2 source /usr/share/yunohost/helpers #================================================= From d757a83727b90d7bd02f146e317fc6a9990b4ec9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 21 Nov 2021 08:47:27 +0100 Subject: [PATCH 3/3] Update check_process --- check_process | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/check_process b/check_process index 94815a3..788f498 100644 --- a/check_process +++ b/check_process @@ -12,13 +12,13 @@ setup_public=1 upgrade=1 # 1.1.1 - upgrade=1 from_commit=571623f6ea0dc6310a8d6b991b03c4a84337ce92 + #upgrade=1 from_commit=571623f6ea0dc6310a8d6b991b03c4a84337ce92 # 1.3.3 - upgrade=1 from_commit=2b2b346b2d154653ff2affb5679a7cd8d60892fa + #upgrade=1 from_commit=2b2b346b2d154653ff2affb5679a7cd8d60892fa # 1.4.0 - upgrade=1 from_commit=cfd8f2894d381f0b1149b1061dff695c0941fcc3 + #upgrade=1 from_commit=cfd8f2894d381f0b1149b1061dff695c0941fcc3 # 1.4.2 - upgrade=1 from_commit=a351c2b6431a3ac092f3581a9778a402ec81f963 + #upgrade=1 from_commit=a351c2b6431a3ac092f3581a9778a402ec81f963 # 1.5.0~ynh1 #upgrade=1 from_commit=91793d91bca31838cbb97782a633d3732e178b8a # 1.6.1~ynh1 @@ -42,11 +42,11 @@ # 1.16.1~ynh1 #upgrade=1 from_commit=a1a1134571e6f9d274b6772358bedfb4b775fe5a # 1.17.0~ynh1 - upgrade=1 from_commit=3d2f2de9824f4e76c506bb587e4167255ff5f900 + #upgrade=1 from_commit=3d2f2de9824f4e76c506bb587e4167255ff5f900 # 1.18.0~ynh1 - upgrade=1 from_commit=ba40babc2a4dce4557fc57ab0dd19dc49a70f637 + #upgrade=1 from_commit=ba40babc2a4dce4557fc57ab0dd19dc49a70f637 # 1.18.1~ynh1 - upgrade=1 from_commit=3e69fac2078f96ba5a4cb73966345f44a95147bf + #upgrade=1 from_commit=3e69fac2078f96ba5a4cb73966345f44a95147bf # 1.18.2~ynh1 upgrade=1 from_commit=f0cfbbfd9acf04d7df4d2b7c6c6f80da4db04f24 backup_restore=1