From 36d28d3c45664c04900125ac698efbce09c0d666 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 3 Jun 2022 23:08:22 +0000 Subject: [PATCH 01/24] Auto-update README --- README.md | 19 ++++++++++--------- README_fr.md | 25 +++++++++++++++---------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 45ad289..6b752a3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Dokuwiki for YunoHost -[![Integration level](https://dash.yunohost.org/integration/dokuwiki.svg)](https://dash.yunohost.org/appci/app/dokuwiki) ![](https://ci-apps.yunohost.org/ci/badges/dokuwiki.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/dokuwiki.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/dokuwiki.svg)](https://dash.yunohost.org/appci/app/dokuwiki) ![Working status](https://ci-apps.yunohost.org/ci/badges/dokuwiki.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/dokuwiki.maintain.svg) [![Install Dokuwiki with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dokuwiki) *[Lire ce readme en français.](./README_fr.md)* @@ -31,7 +31,7 @@ DokuWiki is a simple to use and highly versatile Open Source wiki software that ## Screenshots -![](./doc/screenshots/DokuWiki_Screenshot.png) +![Screenshot of Dokuwiki](./doc/screenshots/DokuWiki_Screenshot.png) ## Disclaimers / important information @@ -41,21 +41,22 @@ DokuWiki is a simple to use and highly versatile Open Source wiki software that ## Documentation and resources -* Official app website: https://www.dokuwiki.org -* Official admin documentation: https://www.dokuwiki.org/manual -* Upstream app code repository: https://github.com/splitbrain/dokuwiki -* YunoHost documentation for this app: https://yunohost.org/app_dokuwiki -* Report a bug: https://github.com/YunoHost-Apps/dokuwiki_ynh/issues +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug or sudo yunohost app upgrade dokuwiki -u https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 7dfdb64..ea9408a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Dokuwiki pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/dokuwiki.svg)](https://dash.yunohost.org/appci/app/dokuwiki) ![](https://ci-apps.yunohost.org/ci/badges/dokuwiki.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/dokuwiki.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/dokuwiki.svg)](https://dash.yunohost.org/appci/app/dokuwiki) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/dokuwiki.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/dokuwiki.maintain.svg) [![Installer Dokuwiki avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dokuwiki) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Dokuwiki rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* @@ -27,7 +31,7 @@ DokuWiki est un logiciel wiki Open Source simple à utiliser et très polyvalent ## Captures d'écran -![](./doc/screenshots/DokuWiki_Screenshot.png) +![Capture d'écran de Dokuwiki](./doc/screenshots/DokuWiki_Screenshot.png) ## Avertissements / informations importantes @@ -37,21 +41,22 @@ DokuWiki est un logiciel wiki Open Source simple à utiliser et très polyvalent ## Documentations et ressources -* Site officiel de l'app : https://www.dokuwiki.org -* Documentation officielle de l'admin : https://www.dokuwiki.org/manual -* Dépôt de code officiel de l'app : https://github.com/splitbrain/dokuwiki -* Documentation YunoHost pour cette app : https://yunohost.org/app_dokuwiki -* Signaler un bug : https://github.com/YunoHost-Apps/dokuwiki_ynh/issues +* Site officiel de l'app : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug ou sudo yunohost app upgrade dokuwiki -u https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From f5b13fce99a2085046650863c164f085d5fc21fd Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 18 Aug 2022 19:58:12 +0200 Subject: [PATCH 02/24] bump dokuwiki upstream version --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index 78012a6..1fbd62e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/splitbrain/dokuwiki/archive/release_stable_2020-07-29.tar.gz -SOURCE_SUM=cc1cd9f00095fea327baa79d8f02c904fe1c37bc3f8fd9999eaf646ee9928884 +SOURCE_URL=https://download.dokuwiki.org/src/dokuwiki/dokuwiki-2022-07-31.tgz +SOURCE_SUM=908189bd39f8b9a08654de38e799eb67ae62865265997f3f00e8280de2b45c65 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 02c097c..656581d 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ "es": "Sistema de Wiki de uso sencillicimo y compatible con los estándares", "it": "Wiki aderente agli standard, semplice da usare, finalizzato principalmente alla creazione di documentazione di qualsiasi tipo" }, - "version": "2020.07.29~ynh6", + "version": "2022.07.31~ynh1", "url": "https://www.dokuwiki.org", "upstream": { "license": "GPL-2.0-or-later", From e3ef8657a790b4a443cf10e8b92e20fd4f034822 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 18 Aug 2022 20:00:04 +0200 Subject: [PATCH 03/24] apply 'example_ynh' + use php 8.1 PHP7.4 is bulleyes will be EOL "28 Nov 2022" so bump the version and dokuwiki is compatible with PHP 8.X https://www.dokuwiki.org/requirements --- scripts/_common.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 80e5275..52b12cb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,10 +3,26 @@ #================================================= # COMMON VARIABLES #================================================= +# PHP APP SPECIFIC +#================================================= +# Depending on its version, YunoHost uses different default PHP version: +## YunoHost version "11.X" => PHP 7.4 +## YunoHost version "4.X" => PHP 7.3 +# +# This behaviour can be overridden by setting the YNH_PHP_VERSION variable +#YNH_PHP_VERSION=7.3 +#YNH_PHP_VERSION=7.4 +#YNH_PHP_VERSION=8.0 +YNH_PHP_VERSION=8.1 +# For more information, see the PHP application helper: https://github.com/YunoHost/yunohost/blob/dev/helpers/php#L3-L6 +# Or this app package depending on PHP: https://github.com/YunoHost-Apps/grav_ynh/blob/master/scripts/_common.sh +# PHP dependencies used by the app (must be on a single line) +php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-gd" +# or, if you do not need a custom YNH_PHP_VERSION: +###php_dependencies="php$YNH_DEFAULT_PHP_VERSION-deb1 php$YNH_DEFAULT_PHP_VERSION-deb2" -YNH_PHP_VERSION="7.3" - -pkg_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-gd" +# dependencies used by the app (must be on a single line) +pkg_dependencies="$php_dependencies" #================================================= # PERSONAL HELPERS From d9e9f932817a4531a181dcc4dbc4ec5226178135 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 18 Aug 2022 20:46:27 +0200 Subject: [PATCH 04/24] purge plugin "logautherror" (not compatible) --- conf/logautherror.src | 6 ------ scripts/install | 7 ------- scripts/upgrade | 8 ++++++++ 3 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 conf/logautherror.src diff --git a/conf/logautherror.src b/conf/logautherror.src deleted file mode 100644 index f68bd07..0000000 --- a/conf/logautherror.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/mallchin/dokuwiki_plugin_logautherror/archive/master.zip -SOURCE_SUM=bc51d4da781d0aabab8e086e51f3cb77ac983eb4366f4c8f5247bb863d4a3bb2 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/scripts/install b/scripts/install index 0f75316..c4bd0ff 100755 --- a/scripts/install +++ b/scripts/install @@ -166,13 +166,6 @@ cp ../conf/plugins.local.php $final_path/conf/plugins.local.php.bak #ynh_store_file_checksum --file="$final_path/conf/local.protected.php" ### Files '$final_path/conf/local.php' and '$final_path/conf/acl.auth.php' can be modified by user, no need to store checksum as they cannot be overwritten safely by the upgrade script -#================================================= -# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN -#================================================= -ynh_script_progression --message="Installing logautherror plugin for Fail2Ban..." --weight=2 - -ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror - # #================================================= # # GENERIC FINALIZATION # #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a5ee7cf..3c56493 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -170,6 +170,14 @@ if [ ! -f "$final_path/inc/preload.php" ]; then fi fi +# purge "LOGAUTHERROR PLUGIN" as not compatible and not maintained anymore +# See https://www.dokuwiki.org/plugin:logautherror +if [ -d "$final_path/lib/plugins/logautherror" ]; then + ynh_script_progression --message="Purge "LOGAUTHERROR PLUGIN" as not maintained anymore" --weight=1 + ynh_secure_remove --file "$final_path/lib/plugins/logautherror" +fi + + #================================================= # CREATE DEDICATED USER #================================================= From 3006e4345d7f8c81d0a9dede39ce4e1e273445d1 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 18 Aug 2022 21:47:53 +0200 Subject: [PATCH 05/24] Change method to "automatic upgrade" of plugins --- scripts/_common.sh | 2 +- scripts/upgrade | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 52b12cb..07ff399 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -17,7 +17,7 @@ YNH_PHP_VERSION=8.1 # For more information, see the PHP application helper: https://github.com/YunoHost/yunohost/blob/dev/helpers/php#L3-L6 # Or this app package depending on PHP: https://github.com/YunoHost-Apps/grav_ynh/blob/master/scripts/_common.sh # PHP dependencies used by the app (must be on a single line) -php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-gd" +php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli" # or, if you do not need a custom YNH_PHP_VERSION: ###php_dependencies="php$YNH_DEFAULT_PHP_VERSION-deb1 php$YNH_DEFAULT_PHP_VERSION-deb2" diff --git a/scripts/upgrade b/scripts/upgrade index 3c56493..46b23af 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -283,15 +283,27 @@ fi # TODO Taken from old "upgrade" script. Should check if it is needed and what it does # Update all plugins - for name_plugin in $(sudo -s cat $final_path/lib/plugins/*/plugin.info.txt | grep url | awk -F ':' '{print $3}'); - do - # Get a official plugin for dokuwiki, not update a no-official - wget -nv --quiet "https://github.com/splitbrain/dokuwiki-plugin-$name_plugin/zipball/master" -O "${name_plugin}.zip" -o /dev/null || true - if [ -s "${name_plugin}.zip" ]; then - unzip ${name_plugin}.zip - cp -a splitbrain-dokuwiki-plugin-${name_plugin}*/. "$final_path/lib/plugins/$name_plugin/" - fi - done + ###for name_plugin in $(sudo -s cat $final_path/lib/plugins/*/plugin.info.txt | grep url | awk -F ':' '{print $3}'); + ###do + ### # Get a official plugin for dokuwiki, not update a no-official + ### wget -nv --quiet "https://github.com/splitbrain/dokuwiki-plugin-$name_plugin/zipball/master" -O "${name_plugin}.zip" -o /dev/null || true + ### if [ -s "${name_plugin}.zip" ]; then + ### unzip ${name_plugin}.zip + ### cp -a splitbrain-dokuwiki-plugin-${name_plugin}*/. "$final_path/lib/plugins/$name_plugin/" + ### fi + ###done + + # if "file" exists and is executable + # Stolen from https://github.com/YunoHost-Apps/grav_ynh/blob/testing/scripts/upgrade#L189 + if [ -x "$final_path/bin/plugin.php" ]; then + pushd "$final_path" + ynh_exec_warn_less ynh_exec_as $app php${YNH_PHP_VERSION} bin/plugin.php --no-colors extension upgrade || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your DokuWiki admin panel." + popd + else + ynh_print_warn --message="Automatic plugin cannot be done, you have to upgrade them from your DokuWiki admin panel." + fi + + fi #================================================= From f1d843f6ca7f5b11a851a29e53d7ce1a5c1a7c2d Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 18 Aug 2022 22:05:52 +0200 Subject: [PATCH 06/24] try to enhance the CI upgrade tests --- check_process | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 084fa0f..5ff09b0 100644 --- a/check_process +++ b/check_process @@ -14,15 +14,20 @@ setup_private=1 setup_public=1 upgrade=1 - # Laster released version. See https://github.com/YunoHost-Apps/dokuwiki_ynh/commits/master + # Latest released version. See https://github.com/YunoHost-Apps/dokuwiki_ynh/commits/master upgrade=1 from_commit=500a7d3fa9c008a2b75d0f6bec519e41fed97da0 + upgrade=1 from_commit=f45c459b287c8f045c08e65cea412cfc2cae38f4 backup_restore=1 multi_instance=1 change_url=1 + actions=0 + config_panel=0 ;;; Options Email= Notification=none ;;; Upgrade options - ; commit=01add99d3d903ca6d07f863045edf2ba46cf18d5 - name=Create check_process + ; commit=500a7d3fa9c008a2b75d0f6bec519e41fed97da0 + name=[fix] dedicated named location per $app (#63) manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=Yes&language=en& + ; commit=f45c459b287c8f045c08e65cea412cfc2cae38f4 + name=add config panel From 0473c71a35d9f6a5b901c5835a085abaf8ca96db Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 18 Aug 2022 23:57:11 +0200 Subject: [PATCH 07/24] refactor admin permission (move in install script & clean in upgrade) --- scripts/install | 5 +++-- scripts/upgrade | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index c4bd0ff..b00cf76 100755 --- a/scripts/install +++ b/scripts/install @@ -117,8 +117,6 @@ ynh_script_progression --message="Configuring DokuWiki..." --weight=2 # This File cannot be modified directly by DokuWiki, only by hand or by YunoHost # It will only be updated by YunoHost package or directly by adventurous users -# Create the "admin" group and add the "admin" user -ynh_permission_create --permission "admin" --allowed "$admin_user" # Customize admin group in case of multiple wiki install managed by different admins # dokuwiki.admin; dokuwiki__1.admin; etc @@ -221,6 +219,9 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex #================================================= ynh_script_progression --message="Configuring permissions..." --weight=2 +# Create the "admin" permission and add the "admin_user" to it +ynh_permission_create --permission "admin" --allowed "$admin_user" + # Make app public if necessary if [ $is_public -eq 1 ] then diff --git a/scripts/upgrade b/scripts/upgrade index 46b23af..99c5ed2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -317,9 +317,6 @@ ynh_backup_if_checksum_is_different --file="$final_path/conf/local.protected.php # Always overwrite local file with the one from package. cp ../conf/local.protected.php $final_path/conf -# Create the "admin" group and add the "admin" user -#ynh_permission_create --permission "admin" --allowed "$admin_user" - # Customize admin group in case of multiple wiki install managed by different admins # dokuwiki.admin; dokuwiki__1.admin; etc ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/conf/local.protected.php" From 4802b254bf137cf5980c24486745a5c62fe1a570 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 18 Aug 2022 23:59:19 +0200 Subject: [PATCH 08/24] fix copied files being owned by root and not app user --- scripts/install | 10 +++++----- scripts/upgrade | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index b00cf76..4b469df 100755 --- a/scripts/install +++ b/scripts/install @@ -141,20 +141,20 @@ ynh_add_config --template="../conf/acl.auth.php" --destination="$final_path/conf # Other files will be read ony and owned by root. # See https://www.dokuwiki.org/install:permissions -cp $final_path/conf/local.php.dist $final_path/conf/local.php.bak -cp $final_path/conf/users.auth.php.dist $final_path/conf/users.auth.php +cp --archive $final_path/conf/local.php.dist $final_path/conf/local.php.bak +cp --archive $final_path/conf/users.auth.php.dist $final_path/conf/users.auth.php # This file might be used by plugins like https://www.dokuwiki.org/plugin:siteexport # Create it to be more "user friendly" as over the top security is not the main goal here # This file could be use for bad behaviour. # See https://www.dokuwiki.org/devel:preload?s[]=preload -cp $final_path/inc/preload.php.dist $final_path/inc/preload.php +cp --archive $final_path/inc/preload.php.dist $final_path/inc/preload.php # There is no template .dist provided inside DokuWiki installation folder # Create "empty" files to be able to manage linux permissions # Files content is taken from an existing DokuWiki installation -cp ../conf/plugins.local.php $final_path/conf -cp ../conf/plugins.local.php $final_path/conf/plugins.local.php.bak +cp --archive ../conf/plugins.local.php $final_path/conf +cp --archive ../conf/plugins.local.php $final_path/conf/plugins.local.php.bak #================================================= # STORE THE CHECKSUM OF THE CONFIG FILE diff --git a/scripts/upgrade b/scripts/upgrade index 99c5ed2..8e7d452 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,22 +143,22 @@ if [ ! -f "$final_path/conf/local.php.bak" ]; then # if template exists if [ -f "$final_path/conf/local.php.dist" ]; then # Copy template to create default file - cp "$final_path/conf/local.php.dist" "$final_path/conf/local.php.bak" + cp --archive "$final_path/conf/local.php.dist" "$final_path/conf/local.php.bak" fi fi if [ ! -f "$final_path/conf/users.auth.php" ]; then if [ -f "$final_path/conf/users.auth.php.dist" ]; then - cp $final_path/conf/users.auth.php.dist $final_path/conf/users.auth.php + cp --archive $final_path/conf/users.auth.php.dist $final_path/conf/users.auth.php fi fi if [ ! -f "$final_path/conf/plugins.local.php" ]; then - cp ../conf/plugins.local.php $final_path/conf + cp --archive ../conf/plugins.local.php $final_path/conf fi if [ ! -f "$final_path/conf/plugins.local.php.bak" ]; then - cp ../conf/plugins.local.php $final_path/conf/plugins.local.php.bak + cp --archive ../conf/plugins.local.php $final_path/conf/plugins.local.php.bak fi @@ -166,7 +166,7 @@ if [ ! -f "$final_path/inc/preload.php" ]; then # if template exists if [ -f "$final_path/inc/preload.php.dist" ]; then # Copy template to create default file - cp "$final_path/inc/preload.php.dist" "$final_path/inc/preload.php" + cp --archive "$final_path/inc/preload.php.dist" "$final_path/inc/preload.php" fi fi @@ -315,7 +315,7 @@ fi ynh_backup_if_checksum_is_different --file="$final_path/conf/local.protected.php" # Always overwrite local file with the one from package. -cp ../conf/local.protected.php $final_path/conf +cp --archive ../conf/local.protected.php $final_path/conf # Customize admin group in case of multiple wiki install managed by different admins # dokuwiki.admin; dokuwiki__1.admin; etc From 03ae0ce55bd26c56631608afd4743ff8c2c16eb0 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Fri, 19 Aug 2022 00:18:36 +0200 Subject: [PATCH 09/24] fix remains of logauth plugins again... --- scripts/upgrade | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8e7d452..a9430de 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -324,13 +324,6 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/conf/local.protected.php" -#================================================= -# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN -#================================================= -ynh_script_progression --message="Upgrading logautherror plugin for Fail2Ban..." --weight=2 - -ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror - # #================================================= # # GENERIC FINALIZATION # #================================================= From 7fcfcdb6e9bff3d30e0ffa9effe3026068565c1e Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sat, 20 Aug 2022 20:14:29 +0200 Subject: [PATCH 10/24] example_ynh: switch nginx and php blocks --- scripts/install | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 4b469df..e2e2618 100755 --- a/scripts/install +++ b/scripts/install @@ -78,14 +78,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -95,6 +87,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # SPECIFIC SETUP #================================================= From 477ade870d440b98f2b40be6de72246947d7e47b Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:14:43 +0200 Subject: [PATCH 11/24] use variables for config "ynh_add_fpm_config" --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index e2e2618..8f3f517 100755 --- a/scripts/install +++ b/scripts/install @@ -84,8 +84,10 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +fpm_usage=low +fpm_footprint=low +ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint" #================================================= # NGINX CONFIGURATION From a81ca1160384f4c7b8daff806ef2d80695f0e26d Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:15:46 +0200 Subject: [PATCH 12/24] add 'extra_php-fpm.conf' to custom php config "ynh_add_fpm_config" uses this file at the end of its setup Allows to upload bigger files than default --- conf/extra_php-fpm.conf | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 conf/extra_php-fpm.conf diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..db2ca45 --- /dev/null +++ b/conf/extra_php-fpm.conf @@ -0,0 +1,7 @@ +; Additional 'php.ini' parameters for this YunoHost package/application + +; Common values to change to increase file upload limit +; Tips: you need to do modify nginx config too: "client_max_body_size" +php_admin_value[upload_max_filesize] = 25M +php_admin_value[post_max_size] = 25M +;source: https://www.dokuwiki.org/faq:uploadsize From 26a16c44d0c58d1413c6c7beb5ca45ecfcf7ddfd Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:18:19 +0200 Subject: [PATCH 13/24] apply 'example_ynh' - no idea if these are needed... --- scripts/backup | 4 ++++ scripts/install | 4 ++++ scripts/restore | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/scripts/backup b/scripts/backup index 994eb7f..0020188 100755 --- a/scripts/backup +++ b/scripts/backup @@ -13,6 +13,10 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ### Remove this function if there's nothing to clean before calling the remove script. + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/install b/scripts/install index 8f3f517..75c6b39 100755 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,10 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ### Remove this function if there's nothing to clean before calling the remove script. + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/restore b/scripts/restore index 7131e35..0f7e0c0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -13,6 +13,10 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + #### Remove this function if there's nothing to clean before calling the remove script. + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors From 006211049d4f2fc1a01d7a4b6c93b07353d0144e Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:21:38 +0200 Subject: [PATCH 14/24] apply 'example_ynh' : dependencies + nginx block moved --- scripts/remove | 8 ++++++++ scripts/restore | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/remove b/scripts/remove index b0d36b7..e2c981a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -45,6 +45,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies if no other package need them +ynh_remove_app_dependencies + #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 0f7e0c0..bfe1bca 100755 --- a/scripts/restore +++ b/scripts/restore @@ -45,12 +45,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -121,6 +115,12 @@ ynh_script_progression --message="Restoring the Fail2Ban configuration..." --wei ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # GENERIC FINALIZATION From ec68ea9c949c16f196a760ba8bbd9b6e5a26ac15 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:22:58 +0200 Subject: [PATCH 15/24] apply 'example_ynh' : move permission block --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 75c6b39..863b430 100755 --- a/scripts/install +++ b/scripts/install @@ -225,15 +225,16 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex #================================================= ynh_script_progression --message="Configuring permissions..." --weight=2 -# Create the "admin" permission and add the "admin_user" to it -ynh_permission_create --permission "admin" --allowed "$admin_user" - # Make app public if necessary if [ $is_public -eq 1 ] then ynh_permission_update --permission="main" --add="visitors" fi +# Create the "admin" permission and add the "admin_user" to it +# More users can be added to the group from the YunoHost webadmin +ynh_permission_create --permission "admin" --allowed "$admin_user" + #================================================= # RELOAD NGINX #================================================= From b312077566976a24aa8173c381940fe0cd50a647 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:28:25 +0200 Subject: [PATCH 16/24] apply 'example_ynh': move fail2ban block --- scripts/restore | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/restore b/scripts/restore index bfe1bca..d2d391a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -91,13 +91,18 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION +# RESTORE FAIL2BAN CONFIGURATION #================================================= ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7 # Recreate a dedicated php-fpm config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion +ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" +ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" +ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # REINSTALL DEPENDENCIES @@ -108,13 +113,8 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies #================================================= -# RESTORE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7 -ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" -ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= From 2ce12e2e5e343b56b06c6f0eaa5309ab2f1de761 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:29:29 +0200 Subject: [PATCH 17/24] apply 'example_ynh': move php fpm block --- scripts/restore | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/restore b/scripts/restore index d2d391a..e4bf421 100755 --- a/scripts/restore +++ b/scripts/restore @@ -90,16 +90,10 @@ chown -R $app:www-data "$final_path" # chown -R $app:root $final_path/lib/tpl #================================================= -# RESTORE THE PHP-FPM CONFIGURATION # RESTORE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7 -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban @@ -113,7 +107,15 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies #================================================= +# RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated php-fpm config +# TODO: not in example_ynh, not needed? +#ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion #================================================= # RESTORE THE NGINX CONFIGURATION From e81c507a1169e3242b3e649570758150a581dc08 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:30:24 +0200 Subject: [PATCH 18/24] apply 'example_ynh': cosmetic + typo --- scripts/restore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index e4bf421..f285815 100755 --- a/scripts/restore +++ b/scripts/restore @@ -98,6 +98,8 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban +#================================================= +# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -131,7 +133,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM.." --weight=2 -ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= From 217eb7e8187fe433644e82380666d2c7fd0c8879 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:31:11 +0200 Subject: [PATCH 19/24] Remove unused variable + pretty indent --- scripts/install | 1 - scripts/restore | 2 +- scripts/upgrade | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 863b430..e39993f 100755 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,6 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) fpm_usage=low fpm_footprint=low ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint" diff --git a/scripts/restore b/scripts/restore index f285815..5469cad 100755 --- a/scripts/restore +++ b/scripts/restore @@ -30,8 +30,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) diff --git a/scripts/upgrade b/scripts/upgrade index a9430de..790c8e0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -296,9 +296,9 @@ fi # if "file" exists and is executable # Stolen from https://github.com/YunoHost-Apps/grav_ynh/blob/testing/scripts/upgrade#L189 if [ -x "$final_path/bin/plugin.php" ]; then - pushd "$final_path" - ynh_exec_warn_less ynh_exec_as $app php${YNH_PHP_VERSION} bin/plugin.php --no-colors extension upgrade || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your DokuWiki admin panel." - popd + pushd "$final_path" + ynh_exec_warn_less ynh_exec_as $app php${YNH_PHP_VERSION} bin/plugin.php --no-colors extension upgrade || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your DokuWiki admin panel." + popd else ynh_print_warn --message="Automatic plugin cannot be done, you have to upgrade them from your DokuWiki admin panel." fi From 7e79aa674a852c4aafca784533cc1d33dfb091b7 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:34:40 +0200 Subject: [PATCH 20/24] Drop support for older YunoHost versions. I'm not sure how long it will take for people to migrate on YunoHost 11. Untill then, the package will not be available so bad news for them... Even if package should work on it, I cannot test against it as I don't use version 4.X anymore. Is there a CI for it? --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 656581d..32a5baa 100644 --- a/manifest.json +++ b/manifest.json @@ -29,12 +29,12 @@ "email": "opi@zeropi.net" }], "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.0" }, "multi_instance": true, "services": [ "nginx", - "php7.3-fpm" + "php8.1-fpm" ], "arguments": { "install" : [ From 3da84c9dfe7e9723496bc8d3f924317729d12fa7 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Sun, 21 Aug 2022 01:38:01 +0200 Subject: [PATCH 21/24] update the changelog Hope it can be usefull to track changes made in the package --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93ea3bf..787aa36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,26 @@ ------------ +# [2022.07.31~ynh1] - 2022-08-XX + +## Added + +- New DokuWiki version `2022-07-31 "Igor"` +- New automated tests for "check_process" CI + +## Changed + +- Use PHP8.1 as default (PHP7.4 is bulleyes will be EOL "28 Nov 2022" so bump the version) +- Change method to "automatic upgrade" of plugins +- Cleanning 'admin permission' handling +- redo how php is managed: ynh_add_fpm_config + php config files +- Sync with reference package 'example_ynh' + +## Removed + +- automatic installation of plugin "logautherror" (not compatible) +- support for YunoHost below 11 (no time to test against older versions) + # [2020-07-29~ynh4] - 2021-01-19 ### Added From c76dc5aa7523e32be026f9cbc92263e53f9b2e5c Mon Sep 17 00:00:00 2001 From: Gofannon Date: Fri, 26 Aug 2022 19:32:44 +0200 Subject: [PATCH 22/24] fix CI warning by adding details about public access --- manifest.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 32a5baa..6672e04 100644 --- a/manifest.json +++ b/manifest.json @@ -55,7 +55,11 @@ { "name": "is_public", "type": "boolean", - "default": true + "default": true, + "help": { + "en": "Makes the wiki accessible directly from the Internet for everyone, without intermediate YunoHost authentication", + "fr": "Rend le wiki accessible directement depuis Internet pour tout le monde, sans authentification YunoHost intermédiaire" + } }, { "name": "language", From e3132a97a6dbdd67e0984911b4b1ccd9fa8edaae Mon Sep 17 00:00:00 2001 From: Gofannon Date: Fri, 26 Aug 2022 19:33:17 +0200 Subject: [PATCH 23/24] Revert "apply 'example_ynh' - no idea if these are needed..." This reverts commit 26a16c44d0c58d1413c6c7beb5ca45ecfcf7ddfd. Unused bu the app! see https://github.com/YunoHost-Apps/dokuwiki_ynh/pull/92#issuecomment-1223069994 --- scripts/backup | 4 ---- scripts/install | 4 ---- scripts/restore | 4 ---- 3 files changed, 12 deletions(-) diff --git a/scripts/backup b/scripts/backup index 0020188..994eb7f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/install b/scripts/install index e39993f..72bf387 100755 --- a/scripts/install +++ b/scripts/install @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/restore b/scripts/restore index 5469cad..5f1e0f4 100755 --- a/scripts/restore +++ b/scripts/restore @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors From 31825890144773a1e0ee338c7341026e32cfff79 Mon Sep 17 00:00:00 2001 From: Gofannon Date: Thu, 8 Sep 2022 10:20:55 +0200 Subject: [PATCH 24/24] upgrade to lastest version "Hotfix 2022-07-31a" Fix security hole https://github.com/splitbrain/dokuwiki/issues/3761 --- CHANGELOG.md | 4 ++-- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 787aa36..b03d4e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,11 @@ ------------ -# [2022.07.31~ynh1] - 2022-08-XX +# [2022.07.31a~ynh1] - 2022-09-XX ## Added -- New DokuWiki version `2022-07-31 "Igor"` +- New DokuWiki version `2022-07-31a "Igor"` with **Hotfix 2022-07-31a** - New automated tests for "check_process" CI ## Changed diff --git a/conf/app.src b/conf/app.src index 1fbd62e..8339df0 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://download.dokuwiki.org/src/dokuwiki/dokuwiki-2022-07-31.tgz -SOURCE_SUM=908189bd39f8b9a08654de38e799eb67ae62865265997f3f00e8280de2b45c65 +SOURCE_URL=https://download.dokuwiki.org/src/dokuwiki/dokuwiki-2022-07-31a.tgz +SOURCE_SUM=48ed2ae11fa4a0ae8338af9aedc837601b34e21c0be15d16e2d6228ca7a91f23 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 6672e04..ab16da5 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ "es": "Sistema de Wiki de uso sencillicimo y compatible con los estándares", "it": "Wiki aderente agli standard, semplice da usare, finalizzato principalmente alla creazione di documentazione di qualsiasi tipo" }, - "version": "2022.07.31~ynh1", + "version": "2022.07.31a~ynh1", "url": "https://www.dokuwiki.org", "upstream": { "license": "GPL-2.0-or-later",