diff --git a/README.md b/README.md index c6f8230..850b40f 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ 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 +**Shipped version:** 0.8.1.2135~ynh2 diff --git a/README_fr.md b/README_fr.md index 2718e3f..93c937b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,9 +11,9 @@ 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 +**Version incluse :** 0.8.1.2135~ynh2 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..2a26d3d 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "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", + "version": "0.8.1.2135~ynh2", "url": "https://lidarr.audio", "upstream": { "license": "GPL-3.0-only", @@ -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/change_url b/scripts/change_url index c177364..01e8c06 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 @@ -88,8 +88,12 @@ then # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" + path="$new_path" # Create a dedicated NGINX config ynh_add_nginx_config +else + path_url="$old_path" + path="$old_path" fi # Change the domain for NGINX @@ -100,6 +104,7 @@ then mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" + domain="$new_domain" fi #================================================= @@ -108,7 +113,7 @@ fi # UPDATE CONFIGURATION FILE #================================================= -ynh_exec_warn_less 'ynh_add_config --template="../conf/config.xml" --destination="$final_path/.data/config.xml"' +ynh_add_config --template="../conf/config.xml" --destination="$final_path/.data/config.xml" chmod 750 "$final_path/.data/config.xml" chmod o-rwx "$final_path/.data/config.xml" @@ -119,14 +124,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 +139,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 diff --git a/scripts/install b/scripts/install index ca6202a..3bf2939 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 @@ -81,11 +82,9 @@ 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="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..e80186c 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) #================================================= @@ -83,10 +78,8 @@ 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="app.$architecture" + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" fi mkdir -p "$final_path/.data/logs"