mirror of
https://github.com/YunoHost-Apps/yeswiki_ynh.git
synced 2024-09-03 18:05:56 +02:00
cleaning
This commit is contained in:
parent
3c76352832
commit
c27e334e77
5 changed files with 34 additions and 52 deletions
|
@ -22,15 +22,11 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
ynh_backup --src_path="$install_dir"
|
ynh_backup --src_path="$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -21,9 +21,9 @@ 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
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
|
@ -36,7 +36,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL COMPOSER DEPENDENCIES
|
# INSTALL COMPOSER DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing composer dependencies..."
|
ynh_script_progression --message="Installing Composer dependencies..."
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir"
|
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir"
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ ynh_setup_source --dest_dir="$install_dir/tools/importer" --source_id="importerp
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD AND CONFIGURE YUNOHOST PLUGIN
|
# DOWNLOAD AND CONFIGURE YUNOHOST PLUGIN
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configure yunohost plugin" --weight=2
|
ynh_script_progression --message="Configure YunoHost plugin" --weight=2
|
||||||
|
|
||||||
# Download yeswiki plugin from yeswiki repository
|
# Download yeswiki plugin from yeswiki repository
|
||||||
mkdir -p "$install_dir/tools/yunohost"
|
mkdir -p "$install_dir/tools/yunohost"
|
||||||
|
@ -109,20 +109,20 @@ pushd $install_dir
|
||||||
ynh_exec_as $app ./yeswicli importer:sync -s yunohost-cli
|
ynh_exec_as $app ./yeswicli importer:sync -s yunohost-cli
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CONFIGURE YUNOHOST PLUGIN
|
||||||
|
#=================================================
|
||||||
if [ "${authprovider}" = "Yunohost SSO" ]; then
|
if [ "${authprovider}" = "Yunohost SSO" ]; then
|
||||||
#=================================================
|
|
||||||
# CONFIGURE YUNOHOST PLUGIN
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Enable YunoHost SSO" --weight=1
|
ynh_script_progression --message="Enable YunoHost SSO" --weight=1
|
||||||
|
|
||||||
# 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=" 'enable_yunohost_sso' => true,\n);" --target_file="$install_dir/wakka.config.php"
|
ynh_replace_string --match_string=");" --replace_string=" 'enable_yunohost_sso' => true,\n);" --target_file="$install_dir/wakka.config.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# DOWNLOAD AND CONFIGURE FERME PLUGIN
|
||||||
|
#=================================================
|
||||||
if [ "${wikimodel}" = "CLIC" ]; then
|
if [ "${wikimodel}" = "CLIC" ]; then
|
||||||
#=================================================
|
|
||||||
# DOWNLOAD AND CONFIGURE FERME PLUGIN
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configure ferme plugin" --weight=2
|
ynh_script_progression --message="Configure ferme plugin" --weight=2
|
||||||
|
|
||||||
# Download ferme plugin from yeswiki repository
|
# Download ferme plugin from yeswiki repository
|
||||||
|
|
|
@ -10,9 +10,9 @@ source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Remove the dedicated NGINX config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
|
@ -21,20 +21,6 @@ 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
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=11
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
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 MYSQL DATABASE
|
# RESTORE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -42,6 +28,15 @@ ynh_script_progression --message="Restoring the MySQL database..." --weight=3
|
||||||
|
|
||||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE SYSTEM CONFIGURATIONS
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -9,30 +9,21 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK VERSION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading source files..." --weight=5
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]; then
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=5
|
# TODO : find a way to sync stable extensions list to avoid hardcoded extensions folders to keep
|
||||||
|
noncore_extensions="$(echo tools/{accountactivationbyemail,advancedsearch,benevolat,ferme,fontautoinstall,importer,ipblock,lms,login-sso,logincas,loginldap,maintenance,multideletepages,nextcloudconnector,publication,qrcode,stats,tabdyn,twolevels,webhooks,yunohost})"
|
||||||
|
ferme_instances="$(
|
||||||
|
cd $install_dir
|
||||||
|
for p in $(ls -- */wakka.config.php 2>/dev/null); do dirname "$p"; done
|
||||||
|
)"
|
||||||
|
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env wakka.config.php files custom private themes $noncore_extensions $ferme_instances"
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
ynh_replace_string --match_string="yeswiki_release' \?=> \?'.*',$" --replace_string="yeswiki_release' => '$(ynh_app_upstream_version)'," --target_file="$install_dir/wakka.config.php"
|
||||||
# TODO : find a way to sync stable extensions list to avoid hardcoded extensions folders to keep
|
|
||||||
noncore_extensions="$(echo tools/{accountactivationbyemail,advancedsearch,benevolat,ferme,fontautoinstall,importer,ipblock,lms,login-sso,logincas,loginldap,maintenance,multideletepages,nextcloudconnector,publication,qrcode,stats,tabdyn,twolevels,webhooks,yunohost})"
|
|
||||||
ferme_instances="$(
|
|
||||||
cd $install_dir
|
|
||||||
for p in $(ls -- */wakka.config.php 2>/dev/null); do dirname "$p"; done
|
|
||||||
)"
|
|
||||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env wakka.config.php files custom private themes $noncore_extensions $ferme_instances"
|
|
||||||
|
|
||||||
ynh_replace_string --match_string="yeswiki_release' \?=> \?'.*',$" --replace_string="yeswiki_release' => '$(ynh_app_upstream_version)'," --target_file="$install_dir/wakka.config.php"
|
|
||||||
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"
|
||||||
|
@ -53,7 +44,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL COMPOSER DEPENDENCIES
|
# INSTALL COMPOSER DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing composer dependencies..."
|
ynh_script_progression --message="Installing Composer dependencies..."
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir"
|
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir"
|
||||||
|
|
||||||
|
@ -61,7 +52,7 @@ ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$i
|
||||||
# DOWNLOAD AND CONFIGURE YUNOHOST PLUGIN
|
# DOWNLOAD AND CONFIGURE YUNOHOST PLUGIN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrading Yunohost plugin..." --weight=3
|
ynh_script_progression --message="Upgrading YunoHost plugin..." --weight=3
|
||||||
|
|
||||||
# Download yunohost plugin from yeswiki repository
|
# Download yunohost plugin from yeswiki repository
|
||||||
ynh_secure_remove "$install_dir/tools/yunohost"
|
ynh_secure_remove "$install_dir/tools/yunohost"
|
||||||
|
|
Loading…
Add table
Reference in a new issue