From ad1b8ccb446742350298ca97fe782704f1a496d8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Feb 2021 12:22:34 +0100 Subject: [PATCH] Fix linter warnings --- check_process | 4 ---- issue_template.md | 2 +- manifest.json | 2 +- pull_request_template.md | 4 +--- scripts/change_url | 1 - scripts/install | 6 +++--- scripts/remove | 1 - scripts/upgrade | 27 ++++++++++++++++++--------- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/check_process b/check_process index c349aa8..e7b5faa 100644 --- a/check_process +++ b/check_process @@ -17,12 +17,8 @@ upgrade=1 backup_restore=1 multi_instance=0 - incorrect_path=0 port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email= Notification=none diff --git a/issue_template.md b/issue_template.md index 44a3665..3faa145 100644 --- a/issue_template.md +++ b/issue_template.md @@ -8,7 +8,7 @@ about: Create a report to help us debug, it would be nice to fill the template a 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - - *Otherwise, the issue may be due to WebMin itself. Refer to its documentation or repository for help.* + - *Otherwise, the issue may be due to Webmin itself. Refer to its documentation or repository for help.* - *If you have a doubt, post here, we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- diff --git a/manifest.json b/manifest.json index 3a22650..20f9363 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web-based interface for system administration for Unix.", "fr": "Interface Web d'administration système pour Unix." }, - "version": "1.941~ynh2", + "version": "1.970~ynh1", "url": "http://www.webmin.com", "license": "BSD-3-Clause", "maintainer": { diff --git a/pull_request_template.md b/pull_request_template.md index f5a0ec9..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/webmin_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/webmin_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/change_url b/scripts/change_url index 99b410c..a86e34f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -21,7 +21,6 @@ new_path="/" app=$YNH_APP_INSTANCE_NAME - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= diff --git a/scripts/install b/scripts/install index 00be454..670807b 100644 --- a/scripts/install +++ b/scripts/install @@ -85,8 +85,8 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Modifying a config file..." --weight=1 -ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" -ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" +ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" +ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -122,7 +122,7 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 # yunohost app addaccess --users=$admin $app if ! ynh_permission_exists --permission "admin"; then - ynh_permission_create --permission "admin" --url "/admin" --allowed $admin + ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin fi #================================================= diff --git a/scripts/remove b/scripts/remove index ba9427b..ad86d3f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -45,7 +45,6 @@ ynh_remove_systemd_config #================================================= ynh_script_progression --message="Removing dependencies..." - # Remove metapackage and its dependencies ynh_remove_app_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index bc8bb46..e329146 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,22 @@ 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) +#================================================= +# CHECK VERSION +#================================================= + +upgrade_type=$(ynh_check_app_version_changed) + +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +if ! ynh_permission_exists --permission="admin"; then + # Create the required permissions + ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -35,13 +51,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -77,8 +86,8 @@ ynh_install_extra_app_dependencies --repo="deb https://download.webmin.com/downl #================================================= ynh_script_progression --message="Modifying a config file..." -ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" -ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" +ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" +ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="/etc/webmin/miniserv.conf"