diff --git a/conf/htconfig.sample.php b/conf/htconfig.sample.php index af51076b..bcbf4551 100644 --- a/conf/htconfig.sample.php +++ b/conf/htconfig.sample.php @@ -92,3 +92,12 @@ error_reporting(E_ERROR | E_WARNING | E_PARSE ); ini_set('error_log','php.log'); ini_set('log_errors','1'); 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'; diff --git a/conf/ldap_conf.php b/conf/ldap_conf.php deleted file mode 100644 index a4688d69..00000000 --- a/conf/ldap_conf.php +++ /dev/null @@ -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'; diff --git a/scripts/install b/scripts/install index edaeb1dd..286d88ff 100755 --- a/scripts/install +++ b/scripts/install @@ -36,11 +36,6 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # CREATE A DATABASE #================================================= - - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= ynh_script_progression --message="Creating a database..." --weight=2 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" -# 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 chmod 600 "$install_dir/.htconfig.php" diff --git a/scripts/upgrade b/scripts/upgrade index 0d6242e7..407279ea 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -93,31 +93,27 @@ ynh_add_nginx_config #================================================= # 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 - db_type=0 - db_name=$(ynh_sanitize_dbid --db_name=$app) - db_user=$db_name - db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) - # Change your databases character set and collation - ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ - <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" -elif [ $database = "postgresql" ]; then - db_type=1 - db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) -fi +# if [ $database = "mysql" ]; then +# db_type=0 +# db_name=$(ynh_sanitize_dbid --db_name=$app) +# db_user=$db_name +# db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +# # Change your databases character set and collation +# ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ +# <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" +# elif [ $database = "postgresql" ]; then +# db_type=1 +# db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +# 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_script_progression --message="Push LDAP configuration to .htconfig.php..." +# ynh_store_file_checksum --file=$install_dir/.htconfig.php -cat ../conf/ldap_conf.php >> $install_dir/.htconfig.php -ynh_store_file_checksum --file=$install_dir/.htconfig.php - -chmod 600 "$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