From 84a18c942b66e15be9826faf5a6075f319a8b7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 5 Mar 2023 17:11:08 +0100 Subject: [PATCH 1/5] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 19b7e6d..63c9d68 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://docs.commento.io/" code = "https://github.com/souramoo/commentoplusplus" [integration] -yunohost = ">= 11.1.12" +yunohost = ">= 11.1.13" architectures = ["amd64"] multi_instance = true ldap = false From 18d3290bb0673b6e1103e83868b57060ebd8bb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Mar 2023 20:04:25 +0100 Subject: [PATCH 2/5] src --- conf/app.src | 5 ----- manifest.toml | 9 ++++++++- scripts/install | 25 +++++++------------------ 3 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 conf/app.src diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 92c1438..0000000 --- a/conf/app.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/souramoo/commentoplusplus/releases/download/v1.8.7/release.tar.gz -SOURCE_SUM=a9925f34b3c035571b14b0d2f351129d70b9d589b9832fcb09f7f0d56d6d92a1 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false diff --git a/manifest.toml b/manifest.toml index 63c9d68..f744872 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://docs.commento.io/" code = "https://github.com/souramoo/commentoplusplus" [integration] -yunohost = ">= 11.1.13" +yunohost = ">= 11.1.15" architectures = ["amd64"] multi_instance = true ldap = false @@ -44,6 +44,13 @@ ram.runtime = "50M" type = "password" [resources] + [resources.sources] + + [resources.sources.main] + url = "https://github.com/souramoo/commentoplusplus/releases/download/v1.8.7/release.tar.gz" + sha256 = "a9925f34b3c035571b14b0d2f351129d70b9d589b9832fcb09f7f0d56d6d92a1" + in_subdir = false + [resources.ports] [resources.system_user] diff --git a/scripts/install b/scripts/install index 2207465..fc82029 100755 --- a/scripts/install +++ b/scripts/install @@ -29,18 +29,22 @@ ynh_script_progression --message="Setting up source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Privacy-focused commenting platform" --log="/var/log/$app/$app.log" + #================================================= # ADD A CONFIGURATION #================================================= @@ -51,21 +55,6 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/commento.en chmod 400 "$install_dir/commento.env" chown $app:$app "$install_dir/commento.env" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Privacy-focused commenting platform" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= From 88e4be0c883d4e325b51cb1b644aef18bcd53d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Mar 2023 20:06:00 +0100 Subject: [PATCH 3/5] cleaning --- scripts/remove | 15 +++------------ scripts/restore | 35 ++++++++++------------------------- 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/scripts/remove b/scripts/remove index 06fb827..4c29204 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null @@ -22,19 +23,9 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index ead1d23..178f67c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,15 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -36,33 +27,27 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." --weight ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Privacy-focused commenting platform" --log="/var/log/$app/$app.log" -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" - #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND PHP-FPM +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload From 6baec6c9d71382a4a6a72e027b788629d49d08b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Mar 2023 20:07:42 +0100 Subject: [PATCH 4/5] cleaning --- doc/DESCRIPTION.md | 1 - scripts/upgrade | 24 +++++++----------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 14b8db8..02871eb 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -9,6 +9,5 @@ Commento++ allows you to foster discussion on your website – if you have a blo - Moderation tools - Sticky comments - Thread locking -- OAuth login (Google, Github, Twitter) and single sign-on - Hot-reloading of comments - Email notifications. diff --git a/scripts/upgrade b/scripts/upgrade index af55559..5cc3870 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,13 +50,18 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Privacy-focused commenting platform" --log="/var/log/$app/$app.log" + #================================================= # UPDATE A CONFIG FILE #================================================= @@ -67,21 +72,6 @@ ynh_add_config --template="../conf/.env" --destination="$install_dir/commento.en chmod 400 "$install_dir/commento.env" chown $app:$app "$install_dir/commento.env" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Privacy-focused commenting platform" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= From f396d8097dd7dbbdd144391912ac4a482bd1c278 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 16 Mar 2023 19:07:47 +0000 Subject: [PATCH 5/5] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index 27e311b..92f2d2d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,6 @@ Commento++ allows you to foster discussion on your website – if you have a blo - Moderation tools - Sticky comments - Thread locking -- OAuth login (Google, Github, Twitter) and single sign-on - Hot-reloading of comments - Email notifications. diff --git a/README_fr.md b/README_fr.md index 37e8ac9..9af738a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,6 @@ Commento++ allows you to foster discussion on your website – if you have a blo - Moderation tools - Sticky comments - Thread locking -- OAuth login (Google, Github, Twitter) and single sign-on - Hot-reloading of comments - Email notifications.