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 1/4] 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 2/4] 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 3/4] 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 4/4] 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