From dd03edae6d7680aceffec2274d5bd713311ba81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douze=20B=C3=A9?= <12b@distrilab.fr> Date: Sun, 26 May 2024 15:44:16 +0200 Subject: [PATCH 01/18] feat(yunohost extension): Add a post app install hook to update app list --- conf/sync_app_importer.sh | 2 ++ scripts/install | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 conf/sync_app_importer.sh diff --git a/conf/sync_app_importer.sh b/conf/sync_app_importer.sh new file mode 100644 index 0000000..620d6d1 --- /dev/null +++ b/conf/sync_app_importer.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +sudo -u __USER__ bash -c "cd __INSTALL_DIR__ && ./yeswicli importer:sync -s yunohost-cli" diff --git a/scripts/install b/scripts/install index a697833..e5358f3 100755 --- a/scripts/install +++ b/scripts/install @@ -99,6 +99,9 @@ chmod +x $install_dir/tools/yunohost/private/scripts/*.sh # Add app user in sudoers to authorize to launch yunohost cli commands without password ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app +ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh +chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh # At last, run the YunoHost app importer ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 From d258711f4a60960057ac3fb9df0ade752b37c9d1 Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Thu, 13 Jun 2024 16:30:01 +0200 Subject: [PATCH 02/18] feat(yunohost extension): complete upgrade, backup, restore and remove scripts --- scripts/backup | 12 ++++++++++++ scripts/install | 4 +++- scripts/remove | 6 +++++- scripts/restore | 14 ++++++++++++++ scripts/upgrade | 23 +++++++++++++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index 214b288..f237759 100755 --- a/scripts/backup +++ b/scripts/backup @@ -33,6 +33,18 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# BACKUP THE IMPORTER PLUGIN SUDOERS FILE +#================================================= + +ynh_backup --src_path="/etc/sudoers.d/$app" + +#================================================= +# BACKUP THE IMPORTER PLUGIN POST APP INSTALL HOOK +#================================================= + +ynh_backup --src_path="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" + #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index e5358f3..95e2405 100755 --- a/scripts/install +++ b/scripts/install @@ -77,7 +77,7 @@ ynh_replace_string --match_string="'allow_raw_html' => false," --replace_string= #================================================= ynh_script_progression --message="Configure importer plugin" --weight=1 -# Download yeswiki plugin from yeswiki repository +# Download importer plugin from yeswiki repository mkdir -p "$install_dir/tools/importer" ynh_setup_source --dest_dir="$install_dir/tools/importer" --source_id="importerplugin" @@ -99,6 +99,8 @@ chmod +x $install_dir/tools/yunohost/private/scripts/*.sh # Add app user in sudoers to authorize to launch yunohost cli commands without password ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app + +# Add a post app install hook to sync the app importer ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh diff --git a/scripts/remove b/scripts/remove index 03fafa5..dce13b4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,7 +20,11 @@ ynh_remove_nginx_config # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -# TODO: remove /etc/sudoers/$app +# Remove sudoers file +ynh_secure_remove --file="/etc/sudoers/$app" + +# Remove post app install hook +ynh_secure_remove --file="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 2dff91d..87d2b2d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -35,6 +35,20 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RESTORE THE IMPORTER PLUGIN SUDOERS FILE +#================================================= +ynh_script_progression --message="Restoring the app importer plugin sudoers file..." + +ynh_restore_file --origin_path="/etc/sudoers.d/$app" + +#================================================= +# RESTORE THE IMPORTER PLUGIN POST APP INSTALL HOOK +#================================================= +ynh_script_progression --message="Restoring the app importer post app install hook..." + +ynh_restore_file --origin_path="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b453b76..6c1a048 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,6 +73,29 @@ ynh_secure_remove "$install_dir/tools/importer" mkdir -p "$install_dir/tools/importer" ynh_setup_source --dest_dir="$install_dir/tools/importer" --source_id="importerplugin" +# Ensure that scripts are executable +chmod +x $install_dir/tools/yunohost/private/scripts/*.sh + +# Add app user in sudoers to authorize to launch yunohost cli commands without password +ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" +chown root:root /etc/sudoers.d/$app + +# Add a post app install hook to sync the app importer +ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh +chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh + +# ToDo : Add importer config in wakka.config.php if it is not already there ? +# if [ ??? ]; then +# ynh_replace_string --match_string=");" --replace_string=" 'dataSources' => [\n'yunohost-cli' => [\n'formId' => '5', // form id used in local bazar\n'lang' > +# fi + +# At last, run the YunoHost app importer +ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 +pushd $install_dir +ynh_exec_as $app ./yeswicli importer:sync -s yunohost-cli +popd + #================================================= # SECURE FILES AND DIRECTORIES #================================================= From 7395ad46a7da5f97ab41e2057bea5093b5d419a7 Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 10:58:49 +0200 Subject: [PATCH 03/18] Add YunoHost SSO domain to YesWiki config file --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 95e2405..586583e 100755 --- a/scripts/install +++ b/scripts/install @@ -92,6 +92,8 @@ ynh_setup_source --dest_dir="$install_dir/tools/yunohost" --source_id="yunohostp # Add config at the end of wakka.config.php ynh_replace_string --match_string=");" --replace_string=" 'dataSources' => [\n'yunohost-cli' => [\n'formId' => '5', // form id used in local bazar\n'lang' => 'fr',\n'importer' => 'YunohostCLIApp', // importer class name (without Importer suffix)\n],\n],\n);" --target_file="$install_dir/wakka.config.php" +SSO_DOMAIN = $(yunohost domain main-domain | sed -e 's/.*: //') +ynh_replace_string --match_string=");" --replace_string=" 'ynhSSODomain' => ${SSO_DOMAIN},\n);" --target_file="$install_dir/wakka.config.php" # Ensure that scripts are executable chmod +x $install_dir/tools/yunohost/private/scripts/*.sh From 0ae393d7478530da206289639a30b418344d7217 Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 11:15:41 +0200 Subject: [PATCH 04/18] fix typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 586583e..3373916 100755 --- a/scripts/install +++ b/scripts/install @@ -92,7 +92,7 @@ ynh_setup_source --dest_dir="$install_dir/tools/yunohost" --source_id="yunohostp # Add config at the end of wakka.config.php ynh_replace_string --match_string=");" --replace_string=" 'dataSources' => [\n'yunohost-cli' => [\n'formId' => '5', // form id used in local bazar\n'lang' => 'fr',\n'importer' => 'YunohostCLIApp', // importer class name (without Importer suffix)\n],\n],\n);" --target_file="$install_dir/wakka.config.php" -SSO_DOMAIN = $(yunohost domain main-domain | sed -e 's/.*: //') +SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') ynh_replace_string --match_string=");" --replace_string=" 'ynhSSODomain' => ${SSO_DOMAIN},\n);" --target_file="$install_dir/wakka.config.php" # Ensure that scripts are executable From 8af61e56ee0e7e1257f45a6c4c6d88dc777df44b Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 11:31:13 +0200 Subject: [PATCH 05/18] Fix $app variable substitution --- scripts/backup | 2 +- scripts/install | 10 +++++----- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/backup b/scripts/backup index f237759..4693a0b 100755 --- a/scripts/backup +++ b/scripts/backup @@ -43,7 +43,7 @@ ynh_backup --src_path="/etc/sudoers.d/$app" # BACKUP THE IMPORTER PLUGIN POST APP INSTALL HOOK #================================================= -ynh_backup --src_path="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +ynh_backup --src_path="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/install b/scripts/install index 3373916..1645950 100755 --- a/scripts/install +++ b/scripts/install @@ -17,7 +17,7 @@ ynh_script_progression --message="Setting up source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chown -R $app:www-data $install_dir +chown -R ${app}:www-data $install_dir chmod -R u=rwX,g=rX,o-rwx $install_dir #================================================= @@ -103,9 +103,9 @@ ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app # Add a post app install hook to sync the app importer -ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" -chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh -chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh +ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" +chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh +chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh # At last, run the YunoHost app importer ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 @@ -146,7 +146,7 @@ fi # SECURE FILES AND DIRECTORIES #================================================= -chown -R $app:www-data $install_dir +chown -R ${app}:www-data $install_dir chmod -R u=rwX,g=rX,o-rwx $install_dir chmod g-rwx $install_dir/wakka.config.php diff --git a/scripts/remove b/scripts/remove index dce13b4..db4d6eb 100755 --- a/scripts/remove +++ b/scripts/remove @@ -24,7 +24,7 @@ ynh_remove_fpm_config ynh_secure_remove --file="/etc/sudoers/$app" # Remove post app install hook -ynh_secure_remove --file="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +ynh_secure_remove --file="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 87d2b2d..d50e58d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -47,7 +47,7 @@ ynh_restore_file --origin_path="/etc/sudoers.d/$app" #================================================= ynh_script_progression --message="Restoring the app importer post app install hook..." -ynh_restore_file --origin_path="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +ynh_restore_file --origin_path="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 6c1a048..1f794e5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then fi chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R ${app}:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION @@ -81,9 +81,9 @@ ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app # Add a post app install hook to sync the app importer -ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" -chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh -chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh +ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" +chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh +chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh # ToDo : Add importer config in wakka.config.php if it is not already there ? # if [ ??? ]; then @@ -100,7 +100,7 @@ popd # SECURE FILES AND DIRECTORIES #================================================= -chown -R $app:www-data $install_dir +chown -R ${app}:www-data $install_dir chmod -R u=rwX,g=rX,o-rwx $install_dir chmod g-rwx $install_dir/wakka.config.php From 6125bfcdc5e8a8671627936a4c606668197d4d3f Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 11:39:10 +0200 Subject: [PATCH 06/18] Create post_app_install hook folder if it does not exist --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 1645950..5db1b72 100755 --- a/scripts/install +++ b/scripts/install @@ -103,6 +103,7 @@ ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app # Add a post app install hook to sync the app importer +mkdir -p /etc/yunohost/hooks.d/post_app_install ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh diff --git a/scripts/upgrade b/scripts/upgrade index 1f794e5..9ff7715 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,6 +81,7 @@ ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app # Add a post app install hook to sync the app importer +mkdir -p /etc/yunohost/hooks.d/post_app_install ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh From 93dca9c3eb4b209035131b1efe7dc69d10a98407 Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 11:50:58 +0200 Subject: [PATCH 07/18] change yunohost SSO domain configuration parameter name --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 5db1b72..8525a51 100755 --- a/scripts/install +++ b/scripts/install @@ -93,7 +93,7 @@ ynh_setup_source --dest_dir="$install_dir/tools/yunohost" --source_id="yunohostp # Add config at the end of wakka.config.php ynh_replace_string --match_string=");" --replace_string=" 'dataSources' => [\n'yunohost-cli' => [\n'formId' => '5', // form id used in local bazar\n'lang' => 'fr',\n'importer' => 'YunohostCLIApp', // importer class name (without Importer suffix)\n],\n],\n);" --target_file="$install_dir/wakka.config.php" SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') -ynh_replace_string --match_string=");" --replace_string=" 'ynhSSODomain' => ${SSO_DOMAIN},\n);" --target_file="$install_dir/wakka.config.php" +ynh_replace_string --match_string=");" --replace_string=" 'yunohost_sso_domain' => ${SSO_DOMAIN},\n);" --target_file="$install_dir/wakka.config.php" # Ensure that scripts are executable chmod +x $install_dir/tools/yunohost/private/scripts/*.sh From f597cef147c53b62c1018dd626b66f85155d9b75 Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 13:00:28 +0200 Subject: [PATCH 08/18] Fix missing quotes around config param value --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 8525a51..4d93d24 100755 --- a/scripts/install +++ b/scripts/install @@ -93,7 +93,7 @@ ynh_setup_source --dest_dir="$install_dir/tools/yunohost" --source_id="yunohostp # Add config at the end of wakka.config.php ynh_replace_string --match_string=");" --replace_string=" 'dataSources' => [\n'yunohost-cli' => [\n'formId' => '5', // form id used in local bazar\n'lang' => 'fr',\n'importer' => 'YunohostCLIApp', // importer class name (without Importer suffix)\n],\n],\n);" --target_file="$install_dir/wakka.config.php" SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') -ynh_replace_string --match_string=");" --replace_string=" 'yunohost_sso_domain' => ${SSO_DOMAIN},\n);" --target_file="$install_dir/wakka.config.php" +ynh_replace_string --match_string=");" --replace_string=" 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" # Ensure that scripts are executable chmod +x $install_dir/tools/yunohost/private/scripts/*.sh From cf05091ce591bc1bab8b3ba0175fb36af3d6bebe Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 14:43:47 +0200 Subject: [PATCH 09/18] Add yunohost_sso_domain config param durign upgrade if it does not exists --- scripts/upgrade | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9ff7715..887e27e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,10 +86,13 @@ ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/ho chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh -# ToDo : Add importer config in wakka.config.php if it is not already there ? -# if [ ??? ]; then -# ynh_replace_string --match_string=");" --replace_string=" 'dataSources' => [\n'yunohost-cli' => [\n'formId' => '5', // form id used in local bazar\n'lang' > -# fi +# ToDo : Add app importer config in wakka.config.php if it is not already there ? + +if [ ${grep yunohost_sso_domain "$install_dir/wakka.config.php"} = "0" ]; then + SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') + ynh_replace_string --match_string=");" --replace_string=" 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" +fi + # At last, run the YunoHost app importer ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 From a49bd2ed42579421fe9f81ab4bd51ab075c12a13 Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 14:55:36 +0200 Subject: [PATCH 10/18] fix typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 887e27e..6bbfc60 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,7 +88,7 @@ chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh # ToDo : Add app importer config in wakka.config.php if it is not already there ? -if [ ${grep yunohost_sso_domain "$install_dir/wakka.config.php"} = "0" ]; then +if [ $(grep yunohost_sso_domain "$install_dir/wakka.config.php") = "0" ]; then SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') ynh_replace_string --match_string=");" --replace_string=" 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" fi From c454e9bcbc17f9f42dcd67e71781d6adeece0afa Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 15:09:52 +0200 Subject: [PATCH 11/18] fix test that is checking if config param exists --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6bbfc60..48fa7b3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,7 +88,7 @@ chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh # ToDo : Add app importer config in wakka.config.php if it is not already there ? -if [ $(grep yunohost_sso_domain "$install_dir/wakka.config.php") = "0" ]; then +if [ $(grep yunohost_sso_domain "$install_dir/wakka.config.php" | wc -l) = "0" ]; then SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') ynh_replace_string --match_string=");" --replace_string=" 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" fi From fc913a1429241b6938ae929343e8355954d657d1 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 14 Jun 2024 15:23:06 +0200 Subject: [PATCH 12/18] bump version + new yunohost extension --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4d98338..6ca1819 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "YesWiki" description.en = "Wiki that is quick and easy to use" description.fr = "Wiki facile et rapide à prendre en main" -version = "4.4.4~ynh6" +version = "4.4.4~ynh7" maintainers = ["Florian Schmitt", "Nils Van Zuijlen", "Plumf"] @@ -72,7 +72,7 @@ ask.fr = "Choisissez le nom de votre wiki" help.en = "If you want a name with spaces: replace them with %20 for each space." help.fr = "Si vous souhaitez un nom avec des espacements : remplacez les par %20 pour chaque espace" type = "string" -default = "MyYunoHostWiki" +default = "YesWiki" [resources] [resources.sources.main] @@ -81,8 +81,8 @@ sha256 = "0b4e97bdd01ab627a8a9cb5bf652708e34a9322509cb8fcb9db0fb12b6a3e6ef" autoupdate.strategy = "latest_github_tag" [resources.sources.yunohostplugin] -url = "https://repository.yeswiki.net/doryphore/extension-yunohost-1.0.0.zip" -sha256 = "60032781016d2bdcecce4ad5ae91e72407e64a994f63661e27a7a935ba52d50b" +url = "https://repository.yeswiki.net/doryphore/extension-yunohost-1.0.1.zip" +sha256 = "43012db78928dd59539c764029880e3f74f82972e494f7ebf1e365d5f8763c6a" [resources.sources.importerplugin] url = "https://repository.yeswiki.net/doryphore/extension-importer-1.0.1.zip" From 7d9c84a849920d43f59d66edca7ae3cf4f17d937 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 14 Jun 2024 13:23:09 +0000 Subject: [PATCH 13/18] Auto-update READMEs --- README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b9b96ed..843c7bf 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses: - Cultivate a bit of freedom... -**Shipped version:** 4.4.4~ynh6 +**Shipped version:** 4.4.4~ynh7 **Demo:** diff --git a/README_es.md b/README_es.md index 65eee5c..907a0a1 100644 --- a/README_es.md +++ b/README_es.md @@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses: - Cultivate a bit of freedom... -**Versión actual:** 4.4.4~ynh6 +**Versión actual:** 4.4.4~ynh7 **Demo:** diff --git a/README_eu.md b/README_eu.md index 1e24381..832909b 100644 --- a/README_eu.md +++ b/README_eu.md @@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses: - Cultivate a bit of freedom... -**Paketatutako bertsioa:** 4.4.4~ynh6 +**Paketatutako bertsioa:** 4.4.4~ynh7 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 97a09af..f6adf49 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,7 +26,7 @@ Néanmoins, avec un YesWiki on peut fabriquer un site internet aux usages multip - Cultiver un bout de liberté... -**Version incluse :** 4.4.4~ynh6 +**Version incluse :** 4.4.4~ynh7 **Démo :** diff --git a/README_gl.md b/README_gl.md index d305b9c..7170669 100644 --- a/README_gl.md +++ b/README_gl.md @@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses: - Cultivate a bit of freedom... -**Versión proporcionada:** 4.4.4~ynh6 +**Versión proporcionada:** 4.4.4~ynh7 **Demo:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 510a5ec..ae07f8d 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses: - Cultivate a bit of freedom... -**分发版本:** 4.4.4~ynh6 +**分发版本:** 4.4.4~ynh7 **演示:** From 50a665612fbdeb411f54b4bab10051d5d8c7a6e4 Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Sat, 15 Jun 2024 00:07:09 +0200 Subject: [PATCH 14/18] Add yunohost_sso_domain at the begining instead of the end --- scripts/upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 48fa7b3..68baab0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,13 +86,12 @@ ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/ho chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh -# ToDo : Add app importer config in wakka.config.php if it is not already there ? - if [ $(grep yunohost_sso_domain "$install_dir/wakka.config.php" | wc -l) = "0" ]; then SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') - ynh_replace_string --match_string=");" --replace_string=" 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" + ynh_replace_string --match_string="wakkaConfig = array (" --replace_string="$wakkaConfig = array (\n 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" fi +# ToDo : Add app importer config in wakka.config.php if it is not already there ? # At last, run the YunoHost app importer ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 From c24a8fb44daedaa88a4e591a6d37fef751e69dad Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Sat, 15 Jun 2024 00:12:02 +0200 Subject: [PATCH 15/18] typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 68baab0..373ab46 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,7 +88,7 @@ chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh if [ $(grep yunohost_sso_domain "$install_dir/wakka.config.php" | wc -l) = "0" ]; then SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') - ynh_replace_string --match_string="wakkaConfig = array (" --replace_string="$wakkaConfig = array (\n 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" + ynh_replace_string --match_string="wakkaConfig = array (" --replace_string="wakkaConfig = array (\n 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" fi # ToDo : Add app importer config in wakka.config.php if it is not already there ? From 420c342ede32177aab7ee496f454412e13210ebf Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Sat, 15 Jun 2024 00:16:06 +0200 Subject: [PATCH 16/18] typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 373ab46..4ef2536 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,7 +88,7 @@ chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh if [ $(grep yunohost_sso_domain "$install_dir/wakka.config.php" | wc -l) = "0" ]; then SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') - ynh_replace_string --match_string="wakkaConfig = array (" --replace_string="wakkaConfig = array (\n 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n);" --target_file="$install_dir/wakka.config.php" + ynh_replace_string --match_string="wakkaConfig = array (" --replace_string="wakkaConfig = array (\n 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n" --target_file="$install_dir/wakka.config.php" fi # ToDo : Add app importer config in wakka.config.php if it is not already there ? From fd75c105597fd8716af70c9148fbf4d9247d2c6e Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Sat, 15 Jun 2024 00:22:27 +0200 Subject: [PATCH 17/18] import apps only if data source is configured --- scripts/upgrade | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4ef2536..daf1713 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -93,11 +93,13 @@ fi # ToDo : Add app importer config in wakka.config.php if it is not already there ? -# At last, run the YunoHost app importer -ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 -pushd $install_dir -ynh_exec_as $app ./yeswicli importer:sync -s yunohost-cli -popd +# At last, run the YunoHost app importer if its data source is configured +if [ $(grep yunohost-cli "$install_dir/wakka.config.php" | wc -l) != "0" ]; then + ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 + pushd $install_dir + ynh_exec_as $app ./yeswicli importer:sync -s yunohost-cli + popd +fi #================================================= # SECURE FILES AND DIRECTORIES From 389b1d9404ac8b296ff723f4e8a1db26442d575f Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Sat, 15 Jun 2024 00:38:41 +0200 Subject: [PATCH 18/18] yolo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index daf1713..02272bd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,7 +88,7 @@ chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh if [ $(grep yunohost_sso_domain "$install_dir/wakka.config.php" | wc -l) = "0" ]; then SSO_DOMAIN=$(yunohost domain main-domain | sed -e 's/.*: //') - ynh_replace_string --match_string="wakkaConfig = array (" --replace_string="wakkaConfig = array (\n 'yunohost_sso_domain' => '${SSO_DOMAIN}',\n" --target_file="$install_dir/wakka.config.php" + ynh_replace_string --match_string="'wakka_version'" --replace_string="'yunohost_sso_domain' => '${SSO_DOMAIN}',\n 'wakka_version'" --target_file="$install_dir/wakka.config.php" fi # ToDo : Add app importer config in wakka.config.php if it is not already there ?