From 94a1d5ee93bdcfad620e3756faaabd7af696b57a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Nov 2021 23:49:33 +0100 Subject: [PATCH 1/7] 4.3 --- check_process | 7 ------- conf/{app.x64.src => amd64.src} | 0 conf/app.src.default | 7 ------- conf/{app.arm64.src => arm64.src} | 0 conf/{app.arm.src => armhf.src} | 0 conf/nginx.conf | 5 ----- manifest.json | 12 +++++------- scripts/_common.sh | 16 ---------------- scripts/backup | 5 ----- scripts/install | 3 ++- scripts/remove | 10 ---------- scripts/restore | 5 +---- scripts/upgrade | 9 ++------- 13 files changed, 10 insertions(+), 69 deletions(-) rename conf/{app.x64.src => amd64.src} (100%) delete mode 100644 conf/app.src.default rename conf/{app.arm64.src => arm64.src} (100%) rename conf/{app.arm.src => armhf.src} (100%) diff --git a/check_process b/check_process index 0b1d043..d8eaeed 100644 --- a/check_process +++ b/check_process @@ -1,14 +1,8 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest domain="domain.tld" path="/path" admin="john" - port="666" ; Checks pkg_linter=1 setup_sub_dir=1 @@ -20,7 +14,6 @@ #upgrade=1 from_commit=CommitHash backup_restore=1 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email= diff --git a/conf/app.x64.src b/conf/amd64.src similarity index 100% rename from conf/app.x64.src rename to conf/amd64.src diff --git a/conf/app.src.default b/conf/app.src.default deleted file mode 100644 index f776a77..0000000 --- a/conf/app.src.default +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/Lidarr/Lidarr/releases/download/v__VERSION__/Lidarr.master.__VERSION__.linux-core-__ARCHITECTURE__.tar.gz -SOURCE_SUM=__CHECKSUM__ -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=true -SOURCE_FILENAME=lidarr.tar.gz diff --git a/conf/app.arm64.src b/conf/arm64.src similarity index 100% rename from conf/app.arm64.src rename to conf/arm64.src diff --git a/conf/app.arm.src b/conf/armhf.src similarity index 100% rename from conf/app.arm.src rename to conf/armhf.src diff --git a/conf/nginx.conf b/conf/nginx.conf index 1331f6f..b374ab5 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,6 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__ { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_pass http://127.0.0.1:__PORT____PATH__; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/manifest.json b/manifest.json index ae3edd1..59a4948 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "lidarr", "packaging_format": 1, "description": { - "en": "A music collection manager for Usenet and BitTorrent users.", - "fr": "Un gestionnaire de discothèque pour utilisateurs de Usenet et BitTorrent." + "en": "Music collection manager for Usenet and BitTorrent users", + "fr": "Gestionnaire de discothèque pour utilisateurs de Usenet et BitTorrent" }, "version": "0.8.1.2135~ynh1", "url": "https://lidarr.audio", @@ -20,7 +20,7 @@ "email": "tituspijean@outlook.com" }, "requirements": { - "yunohost": ">= 4.2" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -32,8 +32,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -43,8 +42,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 87d05f0..8ae5eaf 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,9 +6,6 @@ version="0.8.1.2135" -# Supported architectures -supported_architectures=("arm" "arm64" "x64") - # dependencies used by the app pkg_dependencies="curl mediainfo sqlite3" @@ -16,19 +13,6 @@ pkg_dependencies="curl mediainfo sqlite3" # PERSONAL HELPERS #================================================= -get_architecture() { - architecture=$(dpkg --print-architecture) - if [ $architecture = "amd64" ]; then - architecture="x64" - elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 32 ]]; then - architecture="arm" - elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 64 ]]; then - architecture="arm64" - elif [[ $(echo ${supported_architectures[@]} | grep -ow "$architecture" | wc -w) = 0 ]]; then - ynh_die --message="Unsupported architecture $architecture" - fi -} - #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 0670178..bfc28b4 100755 --- a/scripts/backup +++ b/scripts/backup @@ -36,11 +36,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= diff --git a/scripts/install b/scripts/install index ca6202a..dfdfd17 100755 --- 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 @@ -85,7 +86,7 @@ get_architecture 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" --source_id="app.$architecture" +ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" mkdir -p "$final_path/.data/logs" diff --git a/scripts/remove b/scripts/remove index 6a5a83e..ee51944 100755 --- a/scripts/remove +++ b/scripts/remove @@ -73,16 +73,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index 11c5999..2dc6ad6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,10 +37,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -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 " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index a9b0796..383717c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,17 +21,12 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +architecture=$YNH_ARCH #================================================= # CHECK VERSION #================================================= -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. upgrade_type=$(ynh_check_app_version_changed) #================================================= @@ -86,7 +81,7 @@ then get_architecture # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id="app.$architecture" + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" fi mkdir -p "$final_path/.data/logs" From 56bd2f722272585097f1f31820e9f7bb0e24da3e Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 22 Nov 2021 22:49:39 +0000 Subject: [PATCH 2/7] 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 c6f8230..04991de 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -A music collection manager for Usenet and BitTorrent users. +Music collection manager for Usenet and BitTorrent users **Shipped version:** 0.8.1.2135~ynh1 diff --git a/README_fr.md b/README_fr.md index 2718e3f..596c4f2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Un gestionnaire de discothèque pour utilisateurs de Usenet et BitTorrent. +Gestionnaire de discothèque pour utilisateurs de Usenet et BitTorrent **Version incluse :** 0.8.1.2135~ynh1 From 120cbf26f69622173a27390ee14365d2bc440e5f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Nov 2021 23:52:20 +0100 Subject: [PATCH 3/7] Update change_url --- scripts/change_url | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c177364..e9358bb 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -34,7 +34,7 @@ api_key=$(ynh_app_setting_get --app=$app --key=api_key) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -69,14 +69,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -119,14 +119,14 @@ chown $app "$final_path/.data/config.xml" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting Web Server" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -134,4 +134,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last From 4707220de1216daa914729ca2a2dcb83aad3377f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 22:12:58 +0100 Subject: [PATCH 4/7] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index dfdfd17..6909f82 100755 --- a/scripts/install +++ b/scripts/install @@ -86,7 +86,7 @@ get_architecture 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" --source_id="$architecture" +ynh_setup_source --dest_dir="$final_path" --source_id="architecture" mkdir -p "$final_path/.data/logs" From 0484bbf3582ed3ff2ae1a88382edabdede10a2e4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 22:13:15 +0100 Subject: [PATCH 5/7] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 383717c..b3f5c1b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ then get_architecture # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + ynh_setup_source --dest_dir="$final_path" --source_id="architecture" fi mkdir -p "$final_path/.data/logs" From 0642829f231adfe0dd968358f29246139b9407a0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 22:14:13 +0100 Subject: [PATCH 6/7] Fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 6909f82..dfdfd17 100755 --- a/scripts/install +++ b/scripts/install @@ -86,7 +86,7 @@ get_architecture 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" --source_id="architecture" +ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" mkdir -p "$final_path/.data/logs" diff --git a/scripts/upgrade b/scripts/upgrade index b3f5c1b..383717c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ then get_architecture # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id="architecture" + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" fi mkdir -p "$final_path/.data/logs" From 9a121ba56cf34f047459c434e293a224efc007ab Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Nov 2021 22:14:46 +0100 Subject: [PATCH 7/7] Remove arch helper --- scripts/install | 2 -- scripts/upgrade | 2 -- 2 files changed, 4 deletions(-) diff --git a/scripts/install b/scripts/install index dfdfd17..3bf2939 100755 --- a/scripts/install +++ b/scripts/install @@ -82,8 +82,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -get_architecture - 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" --source_id="$architecture" diff --git a/scripts/upgrade b/scripts/upgrade index 383717c..e80186c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,8 +78,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=3 - get_architecture - # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" fi