mirror of
https://github.com/YunoHost-Apps/dokuwiki_ynh.git
synced 2024-09-03 18:26:20 +02:00
[enh] Add variable to handle authentication backend
This commit is contained in:
parent
9a7646cfb7
commit
854ba9417c
3 changed files with 30 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* This file is used for configuration settings which cannot be modified by Dokuwiki admin panel
|
* This file is used for configuration settings which cannot be modified by Dokuwiki admin panel
|
||||||
* See here for explanations : https://www.dokuwiki.org/config
|
* See here for explanations : https://www.dokuwiki.org/config
|
||||||
*
|
*
|
||||||
* Yunohost dedicated settings are stored here in order to be able to upgrade the Yunohost package safely latter for Yunohost packager ( Yeah \o/ )
|
* Yunohost dedicated settings are stored here in order to be able to upgrade the Yunohost package safely latter for Yunohost packager ( Yeah \o/ )
|
||||||
*
|
*
|
||||||
* You should not modify this file direclty as it will be overwritten by Yunohost package
|
* You should not modify this file direclty as it will be overwritten by Yunohost package
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/* Authentication Settings */
|
/* Authentication Settings */
|
||||||
$conf['useacl'] = 1; //Use Access Control Lists to restrict access?
|
$conf['useacl'] = 1; //Use Access Control Lists to restrict access?
|
||||||
$conf['authtype'] = 'authldap'; //which authentication backend should be used
|
$conf['authtype'] = '__YNH_AUTH_BACKEND__'; //which authentication backend should be used
|
||||||
$conf['passcrypt'] = 'sha1'; //Used crypt method (smd5,md5,sha1,ssha,crypt,mysql,my411)
|
$conf['passcrypt'] = 'sha1'; //Used crypt method (smd5,md5,sha1,ssha,crypt,mysql,my411)
|
||||||
$conf['superuser'] = '__YNH_ADMIN_USER__'; //The admin can be user or @group or comma separated list user1,@group1,user2
|
$conf['superuser'] = '__YNH_ADMIN_USER__'; //The admin can be user or @group or comma separated list user1,@group1,user2
|
||||||
$conf['manager'] = '__YNH_ADMIN_USER__'; //The manager can be user or @group or comma separated list user1,@group1,user2
|
$conf['manager'] = '__YNH_ADMIN_USER__'; //The manager can be user or @group or comma separated list user1,@group1,user2
|
||||||
|
|
|
@ -53,6 +53,17 @@ ynh_app_setting_set $app admin $admin
|
||||||
ynh_app_setting_set $app is_public $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
ynh_app_setting_set $app language $language
|
ynh_app_setting_set $app language $language
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# STORE DEFAULT VALUES FOR "ACTION SCRIPTS"
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Needed for "upgrade" to know which backend to set back after overwriting "local.protected.php"
|
||||||
|
# Can be changed by action script "internal_users"
|
||||||
|
auth_backend='authldap' # Default backend is LDAP with Yunohost, 'authldap' for DokuWiki
|
||||||
|
ynh_app_setting_set $app auth_backend $auth_backend
|
||||||
|
# Disable the 'is_internal_users' feature
|
||||||
|
ynh_app_setting_set $app is_internal_users 0
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -111,22 +122,24 @@ ynh_print_info "Configuring dokuwiki..."
|
||||||
# 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
|
||||||
|
|
||||||
|
# Set the authentification backend
|
||||||
|
ynh_replace_string "__YNH_AUTH_BACKEND__" "$auth_backend" "$final_path/conf/local.protected.php"
|
||||||
# Set the "admin" user
|
# Set the "admin" user
|
||||||
ynh_replace_string "__YNH_ADMIN_USER__" "$admin" "$final_path/conf/local.protected.php"
|
ynh_replace_string "__YNH_ADMIN_USER__" "$admin" "$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
|
||||||
|
|
||||||
# Set the "language"
|
# Set the "language"
|
||||||
ynh_replace_string "__YNH_LANGUAGE__" "$language" "$final_path/conf/local.php"
|
ynh_replace_string "__YNH_LANGUAGE__" "$language" "$final_path/conf/local.php"
|
||||||
|
|
||||||
|
|
||||||
# Restrict user rights by enforcing "read-only" mode for all users
|
# Restrict user rights by enforcing "read-only" mode for all users
|
||||||
# See https://www.dokuwiki.org/acl#background_info
|
# See https://www.dokuwiki.org/acl#background_info
|
||||||
# Default is "8"
|
# Default is "8"
|
||||||
cp ../conf/acl.auth.php $final_path/conf
|
cp ../conf/acl.auth.php $final_path/conf
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEFAULT FILES
|
# CREATE DEFAULT FILES
|
||||||
|
|
|
@ -22,6 +22,9 @@ admin=$(ynh_app_setting_get $app admin)
|
||||||
is_public=$(ynh_app_setting_get $app is_public)
|
is_public=$(ynh_app_setting_get $app is_public)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
|
auth_backend=$(ynh_app_setting_get $app auth_backend)
|
||||||
|
#is_internal_users=$(ynh_app_setting_get $app is_internal_users)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -55,6 +58,11 @@ if [ -z "$language" ]; then
|
||||||
ynh_app_setting_set $app language $language
|
ynh_app_setting_set $app language $language
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 'is_internal_users' default value, if not set
|
||||||
|
if [ -z "$is_internal_users" ]; then
|
||||||
|
ynh_app_setting_set $app is_internal_users 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Yunohost specific configuration, if it isn't exist already
|
# Yunohost specific configuration, if it isn't exist already
|
||||||
|
@ -233,8 +241,10 @@ ynh_backup_if_checksum_is_different "$final_path/conf/local.protected.php"
|
||||||
# Always overwrite local file with the one from package.
|
# Always overwrite local file with the one from package.
|
||||||
cp ../conf/local.protected.php $final_path/conf
|
cp ../conf/local.protected.php $final_path/conf
|
||||||
|
|
||||||
|
# Set the authentification backend
|
||||||
|
ynh_replace_string "__YNH_AUTH_BACKEND__" "$auth_backend" "$final_path/conf/local.protected.php"
|
||||||
# Set the "admin" user
|
# Set the "admin" user
|
||||||
ynh_replace_string "__YNH_ADMIN_USER__" "$admin" "$final_path/conf/local.protected.php"
|
ynh_replace_string "__YNH_ADMIN_USER__" "$admin" "$final_path/conf/local.protected.php"
|
||||||
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
ynh_store_file_checksum "$final_path/conf/local.protected.php"
|
ynh_store_file_checksum "$final_path/conf/local.protected.php"
|
||||||
|
|
Loading…
Add table
Reference in a new issue