From e1f39a0f46945cf39e0d4a7fd7c5756c65e77750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:46:39 +0100 Subject: [PATCH 1/3] cleaning --- manifest.toml | 3 +++ scripts/install | 4 ++-- scripts/remove | 2 -- scripts/upgrade | 12 ++++++------ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/manifest.toml b/manifest.toml index 57282bb..4df9e29 100644 --- a/manifest.toml +++ b/manifest.toml @@ -20,8 +20,11 @@ fund = "https://liberapay.com/timokoesters/" yunohost = ">= 11.2" architectures = ["arm64", "amd64", "armhf"] multi_instance = false + ldap = "not_relevant" + sso = "not_relevant" + disk = "50M" ram.build = "50M" ram.runtime = "50M" diff --git a/scripts/install b/scripts/install index 2c1fe1c..4864857 100755 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,7 @@ ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:root "$install_dir" -chmod +x -R "$install_dir/conduit" +chmod +x "$install_dir/conduit" #================================================= # SYSTEM CONFIGURATION @@ -61,7 +61,7 @@ yunohost service add $app --description="Chat server powered by Matrix" --log="/ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/conduit.toml" --destination="$install_dir/conduit.toml" +ynh_add_config --template="conduit.toml" --destination="$install_dir/conduit.toml" chmod 400 "$install_dir/conduit.toml" chown $app:root "$install_dir/conduit.toml" diff --git a/scripts/remove b/scripts/remove index 4a52fca..ed3f8fd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,8 +16,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# This should be a symetric version of what happens in the install script - # 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 then diff --git a/scripts/upgrade b/scripts/upgrade index c70288b..02a8aab 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,11 +29,11 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source --dest_dir="$install_dir" --keep="conduit.toml" fi chown -R $app:root "$install_dir" -chmod +x -R "$install_dir/conduit" +chmod +x "$install_dir/conduit" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -57,12 +57,12 @@ yunohost service add $app --description="Chat server powered by Matrix" --log="/ #================================================= # UPDATE A CONFIG FILE #================================================= -#ynh_script_progression --message="Updating a configuration file..." --weight=1 +ynh_script_progression --message="Updating a configuration file..." --weight=1 -#ynh_add_config --template="../conf/conduit.toml" --destination="$install_dir/conduit.toml" +ynh_add_config --template="conduit.toml" --destination="$install_dir/conduit.toml" -#chmod 400 "$install_dir/conduit.toml" -#chown $app:$app "$install_dir/conduit.toml" +chmod 400 "$install_dir/conduit.toml" +chown $app:$app "$install_dir/conduit.toml" #================================================= # START SYSTEMD SERVICE From d89c3e79fe792ff131b5add6dac2684320254c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:05:54 +0100 Subject: [PATCH 2/3] cleaning --- scripts/backup | 1 - scripts/install | 4 ---- scripts/restore | 1 - scripts/upgrade | 1 - 4 files changed, 7 deletions(-) diff --git a/scripts/backup b/scripts/backup index 92bfdc5..38cbcd7 100755 --- 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 ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/install b/scripts/install index 4864857..e0b7d94 100755 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,6 @@ ynh_app_setting_set --app=$app --key=federation --value=$federation #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" @@ -40,16 +39,13 @@ chmod +x "$install_dir/conduit" #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_nginx_config -# Create .well-known redirection for access by federation if yunohost --output-as plain domain list | grep -q "^$server_name$" then ynh_add_config --template="server_name.conf" --destination="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" fi -# Create a dedicated systemd config ynh_add_systemd_config yunohost service add $app --description="Chat server powered by Matrix" --log="/var/log/$app/$app.log" diff --git a/scripts/restore b/scripts/restore index 98c7ea1..d4220e4 100755 --- a/scripts/restore +++ b/scripts/restore @@ -43,7 +43,6 @@ yunohost service add $app --description="Chat server powered by Matrix" --log="/ #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -# Typically you only have either $app or php-fpm but not both at the same time... ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 02a8aab..93a5b47 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,7 +28,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep="conduit.toml" fi From a61fc8ded9d7327339ee9abfb4efa9549c7b19d7 Mon Sep 17 00:00:00 2001 From: Thatoo Date: Thu, 14 Dec 2023 18:31:00 +0100 Subject: [PATCH 3/3] Update install - reload nginx after adding nginx conf file This way, nginx is reloaded after adding the nginx conf, not before and it would make federation working right away after install, no need for the installer to restart nginx after install. --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 2c1fe1c..dba20fb 100755 --- a/scripts/install +++ b/scripts/install @@ -40,15 +40,15 @@ chmod +x -R "$install_dir/conduit" #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated NGINX config using the conf/nginx.conf template -ynh_add_nginx_config - # Create .well-known redirection for access by federation if yunohost --output-as plain domain list | grep -q "^$server_name$" then ynh_add_config --template="server_name.conf" --destination="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" fi +# Create a dedicated NGINX config using the conf/nginx.conf template +ynh_add_nginx_config + # Create a dedicated systemd config ynh_add_systemd_config