1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00
This commit is contained in:
Éric Gaspar 2023-06-05 23:36:32 +02:00
parent e7f23ed569
commit 84e154099c
4 changed files with 26 additions and 37 deletions

View file

@ -92,3 +92,12 @@ error_reporting(E_ERROR | E_WARNING | E_PARSE );
ini_set('error_log','php.log'); ini_set('error_log','php.log');
ini_set('log_errors','1'); ini_set('log_errors','1');
ini_set('display_errors', '0'); ini_set('display_errors', '0');
App::$config['system']['addon'] = 'ldapauth';
App::$config['ldapauth']['ldap_server'] = 'localhost';
App::$config['ldapauth']['ldap_searchdn'] = 'ou=users,dc=yunohost,dc=org';
App::$config['ldapauth']['ldap_userattr'] = 'uid';
App::$config['ldapauth']['ldap_autocreateaccount_emailattribute'] = 'mail';
App::$config['ldapauth']['create_account'] = '1';

View file

@ -1,7 +0,0 @@
App::$config['system']['addon'] = 'ldapauth';
App::$config['ldapauth']['ldap_server'] = 'localhost';
App::$config['ldapauth']['ldap_searchdn'] = 'ou=users,dc=yunohost,dc=org';
App::$config['ldapauth']['ldap_userattr'] = 'uid';
App::$config['ldapauth']['ldap_autocreateaccount_emailattribute'] = 'mail';
App::$config['ldapauth']['create_account'] = '1';

View file

@ -36,11 +36,6 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
#================================================= #=================================================
# CREATE A DATABASE # CREATE A DATABASE
#================================================= #=================================================
#=================================================
# CREATE A MYSQL DATABASE
#=================================================
ynh_script_progression --message="Creating a database..." --weight=2 ynh_script_progression --message="Creating a database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
@ -109,10 +104,6 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/htconfig.sample.php" --destination="$install_dir/.htconfig.php" ynh_add_config --template="../conf/htconfig.sample.php" --destination="$install_dir/.htconfig.php"
# addon ldap config
ynh_script_progression --message="Push LDAP configuration to .htconfig.php..."
cat ../conf/ldap_conf.php >> $install_dir/.htconfig.php
ynh_store_file_checksum --file=$install_dir/.htconfig.php ynh_store_file_checksum --file=$install_dir/.htconfig.php
chmod 600 "$install_dir/.htconfig.php" chmod 600 "$install_dir/.htconfig.php"

View file

@ -93,31 +93,27 @@ ynh_add_nginx_config
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1 # ynh_script_progression --message="Updating a configuration file..." --weight=1
if [ $database = "mysql" ]; then # if [ $database = "mysql" ]; then
db_type=0 # db_type=0
db_name=$(ynh_sanitize_dbid --db_name=$app) # db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name # db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) # db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
# Change your databases character set and collation # # Change your databases character set and collation
ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ # ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \
<<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" # <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
elif [ $database = "postgresql" ]; then # elif [ $database = "postgresql" ]; then
db_type=1 # db_type=1
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) # db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
fi # fi
ynh_add_config --template="../conf/htconfig.sample.php" --destination="$install_dir/.htconfig.php" # ynh_add_config --template="../conf/htconfig.sample.php" --destination="$install_dir/.htconfig.php"
# addon ldap config # ynh_store_file_checksum --file=$install_dir/.htconfig.php
ynh_script_progression --message="Push LDAP configuration to .htconfig.php..."
cat ../conf/ldap_conf.php >> $install_dir/.htconfig.php # chmod 600 "$install_dir/.htconfig.php"
ynh_store_file_checksum --file=$install_dir/.htconfig.php # chown $app:$app "$install_dir/.htconfig.php"
chmod 600 "$install_dir/.htconfig.php"
chown $app:$app "$install_dir/.htconfig.php"
#================================================= #=================================================
# UPGRADE CRON JOB # UPGRADE CRON JOB