From e1387832c7d9c1c603c8a27ab69eeb4cb44791ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Jun 2022 21:38:15 +0200 Subject: [PATCH 1/3] Testing (#22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove is_public * Update check_process * Add templates * fix rights * [autopatch] Update issue and PR templates (#19) Co-authored-by: Yunohost-Bot <> * Update install * cleaning up * Apply last example_ynh (#21) * Testing (#18) * Update install * Apply last example_ynh Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: YunoHost Bot Co-authored-by: yalh76 --- .gitattributes | 17 --------- .gitignore | 43 --------------------- check_process | 9 +---- conf/nginx.conf | 5 --- doc/.gitkeep | 0 doc/DESCRIPTION.md | 9 +++++ doc/DESCRIPTION_fr.md | 9 +++++ doc/DISCLAIMER.md | 0 doc/DISCLAIMER_fr.md | 0 doc/screenshots/.gitkeep | 0 doc/screenshots/chtickynotes.gif | Bin 0 -> 17499 bytes manifest.json | 24 +++++++----- scripts/_common.sh | 2 +- scripts/backup | 7 +++- scripts/change_url | 17 +++++---- scripts/install | 45 +++++++++++----------- scripts/remove | 30 ++++++++------- scripts/restore | 38 +++++++++---------- scripts/upgrade | 62 ++++++++++++++++--------------- 19 files changed, 140 insertions(+), 177 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore create mode 100644 doc/.gitkeep create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md create mode 100644 doc/DISCLAIMER.md create mode 100644 doc/DISCLAIMER_fr.md create mode 100644 doc/screenshots/.gitkeep create mode 100644 doc/screenshots/chtickynotes.gif diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index bdb0cab..0000000 --- a/.gitattributes +++ /dev/null @@ -1,17 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 96374c4..0000000 --- a/.gitignore +++ /dev/null @@ -1,43 +0,0 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk diff --git a/check_process b/check_process index 1d7ff79..8c9a6b0 100644 --- a/check_process +++ b/check_process @@ -1,6 +1,3 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - ;; Test complet ; Manifest domain="domain.tld" @@ -14,13 +11,11 @@ setup_private=1 setup_public=1 upgrade=1 + # 1.0~ynh3 + upgrade=1 from_commit=5ea5611d28a8330a7d9127371d60f28083b0a0fb backup_restore=1 multi_instance=0 change_url=1 ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1& diff --git a/conf/nginx.conf b/conf/nginx.conf index 99cf262..c64c145 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.html index.php; try_files $uri $uri/ index.php; diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..fde6344 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,9 @@ +## Overview +ChtickyNotes core is based on [Post It All!](https://github.com/txusko/PostItAll). +ChtickyNotes is a "simple post-it" application. Its main features are: +- notes movable and resizable +- edit note by just typing on it (or CTRL-V to paste chunks of HTML) +- menu on each note to change its color, and so on +- global menu to change board, and so on +- autosave every 10 seconds +- storage on the server (not on the browser local storage) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..928dd0d --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,9 @@ +## Overview +Le noyau de ChtickyNotes est basé sur [Post It All!](Https://github.com/txusko/PostItAll). +ChtickyNotes est une application "post-it". Ses principales caractéristiques sont : +- notes mobiles et redimensionnables +- éditer la note en tapant simplement dessus (ou CTRL-V pour coller du code HTML) +- menu sur chaque note pour changer sa couleur... +- menu global pour changer de tableau... +- sauvegarde automatique toutes les 10 secondes +- stockage sur le serveur (pas de stockage local dans le navigateur) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/chtickynotes.gif b/doc/screenshots/chtickynotes.gif new file mode 100644 index 0000000000000000000000000000000000000000..083dc686456828363e48feb2c3efa8fdb8a852ea GIT binary patch literal 17499 zcmbrE)ms#f)5RASb`e-aL`o2l4grx8X(>VJmhSHEZUK>Qq#LQF8y4way1ONp*xmR0 z`y1Z5I&&`PnTwgvb7a0q3w$(6z+lI41ORC7v2XwYG=LrOU;WRE0D&Qx01^Nx)k^?? zf)v2{8jFXANBF}B0#?07Wl=qBlU%7og}*Drd!~s===A#G~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zg1V8G!6Z=XmF&7v`P?W2=hano)4Xd`9^uuCxzV?|)<3?{!)sJtzLBzN9CKY5IpT^q^0`1Fu0#k_AjBYu`z2xlyT@Nt9DfuM72)~vx;yTJ zKrGrLfx0=C=}#O`fV2=HSJfOiQ5N%|`By3;=irVmQjF%QIr2^*h0QYw?UDMj1xM8D z7u&~Ypk~AFJcl%fO_&x}<9=5b$@N6UL~Q#jeu1n4dXg=y?98N7|{w zxd>~st^0S9lesrB`F>l01qcGvez|^MLA8Cr4OoH8ZBPzayNx@!woALr>Nm7Y`=(es z5NuEn6nTT(?IaX|4fwYc+`7UPxeQc-BTRrGg!{*$yCb+eywiFQWC@_xG|hyCYHp&B2VH#+eEy512!haaJKyVI|om_=?lH#XMN_M zzR*v?3Iu`_0Kw&dV*L7k?9+V^*!_mMeUFcG&;-KZzdhm4J?0mG+DE_L?|t7>!r$+G z^9TL$Qv%jEz5{oE@;mVMC%x;(zU9OH>o@-I=Y8uNxgd}~()YaRGgRqQf)yk{5avMY zCw&$RAwXDx0O%2i99I|!qQqr_peHmIUg$xIqLljN~B*r6)Eh zrc7yNhYCWJ5DKyqp`l5LTqMRES@I+o1%Vt%d`QSqhCnH=v>?=BqCkQMb&@n`BPvfD zP7CI!B0*5l9#{<`RmybXPp>g;5;f`*s8AYek5;^xaihYA5qmIHC>Ntfy+}n$JqdPW z$dE&e##PA$L}SN~AxD-xnQ~>zmoaC)Tt{W+Nm2?3s6pt_1qP3dB1Nzvz}wHEN24u$ znso&yC@H=cO$e<=kb$kDR!lL{hlwx~md5R<_U)=uCpj4a0Y;BU9R>)= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ "nginx" ], "arguments": { - "install" : [ { + "install": [ + { "name": "domain", - "type": "domain", - "example": "domain.org" - },{ + "type": "domain" + }, + { "name": "path", "type": "path", "example": "/chtickynotes", "default": "/chtickynotes" }, - { + { "name": "is_public", "type": "boolean", "default": true diff --git a/scripts/_common.sh b/scripts/_common.sh index 30b0afa..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,7 +3,7 @@ #================================================= # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 2533458..9b12047 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +# 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 @@ -13,6 +14,10 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} +# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -53,4 +58,4 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for ChtickyNotes. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 353e485..03f6a72 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -6,11 +6,9 @@ # IMPORT GENERIC HELPERS #================================================= +source _common.sh source /usr/share/yunohost/helpers -# Stop script if errors -ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS #================================================= @@ -26,23 +24,24 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up ChtickyNotes before changing its URL (may take a while)..." --weight=2 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # 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 @@ -64,6 +63,8 @@ then change_path=1 fi +#================================================= +# STANDARD MODIFICATIONS #================================================= # MODIFY URL IN NGINX CONF #================================================= @@ -104,4 +105,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for ChtickyNotes" --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index cd008f7..d6fedca 100644 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script @@ -33,7 +32,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +ynh_script_progression --message="Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -44,11 +43,19 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -59,6 +66,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path mkdir -p $final_path cp -a ../sources/* $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -67,45 +78,31 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." +ynh_script_progression --message="Configuring PHP-FPM..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +ynh_script_progression --message="Configuring permissions..." # Make app public if necessary if [ $is_public -eq 1 ] then + # Everyone can access the app. + # The "main" permission is automatically created before the install script. ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -113,4 +110,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of ChtickyNotes completed" --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 424d97f..2e53c5c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,44 +12,46 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#================================================= +# STANDARD REMOVE #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing ChtickyNotes main directory..." --weight=2 +ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 - -# Remove the dedicated php-fpm config -ynh_remove_fpm_config - - #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config +#================================================= +# REMOVE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Removing PHP-FPM configuration..." + +# Remove the dedicated PHP-FPM config +ynh_remove_fpm_config + + #================================================= # GENERIC FINALIZATION #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user ynh_system_user_delete --username=$app @@ -58,4 +60,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of ChtickyNotes completed" --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index e511c60..cf9919e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +# 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 @@ -13,12 +14,16 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} +# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -32,8 +37,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -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 " @@ -42,29 +45,25 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring ChtickyNotes main directory..." --weight=2 +ynh_script_progression --message="Restoring the app main directory..." --weight=2 ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -72,6 +71,7 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -80,7 +80,7 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload @@ -89,4 +89,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for ChtickyNotes" --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 9d067c9..3704dd8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -26,6 +26,23 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + ynh_clean_check_starting + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -44,39 +61,18 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up ChtickyNotes before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring PHP-FPM..." - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low - -#================================================= -# SECURE FILES AND DIRECTORIES +# DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." cp -a ../sources/* $final_path @@ -89,13 +85,21 @@ chown -R $app:www-data "$final_path" #================================================= 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 +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading PHP-FPM configuration..." + +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --usage=low --footprint=low + #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -103,4 +107,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of ChtickyNotes completed" --last +ynh_script_progression --message="Upgrade of $app completed" --last From b9ee5d285f70b81873b17d354b424a264147a465 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 3 Dec 2022 19:50:59 +0100 Subject: [PATCH 3/3] Remove dummy website --- manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.json b/manifest.json index a56f006..6b24790 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,6 @@ "url": "https://github.com/YunoHost-Apps/chtickynotes_ynh/", "upstream": { "license": "MIT", - "website": "https://example.com", "code": "https://github.com/YunoHost-Apps/chtickynotes_ynh/" }, "developer": {