1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yeswiki_ynh.git synced 2024-09-03 18:05:56 +02:00

Merge pull request #96 from YunoHost-Apps/testing

bug fix
This commit is contained in:
Florian 2024-06-15 00:45:45 +02:00 committed by GitHub
commit 5af3921ee8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 84 additions and 16 deletions

View file

@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses:
- Cultivate a bit of freedom... - Cultivate a bit of freedom...
**Shipped version:** 4.4.4~ynh6 **Shipped version:** 4.4.4~ynh7
**Demo:** <https://ferme.yeswiki.net/?CreerSonWiki> **Demo:** <https://ferme.yeswiki.net/?CreerSonWiki>

View file

@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses:
- Cultivate a bit of freedom... - Cultivate a bit of freedom...
**Versión actual:** 4.4.4~ynh6 **Versión actual:** 4.4.4~ynh7
**Demo:** <https://ferme.yeswiki.net/?CreerSonWiki> **Demo:** <https://ferme.yeswiki.net/?CreerSonWiki>

View file

@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses:
- Cultivate a bit of freedom... - Cultivate a bit of freedom...
**Paketatutako bertsioa:** 4.4.4~ynh6 **Paketatutako bertsioa:** 4.4.4~ynh7
**Demoa:** <https://ferme.yeswiki.net/?CreerSonWiki> **Demoa:** <https://ferme.yeswiki.net/?CreerSonWiki>

View file

@ -26,7 +26,7 @@ Néanmoins, avec un YesWiki on peut fabriquer un site internet aux usages multip
- Cultiver un bout de liberté... - Cultiver un bout de liberté...
**Version incluse:** 4.4.4~ynh6 **Version incluse:** 4.4.4~ynh7
**Démo:** <https://ferme.yeswiki.net/?CreerSonWiki> **Démo:** <https://ferme.yeswiki.net/?CreerSonWiki>

View file

@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses:
- Cultivate a bit of freedom... - Cultivate a bit of freedom...
**Versión proporcionada:** 4.4.4~ynh6 **Versión proporcionada:** 4.4.4~ynh7
**Demo:** <https://ferme.yeswiki.net/?CreerSonWiki> **Demo:** <https://ferme.yeswiki.net/?CreerSonWiki>

View file

@ -26,7 +26,7 @@ However, with a YesWiki we can build a website with multiple uses:
- Cultivate a bit of freedom... - Cultivate a bit of freedom...
**分发版本:** 4.4.4~ynh6 **分发版本:** 4.4.4~ynh7
**演示:** <https://ferme.yeswiki.net/?CreerSonWiki> **演示:** <https://ferme.yeswiki.net/?CreerSonWiki>

View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo -u __USER__ bash -c "cd __INSTALL_DIR__ && ./yeswicli importer:sync -s yunohost-cli"

View file

@ -5,7 +5,7 @@ name = "YesWiki"
description.en = "Wiki that is quick and easy to use" description.en = "Wiki that is quick and easy to use"
description.fr = "Wiki facile et rapide à prendre en main" 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"] 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.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" help.fr = "Si vous souhaitez un nom avec des espacements : remplacez les par %20 pour chaque espace"
type = "string" type = "string"
default = "MyYunoHostWiki" default = "YesWiki"
[resources] [resources]
[resources.sources.main] [resources.sources.main]
@ -81,8 +81,8 @@ sha256 = "0b4e97bdd01ab627a8a9cb5bf652708e34a9322509cb8fcb9db0fb12b6a3e6ef"
autoupdate.strategy = "latest_github_tag" autoupdate.strategy = "latest_github_tag"
[resources.sources.yunohostplugin] [resources.sources.yunohostplugin]
url = "https://repository.yeswiki.net/doryphore/extension-yunohost-1.0.0.zip" url = "https://repository.yeswiki.net/doryphore/extension-yunohost-1.0.1.zip"
sha256 = "60032781016d2bdcecce4ad5ae91e72407e64a994f63661e27a7a935ba52d50b" sha256 = "43012db78928dd59539c764029880e3f74f82972e494f7ebf1e365d5f8763c6a"
[resources.sources.importerplugin] [resources.sources.importerplugin]
url = "https://repository.yeswiki.net/doryphore/extension-importer-1.0.1.zip" url = "https://repository.yeswiki.net/doryphore/extension-importer-1.0.1.zip"

View file

@ -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" 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 # BACKUP THE MYSQL DATABASE
#================================================= #=================================================

View file

@ -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 # 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"
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 -R u=rwX,g=rX,o-rwx $install_dir
#================================================= #=================================================
@ -77,7 +77,7 @@ ynh_replace_string --match_string="'allow_raw_html' => false," --replace_string=
#================================================= #=================================================
ynh_script_progression --message="Configure importer plugin" --weight=1 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" mkdir -p "$install_dir/tools/importer"
ynh_setup_source --dest_dir="$install_dir/tools/importer" --source_id="importerplugin" ynh_setup_source --dest_dir="$install_dir/tools/importer" --source_id="importerplugin"
@ -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 # 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" 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"
# Ensure that scripts are executable # Ensure that scripts are executable
chmod +x $install_dir/tools/yunohost/private/scripts/*.sh chmod +x $install_dir/tools/yunohost/private/scripts/*.sh
@ -100,6 +102,12 @@ chmod +x $install_dir/tools/yunohost/private/scripts/*.sh
ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app"
chown root:root /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
# At last, run the YunoHost app importer # At last, run the YunoHost app importer
ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2
pushd $install_dir pushd $install_dir
@ -139,7 +147,7 @@ fi
# SECURE FILES AND DIRECTORIES # 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 -R u=rwX,g=rX,o-rwx $install_dir
chmod g-rwx $install_dir/wakka.config.php chmod g-rwx $install_dir/wakka.config.php

View file

@ -20,7 +20,11 @@ ynh_remove_nginx_config
# Remove the dedicated PHP-FPM config # Remove the dedicated PHP-FPM config
ynh_remove_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 # END OF SCRIPT

View file

@ -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" 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 # RESTORE THE MYSQL DATABASE
#================================================= #=================================================

View file

@ -35,7 +35,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then
fi fi
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R ${app}:www-data "$install_dir"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
@ -73,11 +73,39 @@ ynh_secure_remove "$install_dir/tools/importer"
mkdir -p "$install_dir/tools/importer" mkdir -p "$install_dir/tools/importer"
ynh_setup_source --dest_dir="$install_dir/tools/importer" --source_id="importerplugin" 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
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
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="'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 ?
# 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 # 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 -R u=rwX,g=rX,o-rwx $install_dir
chmod g-rwx $install_dir/wakka.config.php chmod g-rwx $install_dir/wakka.config.php