From 6c8212745a65b79b52276f169a9340b2daeffac3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 2 Feb 2023 22:35:24 +0100 Subject: [PATCH 1/5] Update tests.toml --- tests.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests.toml b/tests.toml index bce0d4d..5dd7c1c 100644 --- a/tests.toml +++ b/tests.toml @@ -33,8 +33,7 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - # test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4" - # test_upgrade_from.00a1a6e7.args.foo = "bar" + test_upgrade_from.d8c645bb.name = "Initial commit / packaging v1" [whatever] From 800f6cbe15a1188200dc00de79a2d3bcabe4df9a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 2 Feb 2023 22:36:15 +0100 Subject: [PATCH 2/5] Create upgrade --- scripts/upgrade | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/upgrade diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..9fe6be7 --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,19 @@ +#!/bin/bash + +source /usr/share/yunohost/helpers + +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=1 + +echo "Hello world!" > $install_dir/index.html +chown -R www-data: "$install_dir" + +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring nginx web server..." --weight=1 + +# Create a dedicated nginx config +ynh_add_nginx_config From 3e55c4bc7ef5864c6e37a0192edbb4fb0a852e5f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 3 Feb 2023 03:46:32 +0100 Subject: [PATCH 3/5] Add backup and restore scripts /o\ --- scripts/backup | 32 ++++++++++++++++++++++++++++++++ scripts/restore | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 scripts/backup create mode 100644 scripts/restore diff --git a/scripts/backup b/scripts/backup new file mode 100644 index 0000000..a6b113b --- /dev/null +++ b/scripts/backup @@ -0,0 +1,32 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source /usr/share/yunohost/helpers + +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + +#================================================= +# BACKUP THE APP MAIN DIR +#================================================= + +ynh_backup --src_path="$install_dir" + +#================================================= +# BACKUP THE NGINX CONFIGURATION +#================================================= + +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)." diff --git a/scripts/restore b/scripts/restore new file mode 100644 index 0000000..a97a921 --- /dev/null +++ b/scripts/restore @@ -0,0 +1,40 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source /usr/share/yunohost/helpers + +#================================================= +# RESTORE THE APP MAIN DIR +#================================================= +ynh_script_progression --message="Restoring the app main directory..." --weight=1 + +ynh_restore_file --origin_path="$install_dir" + +# Restore permissions on app files +chown -R $app:www-data $install_dir +chmod -R o-rwx $install_dir + +#================================================= +# 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" + +#================================================= +# RELOAD NGINX AND PHP-FPM +#================================================= +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Restoration completed for $app" --last From a528903c9c7860d212c5d98044c2492483660753 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 3 Feb 2023 03:49:07 +0100 Subject: [PATCH 4/5] Add WTFPL --- LICENSE | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7e98ad6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2023 YunoHost + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. From 73d84f2ec62498b2bda8b868222c82b28bf7634f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 3 Feb 2023 03:57:42 +0100 Subject: [PATCH 5/5] There's no PHP /o\ --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index a97a921..83a0b59 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,9 +27,9 @@ ynh_script_progression --message="Restoring the NGINX configuration..." --weight ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= -# RELOAD NGINX AND PHP-FPM +# RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload