From 94a1d5ee93bdcfad620e3756faaabd7af696b57a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Nov 2021 23:49:33 +0100 Subject: [PATCH] 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"