From b0501eade9ec75c71597d21e29a727e5e4669a97 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 2 Aug 2020 15:41:28 +0200 Subject: [PATCH 1/4] Typos --- README.md | 3 +-- README_fr.md | 3 +-- scripts/change_url | 16 ++++++++-------- scripts/install | 14 +++++++------- scripts/remove | 10 +++++----- scripts/restore | 4 ++-- 6 files changed, 24 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 52d619b..3af82e0 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,7 @@ https://yunohost.org/packaging_apps --- -Developer info ----------------- +## Developer info **Only if you want to use a testing branch for coding, instead of merging directly into master.** Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). diff --git a/README_fr.md b/README_fr.md index 596e9cc..20b47cb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -62,8 +62,7 @@ https://yunohost.org/packaging_apps --- -Informations pour les développeurs ----------------- +## Informations pour les développeurs **Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). diff --git a/scripts/change_url b/scripts/change_url index 3f21bc8..489a674 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -37,7 +37,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)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -79,23 +79,23 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= # 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..." --time --weight=1 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 + # 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 @@ -123,7 +123,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index d70aa7d..2e4028f 100755 --- a/scripts/install +++ b/scripts/install @@ -148,11 +148,11 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --time --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1 ### `ynh_add_nginx_config` will use the file conf/nginx.conf -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -166,7 +166,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 +ynh_script_progression --message="Configuring PHP-FPM..." --time --weight=1 ### `ynh_add_fpm_config` is used to set up a PHP config. ### You can remove it if your app doesn't use PHP. @@ -179,7 +179,7 @@ ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 ### With the reload at the end of the script. ### - And the section "PHP-FPM CONFIGURATION" in the upgrade script -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config #================================================= @@ -339,9 +339,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Configuring fail2ban..." --time --weight=1 +ynh_script_progression --message="Configuring Fail2ban..." --time --weight=1 -# Create a dedicated fail2ban config +# Create a dedicated Fail2ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" #================================================= @@ -359,7 +359,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index ff9228f..64af672 100755 --- a/scripts/remove +++ b/scripts/remove @@ -70,15 +70,15 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --time --weight=1 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Removing PHP-FPM configuration..." --time --weight=1 # Remove the dedicated php-fpm config ynh_remove_fpm_config @@ -104,9 +104,9 @@ fi #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing fail2ban configuration..." --time --weight=1 +ynh_script_progression --message="Removing Fail2ban configuration..." --time --weight=1 -# Remove the dedicated fail2ban config +# Remove the dedicated Fail2ban config ynh_remove_fail2ban_config #================================================= diff --git a/scripts/restore b/scripts/restore index 931f72b..3cbe1a4 100755 --- a/scripts/restore +++ b/scripts/restore @@ -84,7 +84,7 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the fail2ban configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the Fail2ban configuration..." --time --weight=1 ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" @@ -150,7 +150,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --time --weight=1 ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload From 644d29331acfd513f692d381837a8d1f7614dd6b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 2 Aug 2020 16:00:17 +0200 Subject: [PATCH 2/4] Typos --- scripts/backup | 4 ++-- scripts/change_url | 2 +- scripts/install | 21 ++++++++++----------- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 20 ++++++++++---------- 6 files changed, 25 insertions(+), 26 deletions(-) diff --git a/scripts/backup b/scripts/backup index 3e9328e..6ea8892 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -95,7 +95,7 @@ ynh_backup --src_path="/etc/$app/" #================================================= ynh_print_info --message="Backing up the MySQL database..." -### (However, things like mysql dumps *do* take some time to run, though the +### (However, things like MySQL dumps *do* take some time to run, though the ### copy of the generated dump to the archive still happens later) ynh_mysql_dump_db --database="$db_name" > db.sql diff --git a/scripts/change_url b/scripts/change_url index 489a674..126010e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -45,7 +45,7 @@ ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script diff --git a/scripts/install b/scripts/install index 2e4028f..95e68a3 100755 --- a/scripts/install +++ b/scripts/install @@ -33,14 +33,14 @@ password=$YNH_APP_ARG_PASSWORD ### If it's a multi-instance app, meaning it can be installed several times independently ### The id of the app as stated in the manifest is available as $YNH_APP_ID -### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...) +### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2"...) ### The app instance name is available as $YNH_APP_INSTANCE_NAME ### - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample ### - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 -### - ynhexample__{N} for the subsequent installations, with N=3,4, ... +### - ynhexample__{N} for the subsequent installations, with N=3,4... ### The app instance name is probably what interests you most, since this is ### guaranteed to be unique. This is a good unique identifier to define installation path, -### db names, ... +### db names... app=$YNH_APP_INSTANCE_NAME #================================================= @@ -56,8 +56,8 @@ app=$YNH_APP_INSTANCE_NAME ### The execution time is given for the duration since the previous call. So the weight should be applied to this previous call. ynh_script_progression --message="Validating installation parameters..." --time --weight=1 -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" +### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". +### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -92,7 +92,7 @@ port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port # Optional: Expose this port publicly -# (N.B. : you only need to do this if the app actually needs to expose the port publicly. +# (N.B.: you only need to do this if the app actually needs to expose the port publicly. # If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) # Open the port @@ -176,7 +176,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --time --weight=1 ### - Remove the section "BACKUP THE PHP-FPM CONFIGURATION" in the backup script ### - Remove also the section "REMOVE PHP-FPM CONFIGURATION" in the remove script ### - As well as the section "RESTORE THE PHP-FPM CONFIGURATION" in the restore script -### With the reload at the end of the script. +### with the reload at the end of the script. ### - And the section "PHP-FPM CONFIGURATION" in the upgrade script # Create a dedicated PHP-FPM config @@ -225,7 +225,7 @@ ynh_app_setting_set --app=$app --key=skipped_uris --value="/" # Reload SSOwat config yunohost app ssowatconf -# Reload Nginx +# Reload NGINX ynh_systemd_action --service_name=nginx --action=reload # Installation with curl @@ -294,7 +294,7 @@ ynh_script_progression --message="Integrating service in YunoHost..." --time --w ### `yunohost service add` integrates a service in YunoHost. It then gets ### displayed in the admin interface and through the others `yunohost service` commands. -### (N.B. : this line only makes sense if the app adds a service to the system!) +### (N.B.: this line only makes sense if the app adds a service to the system!) ### If you're not using these lines: ### - You can remove these files in conf/. ### - Remove the section "REMOVE SERVICE INTEGRATION IN YUNOHOST" in the remove script @@ -307,7 +307,7 @@ yunohost service add $app --description "A short description of the app" --log " ### ### --needs_exposed_ports "$port" a list of ports that needs to be publicly exposed ### which will then be checked by YunoHost's diagnosis system -### (N.B. DO NOT USE THIS is the port is only internal !!!) +### (N.B. DO NOT USE THIS is the port is only internal!!!) ### ### --test_status "some command" a custom command to check the status of the service ### (only relevant if 'systemctl status' doesn't do a good job) @@ -318,7 +318,6 @@ yunohost service add $app --description "A short description of the app" --log " ### to proceed if you later realize that you need to enable some flags that ### weren't enabled on old installs (be careful it'll override the existing ### service though so you should re-provide all relevant flags when doing so) -### #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index 64af672..f77545a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -80,7 +80,7 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removing PHP-FPM configuration..." --time --weight=1 -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= diff --git a/scripts/restore b/scripts/restore index 3cbe1a4..a06bd42 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index 2076e33..b460196 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,7 +70,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -81,9 +81,9 @@ ynh_abort_if_errors #================================================= # Normalize the URL path syntax -# N.B. : this is for app installations before YunoHost 2.7 +# N.B.: this is for app installations before YunoHost 2.7 # where this value might be something like /foo/ or foo/ -# instead of /foo .... +# instead of /foo # If nobody installed your app before 2.7, then you may # safely remove this line path_url=$(ynh_normalize_url_path --path_url=$path_url) @@ -112,9 +112,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -135,9 +135,9 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --time --weight=1 -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config #================================================= @@ -201,9 +201,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # UPGRADE FAIL2BAN #================================================= -ynh_script_progression --message="Reconfiguring fail2ban..." --time --weight=1 +ynh_script_progression --message="Reconfiguring Fail2ban..." --time --weight=1 -# Create a dedicated fail2ban config +# Create a dedicated Fail2ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" #================================================= @@ -221,7 +221,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_systemd_action --service_name=nginx --action=reload From 681dd011714070049c441f3c268167f8745e1243 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 2 Sep 2020 15:48:30 +0200 Subject: [PATCH 3/4] Update issue_template.md --- issue_template.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/issue_template.md b/issue_template.md index 87b88d4..4a290c4 100644 --- a/issue_template.md +++ b/issue_template.md @@ -6,11 +6,11 @@ about: When creating a bug report, please use the following template to provide **How to post a meaningful bug report** 1. *Read this whole template first.* -2. *Make sure 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 the app itself. Refer to its documentation or repository for help.* - - *In doubt, ask here and we will figure it out together.* -3. *Delete these italic comments as you write over them below, and remove this guide.* +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 REPLACEBYYOURAPP itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* --- ### Describe the bug @@ -22,7 +22,7 @@ about: When creating a bug report, please use the following template to provide - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* - YunoHost version: x.x.x - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* -- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* - If yes, please explain: - Using, or trying to install package version/branch: - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* @@ -36,8 +36,8 @@ about: When creating a bug report, please use the following template to provide - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* 1. *Go to '...'* - 2. *Click on '....'* - 3. *Scroll down to '....'* + 2. *Click on '...'* + 3. *Scroll down to '...'* 4. *See error* ### Expected behavior From d7f1d45dda58a53f0c8ab20345e6edbf68cdf94c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 19 Sep 2020 16:26:41 +0200 Subject: [PATCH 4/4] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- scripts/install | 4 ++-- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 95e68a3..6a82d9f 100755 --- a/scripts/install +++ b/scripts/install @@ -338,9 +338,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Configuring Fail2ban..." --time --weight=1 +ynh_script_progression --message="Configuring Fail2Ban..." --time --weight=1 -# Create a dedicated Fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" #================================================= diff --git a/scripts/remove b/scripts/remove index f77545a..0bb92f5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -106,7 +106,7 @@ fi #================================================= ynh_script_progression --message="Removing Fail2ban configuration..." --time --weight=1 -# Remove the dedicated Fail2ban config +# Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config #================================================= diff --git a/scripts/restore b/scripts/restore index a06bd42..1938dfe 100755 --- a/scripts/restore +++ b/scripts/restore @@ -84,7 +84,7 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the Fail2ban configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the Fail2Ban configuration..." --time --weight=1 ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index b460196..23f2e0e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -201,9 +201,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # UPGRADE FAIL2BAN #================================================= -ynh_script_progression --message="Reconfiguring Fail2ban..." --time --weight=1 +ynh_script_progression --message="Reconfiguring Fail2Ban..." --time --weight=1 -# Create a dedicated Fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" #=================================================