From af6fcd925b655333587f3b6662ba60dacb4b0d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 19 Nov 2020 16:56:14 +0100 Subject: [PATCH 1/2] Testing (#14) * Fix check_process warnings --- README.md | 2 +- README_fr.md | 2 +- check_process | 14 ++------------ manifest.json | 20 ++++++++++---------- pull_request_template.md | 2 +- scripts/backup | 6 +++++- scripts/change_url | 14 +++++++------- scripts/install | 6 +++--- scripts/remove | 6 +++--- scripts/restore | 5 ++--- scripts/upgrade | 16 ++++------------ 11 files changed, 39 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index bcf893e..3404f3f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cubiks-2048 for YunoHost +# Cubiks 2048 for YunoHost [![Integration level](https://dash.yunohost.org/integration/cubiks-2048.svg)](https://dash.yunohost.org/appci/app/cubiks-2048) ![](https://ci-apps.yunohost.org/ci/badges/cubiks-2048.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/cubiks-2048.maintain.svg) [![Install Cubiks-2048 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=cubiks-2048) diff --git a/README_fr.md b/README_fr.md index 06925dd..e3d45a7 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,4 +1,4 @@ -# Cubiks-2048 pour YunoHost +# Cubiks 2048 pour YunoHost [![Integration level](https://dash.yunohost.org/integration/cubiks-2048.svg)](https://dash.yunohost.org/appci/app/cubiks-2048) ![](https://ci-apps.yunohost.org/ci/badges/cubiks-2048.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/cubiks-2048.maintain.svg) [![Installer Cubiks-2048 avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=cubiks-2048) diff --git a/check_process b/check_process index 963a84a..1e8a280 100644 --- a/check_process +++ b/check_process @@ -2,8 +2,8 @@ auto_remove=1 ; Manifest domain="domain.tld" (DOMAIN) - path="/path" (PATH) - is_public="Yes" (PUBLIC|public=Yes|private=No) + path="/path" (PATH) + is_public="Yes" (PUBLIC|public=Yes|private=No) ; Checks pkg_linter=1 setup_sub_dir=1 @@ -14,18 +14,8 @@ upgrade=1 backup_restore=1 multi_instance=1 - incorrect_path=1 port_already_use=0 change_url=1 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto - Level 4=0 Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 \ No newline at end of file diff --git a/manifest.json b/manifest.json index 1b64462..3c7a127 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "2048 game clone in 3D", "fr": "Clone du jeu 2048 en 3D" }, - "version": "1.0~ynh2", + "version": "1.0~ynh3", "url": "https://github.com/Kshitij-Banerjee/Cubiks-2048/", "license": "MIT", "maintainer": { @@ -14,7 +14,7 @@ "email": "ericgaspar@free.fr" }, "requirements": { - "yunohost": ">= 3.7.0" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ @@ -26,8 +26,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain for Cubiks-2048", - "fr": "Choisissez un nom de domaine pour Cubiks-2048" + "en": "Choose a domain for Cubiks 2048", + "fr": "Choisissez un nom de domaine pour Cubiks 2048" }, "example": "domain.org" }, @@ -35,11 +35,11 @@ "name": "path", "type": "path", "ask": { - "en": "Choose a path for Cubiks-2048", - "fr": "Choisissez un chemin pour Cubiks-2048" + "en": "Choose a path for Cubiks 2048", + "fr": "Choisissez un chemin pour Cubiks 2048" }, - "example": "/cubiks2048", - "default": "/cubiks2048" + "example": "/cubiks-2048", + "default": "/cubiks-2048" }, { "name": "is_public", @@ -49,8 +49,8 @@ "fr": "Est-ce un jeu public ?" }, "help": { - "en": "If enabled, Cubiks-2048 will be accessible by people who doesn’t have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, Cubiks-2048 sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + "en": "If enabled, Cubiks 2048 will be accessible by people who doesn’t have an account. This can be changed later via the webadmin.", + "fr": "Si cette case est cochée, Cubiks 2048 sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." }, "default": true } diff --git a/pull_request_template.md b/pull_request_template.md index 40345ea..c8f7bc8 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -15,4 +15,4 @@ --- *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/cubiks2048_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/cubiks2048_ynh%20PR-NUM-%20(USERNAME)/) +[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/cubiks-2048_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/cubiks-2048_ynh%20PR-NUM-%20(USERNAME)/) diff --git a/scripts/backup b/scripts/backup index 19505c8..3b1eda7 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source /usr/share/yunohost/helpers #================================================= @@ -26,6 +25,11 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= diff --git a/scripts/change_url b/scripts/change_url index 7fcf700..5ce6932 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,7 +34,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=2 +ynh_script_progression --message="Backing up $app before changing its url (may take a while)..." --weight=2 # Backup the current version of the app ynh_backup_before_upgrade @@ -67,23 +67,23 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating Nginx web server configuration..." --weight=3 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# Change the path in the NGINX config file if [ $change_path -eq 1 ] then - # Make a backup of the original nginx config file if modified + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for nginx helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -96,7 +96,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading Nginx web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index c560a3e..a5d8867 100755 --- a/scripts/install +++ b/scripts/install @@ -62,9 +62,9 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring Nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -87,7 +87,7 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading Nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 2c06727..2123569 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,7 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=3 +ynh_script_progression --message="Removing $app main directory..." --weight=3 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -31,9 +31,9 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing Nginx web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= diff --git a/scripts/restore b/scripts/restore index 61703fb..7680bdd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -47,7 +46,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=2 +ynh_script_progression --message="Restoring $app main directory..." --weight=2 ynh_restore_file --origin_path="$final_path" @@ -71,7 +70,7 @@ chown -R root: $final_path #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=3 +ynh_script_progression --message="Reloading NGINX web server..." --weight=3 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index a252a5a..10a7628 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3 +ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=3 # Backup the current version of the app ynh_backup_before_upgrade @@ -81,9 +81,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -93,18 +93,10 @@ ynh_add_nginx_config # Set permissions on app files chown -R root: $final_path -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1 - -# Make app public if necessary or protect it -[ $is_public -eq 0 ] || ynh_permission_update --permission "main" --add "visitors" - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload From 1509b9ebf62725ee4610581116ef532f3ea9c31d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 14 Dec 2020 10:25:53 +0100 Subject: [PATCH 2/2] Fix linter warnings --- check_process | 2 -- manifest.json | 2 +- scripts/backup | 4 ++-- scripts/change_url | 4 ++-- scripts/install | 2 +- scripts/remove | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 10 ++-------- 8 files changed, 12 insertions(+), 20 deletions(-) diff --git a/check_process b/check_process index 1e8a280..176d5a5 100644 --- a/check_process +++ b/check_process @@ -16,6 +16,4 @@ multi_instance=1 port_already_use=0 change_url=1 -;;; Levels - Level 5=auto \ No newline at end of file diff --git a/manifest.json b/manifest.json index 3c7a127..c0d5574 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name": "Cubiks-2048", + "name": "Cubiks 2048", "id": "cubiks-2048", "packaging_format": 1, "description": { diff --git a/scripts/backup b/scripts/backup index 3b1eda7..cdfe3bf 100644 --- a/scripts/backup +++ b/scripts/backup @@ -18,7 +18,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Backing up Cubiks-2048..." +ynh_print_info --message="Backing up Cubiks 2048..." app=$YNH_APP_INSTANCE_NAME @@ -46,4 +46,4 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for Cubiks 2048. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 5ce6932..424dd66 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,7 +34,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up $app before changing its url (may take a while)..." --weight=2 +ynh_script_progression --message="Backing up Cubiks 2048 before changing its URL (may take a while)..." --weight=2 # Backup the current version of the app ynh_backup_before_upgrade @@ -104,4 +104,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression --message="Change of URL completed for Cubiks 2048" --last diff --git a/scripts/install b/scripts/install index a5d8867..fdf4e48 100755 --- a/scripts/install +++ b/scripts/install @@ -95,4 +95,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of Cubiks 2048 completed" --last diff --git a/scripts/remove b/scripts/remove index 2123569..7abebbf 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,7 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing $app main directory..." --weight=3 +ynh_script_progression --message="Removing Cubiks 2048 main directory..." --weight=3 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -40,4 +40,4 @@ ynh_remove_nginx_config # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of Cubiks 2048 completed" --last diff --git a/scripts/restore b/scripts/restore index 7680bdd..26a7378 100644 --- a/scripts/restore +++ b/scripts/restore @@ -46,7 +46,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring $app main directory..." --weight=2 +ynh_script_progression --message="Restoring Cubiks 2048 main directory..." --weight=2 ynh_restore_file --origin_path="$final_path" @@ -78,4 +78,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression --message="Restoration completed for Cubiks 2048" --last diff --git a/scripts/upgrade b/scripts/upgrade index 10a7628..8dbc35e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=3 +ynh_script_progression --message="Backing up Cubiks 2048 before upgrading (may take a while)..." --weight=3 # Backup the current version of the app ynh_backup_before_upgrade @@ -60,12 +60,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -104,4 +98,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of Cubiks 2048 completed" --last