1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dokuwiki_ynh.git synced 2024-09-03 18:26:20 +02:00

Merge branch 'testing' into permissions

This commit is contained in:
ljf (zamentur) 2021-01-19 13:30:29 +01:00 committed by GitHub
commit fdc2fc4e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 114 additions and 103 deletions

View file

@ -10,7 +10,7 @@
------------ ------------
# [2018-04-22b~ynh2] - 2020-04-30 # [2020-07-29~ynh4] - 2021-01-19
### Added ### Added
@ -21,6 +21,15 @@
- wiki administrators is now a group and can be modified from webadmin YunoHost panel - wiki administrators is now a group and can be modified from webadmin YunoHost panel
- Require YunoHost 3.7 minimum - Require YunoHost 3.7 minimum
## [2020-07-29~ynh2] - 2020-10-23
### Added
- New DokuWiki version `2020-07-29`
### Changed
- Set PHP7.3 as default
## [2018-04-22b~ynh1] - 2020-03-23 ## [2018-04-22b~ynh1] - 2020-03-23

View file

@ -1,7 +1,7 @@
# DokuWiki for YunoHost # DokuWiki for YunoHost
[![Integration level](https://dash.yunohost.org/integration/dokuwiki.svg)](https://dash.yunohost.org/appci/app/dokuwiki) [![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)
[![Install DokuWiki with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=dokuwiki) [![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)* *[Lire ce readme en français.](./README_fr.md)*
@ -12,11 +12,11 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
DokuWiki is a simple to use and highly versatile Open Source wiki software that doesn't require a database. It is loved by users for its clean and readable syntax. The ease of maintenance, backup and integration makes it an administrator's favorite. Built in access controls and authentication connectors make DokuWiki especially useful in the enterprise context and the large number of plugins contributed by its vibrant community allow for a broad range of use cases beyond a traditional wiki. DokuWiki is a simple to use and highly versatile Open Source wiki software that doesn't require a database. It is loved by users for its clean and readable syntax. The ease of maintenance, backup and integration makes it an administrator's favorite. Built in access controls and authentication connectors make DokuWiki especially useful in the enterprise context and the large number of plugins contributed by its vibrant community allow for a broad range of use cases beyond a traditional wiki.
**Shipped version:** 2018-04-22b "Greebo" **Shipped version:** 2020-07-29
## Screenshots ## Screenshots
![Screenshot of DokuWiki main window](dokuwikimainwindow.png) ![Screenshot of DokuWiki main window](sources/DokuWiki_Screenshot.png)
## Demo ## Demo
@ -26,8 +26,8 @@ DokuWiki is a simple to use and highly versatile Open Source wiki software that
## Documentation ## Documentation
* Official documentation: <https://www.dokuwiki.org/manual> * Official documentation: https://www.dokuwiki.org/manual
* YunoHost documentation: <https://yunohost.org/#/app_dokuwiki> * YunoHost documentation: https://yunohost.org/#/app_dokuwiki
## YunoHost specific features ## YunoHost specific features
@ -38,31 +38,28 @@ DokuWiki is a simple to use and highly versatile Open Source wiki software that
### Supported architectures ### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/dokuwiki/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/dokuwiki/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/dokuwiki/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/dokuwiki/)
## Limitations ## Limitations
* Cannot create or login with dokuwiki internal users, only users from Yunohost (Work needed for [authchained plugin](https://www.dokuwiki.org/plugin:authchained)) * Cannot create or login with DokuWiki internal users, only users from YunoHost (Work needed for [authchained plugin](https://www.dokuwiki.org/plugin:authchained))
## Links ## Links
* Report a bug: <https://github.com/YunoHost-Apps/dokuwiki_ynh/issues> * Report a bug: https://github.com/YunoHost-Apps/dokuwiki_ynh/issues
* App website: <https://www.dokuwiki.org> * App website: https://www.dokuwiki.org
* Upstream app repository: <https://github.com/splitbrain/dokuwiki> * Upstream app repository: https://github.com/splitbrain/dokuwiki
* YunoHost website: <https://yunohost.org> * YunoHost website: https://yunohost.org
--- ---
## Developers infos ## Developers infos
**Only if you know what you are doing AND want to switch to an unstable branch for testing or coding** Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing)
Instead of merging directly into `master`, please do 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.
```
To try the `testing` branch, please proceed like that.
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug
or or
sudo yunohost app upgrade dokuwiki -u https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug sudo yunohost app upgrade dokuwiki -u https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug

View file

@ -1,22 +1,22 @@
# Dokuwiki pour YunoHost # DokuWiki pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/dokuwiki.svg)](https://dash.yunohost.org/appci/app/dokuwiki) [![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)
[![Installer DokuWiki grâce à YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=dokuwiki) [![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)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer Dokuwiki rapidement et simplement sur un serveur Yunohost. > *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.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble ## Vue d'ensemble
DokuWiki est un logiciel wiki Open Source simple à utiliser et très polyvalent qui ne nécessite pas de base de données. Il est apprécié par les utilisateurs pour sa syntaxe propre et lisible. La facilité de maintenance, de sauvegarde et d'intégration en fait un favori d'administrateur. Des contrôles d'accès et des connecteurs d'authentification intégrés rendent DokuWiki particulièrement utile dans le contexte de l'entreprise et le grand nombre de plugins apportés par sa communauté dynamique permettent un large éventail de cas d'utilisation au-delà d'un wiki traditionnel. DokuWiki est un logiciel wiki Open Source simple à utiliser et très polyvalent qui ne nécessite pas de base de données. Il est apprécié par les utilisateurs pour sa syntaxe propre et lisible. La facilité de maintenance, de sauvegarde et d'intégration en fait un favori d'administrateur. Des contrôles d'accès et des connecteurs d'authentification intégrés rendent DokuWiki particulièrement utile dans le contexte de l'entreprise et le grand nombre de plugins apportés par sa communauté dynamique permettent un large éventail de cas d'utilisation au-delà d'un wiki traditionnel.
**Version incluse:** 2018-04-22b "Greebo" **Version incluse:** 2020-07-29
## Captures d'écran ## Captures d'écran
![Capture d'écran de la fenêtre principale de DokuWiki](dokuwikimainwindow.png) ![Capture d'écran](sources/DokuWiki_Screenshot.png)
## Démo ## Démo
@ -26,8 +26,8 @@ DokuWiki est un logiciel wiki Open Source simple à utiliser et très polyvalent
## Documentation ## Documentation
* Documentation officielle: <https://www.dokuwiki.org/manual> * Documentation officielle : https://www.dokuwiki.org/manual
* Documentation YunoHost: <https://yunohost.org/#/app_dokuwiki> * Documentation YunoHost : https://yunohost.org/#/app_dokuwiki
## Caractéristiques spécifiques YunoHost ## Caractéristiques spécifiques YunoHost
@ -38,27 +38,29 @@ DokuWiki est un logiciel wiki Open Source simple à utiliser et très polyvalent
### Architectures matérielles supportées ### Architectures matérielles supportées
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/dokuwiki/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/dokuwiki/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/dokuwiki/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/dokuwiki%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/dokuwiki/)
## Limitations ## Limitations
* Impossible d'ajouter et d'utiliser les utilisateurs internes de DokuWiki, seulement ceux de Yunohost (travail nécessaire pour [authchained plugin](https://www.dokuwiki.org/plugin:authchained)) * Impossible d'ajouter et d'utiliser les utilisateurs internes de DokuWiki, seulement ceux de YunoHost (travail nécessaire pour [authchained plugin](https://www.dokuwiki.org/plugin:authchained))
## Informations additionnelles
### Historique des versions
## Liens ## Liens
* Signaler un bug: <https://github.com/YunoHost-Apps/dokuwiki_ynh/issues> * Signaler un bug : https://github.com/YunoHost-Apps/dokuwiki_ynh/issues
* Site de l'application: <https://www.dokuwiki.org> * Site de l'application : https://www.dokuwiki.org
* Dépôt de l'application principale: <https://github.com/splitbrain/dokuwiki> * Dépôt de l'application principale : https://github.com/splitbrain/dokuwiki
* Site web YunoHost: <https://yunohost.org> * Site web YunoHost : https://yunohost.org/
--- ---
## Informations pour les développeurs ## Informations pour les développeurs
**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing).
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.

View file

@ -18,11 +18,8 @@
upgrade=1 from_commit=500a7d3fa9c008a2b75d0f6bec519e41fed97da0 upgrade=1 from_commit=500a7d3fa9c008a2b75d0f6bec519e41fed97da0
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=1
port_already_use=0 port_already_use=0
change_url=1 change_url=1
;;; Levels
Level 5=auto
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://download.dokuwiki.org/src/dokuwiki/dokuwiki-2018-04-22b.tgz SOURCE_URL=https://github.com/splitbrain/dokuwiki/archive/release_stable_2020-07-29.tar.gz
SOURCE_SUM=9d1437cdc7e98e471ff32079f7ca224ccf52dbbaafed39ec9746b0405b3a29ce SOURCE_SUM=cc1cd9f00095fea327baa79d8f02c904fe1c37bc3f8fd9999eaf646ee9928884
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -23,7 +23,7 @@ location __PATH__/ {
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
@ -39,12 +39,12 @@ location __PATH__/ {
} }
# Deny Access to htaccess-Files for Apache # Deny Access to htaccess-Files for Apache
location ~ /\.ht { location ~ __PATH__/\.ht {
deny all; deny all;
} }
# Serve static files # Serve static files
location ~ ^/lib.*\.(gif|png|ico|jpg)$ { location ~ ^__PATH__/lib.*\.(gif|png|ico|jpg)$ {
expires 30d; expires 30d;
} }

View file

@ -33,7 +33,7 @@ group = __USER__
; (IPv6 and IPv4-mapped) on a specific port; ; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket. ; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory. ; Note: This value is mandatory.
listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock
; Set listen(2) backlog. ; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD) ; Default Value: 511 (-1 on FreeBSD and OpenBSD)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View file

@ -9,7 +9,8 @@
"es": "Un sistema de Wiki de uso sencillicimo y compatible con los estándares.", "es": "Un sistema de Wiki de uso sencillicimo y compatible con los estándares.",
"it": "Un Wiki aderente agli standard, semplice da usare, finalizzato principalmente alla creazione di documentazione di qualsiasi tipo." "it": "Un Wiki aderente agli standard, semplice da usare, finalizzato principalmente alla creazione di documentazione di qualsiasi tipo."
}, },
"version": "2018-04-22b~ynh2",
"version": "2020-07-29~ynh4",
"url": "https://www.dokuwiki.org", "url": "https://www.dokuwiki.org",
"license": "GPL-2.0-or-later", "license": "GPL-2.0-or-later",
"maintainer": { "maintainer": {
@ -22,7 +23,7 @@
"email": "opi@zeropi.net" "email": "opi@zeropi.net"
}], }],
"requirements": { "requirements": {
"yunohost": ">= 3.7" "yunohost": ">= 4.1.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -63,10 +64,10 @@
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": { "ask": {
"en": "Is it a public DokuWiki site ?", "en": "Is it a public DokuWiki site?",
"fr": "Est-ce un site public ?" "fr": "Est-ce un site public ?"
}, },
"default": "true" "default": true
}, },
{ {
"name": "language", "name": "language",

View file

@ -4,6 +4,11 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
YNH_PHP_VERSION="7.3"
extra_php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-gd"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================

View file

@ -19,40 +19,40 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# STANDARD BACKUP STEPS # DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up nginx web server 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 # BACKUP THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up php-fpm configuration..." --weight=2
ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#================================================= #=================================================
# BACKUP FAIL2BAN CONFIGURATION # BACKUP FAIL2BAN CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up fail2ban configuration..."
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
@ -61,4 +61,4 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -50,23 +50,23 @@ fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
# Change the path in the nginx config file # Change the path in the NGINX config file
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
then then
# Make a backup of the original nginx config file if modified # Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path" ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Set global variables for nginx helper # Set global variables for NGINX helper
domain="$old_domain" domain="$old_domain"
path_url="$new_path" path_url="$new_path"
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
fi fi
# Change the domain for nginx # Change the domain for NGINX
if [ $change_domain -eq 1 ] if [ $change_domain -eq 1 ]
then then
# Delete file checksum for the old conf file location # Delete file checksum for the old conf file location
@ -81,7 +81,7 @@ fi
#================================================= #=================================================
# UPGRADE FAIL2BAN # UPGRADE FAIL2BAN
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring fail2ban..." --weight=6 ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=6
ynh_add_fail2ban_config --logpath="/var/log/nginx/$new_domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $new_path.*$" --max_retry=5 ynh_add_fail2ban_config --logpath="/var/log/nginx/$new_domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $new_path.*$" --max_retry=5
@ -90,7 +90,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$new_domain-error.log" --failr
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -62,9 +62,9 @@ ynh_setup_source --dest_dir="$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." --weight=2 ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
@ -78,17 +78,18 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring php-fpm..." --weight=2 ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicated php-fpm config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# CUSTOMIZE DOKUWIKI # CUSTOMIZE DOKUWIKI
#================================================= #=================================================
ynh_script_progression --message="Configuring dokuwiki..." --weight=2 ynh_script_progression --message="Configuring DokuWiki..." --weight=2
# Loading order of configuration files # Loading order of configuration files
# #
@ -101,8 +102,8 @@ ynh_script_progression --message="Configuring dokuwiki..." --weight=2
# See https://www.dokuwiki.org/plugin:config#protecting_settings # See https://www.dokuwiki.org/plugin:config#protecting_settings
### Copy Yunohost specific configuration ### Copy YunoHost specific configuration
# This File cannot be modified directly by Dokuwiki, only by hand or by Yunohost # 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 # It will only be updated by Yunohost package or directly by adventurous users
cp ../conf/local.protected.php $final_path/conf cp ../conf/local.protected.php $final_path/conf
@ -114,7 +115,7 @@ ynh_permission_create --permission "admin" --allowed "$admin_user"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/conf/local.protected.php" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/conf/local.protected.php"
# This file might be modified by dokuwiki admin panel or by plugins # This file might be modified by DokuWiki admin panel or by plugins
# It will not be modified by Yunohost in order to keep user settings # It will not be modified by Yunohost in order to keep user settings
cp ../conf/local.php $final_path/conf cp ../conf/local.php $final_path/conf
@ -161,7 +162,7 @@ ynh_store_file_checksum --file="$final_path/conf/local.protected.php"
#================================================= #=================================================
# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN # INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN
#================================================= #=================================================
ynh_script_progression --message="Installing logautherror plugin for fail2ban..." --weight=2 ynh_script_progression --message="Installing logautherror plugin for Fail2Ban..." --weight=2
ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror
@ -211,7 +212,7 @@ find $final_path/lib -type d -print0 | xargs -0 chmod 0755
#================================================= #=================================================
# SETUP FAIL2BAN # SETUP FAIL2BAN
#================================================= #=================================================
ynh_script_progression --message="Configuring fail2ban..." --weight=7 ynh_script_progression --message="Configuring Fail2Ban..." --weight=7
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5 ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5
@ -231,7 +232,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -32,23 +32,23 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing nginx web server configuration..." ynh_script_progression --message="Removing NGINX web server configuration..."
# Remove the dedicated nginx config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#================================================= #=================================================
# REMOVE PHP-FPM CONFIGURATION # REMOVE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing php-fpm configuration..." --weight=2 ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2
# Remove the dedicated php-fpm config # Remove the dedicated PHP-FPM config
ynh_remove_fpm_config ynh_remove_fpm_config
#================================================= #=================================================
# REMOVE FAIL2BAN CONFIGURATION # REMOVE FAIL2BAN CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing fail2ban configuration..." --weight=7 ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=7
ynh_remove_fail2ban_config ynh_remove_fail2ban_config

View file

@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
@ -88,13 +89,16 @@ chown -R $app:root $final_path/lib/tpl
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5
ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
# RESTORE FAIL2BAN CONFIGURATION # RESTORE FAIL2BAN CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the fail2ban configuration..." --weight=7 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/jail.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
@ -105,9 +109,9 @@ ynh_systemd_action --action=restart --service_name=fail2ban
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=2 ynh_script_progression --message="Reloading NGINX web server and PHP-FPM.." --weight=2
ynh_systemd_action --service_name=php7.0-fpm --action=reload ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -43,6 +44,7 @@ if [ -z "$language" ]; then
ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=language --value=$language
fi fi
# Cleaning legacy permissions # Cleaning legacy permissions
admin_user=$(ynh_app_setting_get --app=$app --key=admin) admin_user=$(ynh_app_setting_get --app=$app --key=admin)
@ -83,7 +85,7 @@ fi
# Yunohost specific configuration, if it isn't exist already # Yunohost specific configuration, if it isn't exist already
# Previously, these settings were store in an unique "dokuwiki.php" # Previously, these settings were store in an unique "dokuwiki.php"
# Now, they are split in multiple files to ease upgrading process (separate Yunohost config from user config) # Now, they are split in multiple files to ease upgrading process (separate YunoHost config from user config)
# Loading order of configuration files # Loading order of configuration files
# #
@ -169,13 +171,6 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path --path_url=$path_url)
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -193,9 +188,9 @@ fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
@ -209,10 +204,10 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading php-fpm configuration..." ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated php-fpm config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -220,7 +215,7 @@ ynh_add_fpm_config
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading dokuwiki..." --weight=7 ynh_script_progression --message="Upgrading DokuWiki..." --weight=7
# Remove upgrade notification inside Dokuwiki's admin panel # Remove upgrade notification inside Dokuwiki's admin panel
# See https://www.dokuwiki.org/update_check # See https://www.dokuwiki.org/update_check
@ -305,7 +300,7 @@ ynh_store_file_checksum --file="$final_path/conf/local.protected.php"
#================================================= #=================================================
# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN # INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN
#================================================= #=================================================
ynh_script_progression --message="Upgrading logautherror plugin for fail2ban..." --weight=2 ynh_script_progression --message="Upgrading logautherror plugin for Fail2Ban..." --weight=2
ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror
@ -355,7 +350,7 @@ find $final_path/lib -type d -print0 | xargs -0 chmod 0755
#================================================= #=================================================
# SETUP FAIL2BAN # SETUP FAIL2BAN
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring fail2ban..." --weight=7 ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=7
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5 ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5
@ -368,7 +363,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB