1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00
This commit is contained in:
Éric Gaspar 2023-10-02 14:42:33 +02:00
parent 61dc979167
commit 0c49aabfb1
3 changed files with 47 additions and 13 deletions

32
conf/conf.php Normal file
View file

@ -0,0 +1,32 @@
$dolibarr_main_document_root="/home/www/dolibarr/htdocs";
$dolibarr_main_url_root="http://__DOMAIN____PATH__";
$dolibarr_main_db_type="mysql";
$dolibarr_main_db_host="localhost";
$dolibarr_main_db_port="3306";
$dolibarr_main_db_name="__DB_NAME__";
$dolibarr_main_db_user="__DB_USER__";
$dolibarr_main_db_pass="__DB_PWD__";
// Authentication settings
//$dolibarr_main_authentication='dolibarr';
$dolibarr_main_authentication='ldap,dolibarr';
$dolibarr_main_auth_ldap_host='ldap:localhost';
$dolibarr_main_auth_ldap_port='389';
$dolibarr_main_auth_ldap_version='3';
$dolibarr_main_auth_ldap_servertype='openldap';
$dolibarr_main_auth_ldap_login_attribute='uid'; // Ex: uid or samaccountname for active directory
$dolibarr_main_auth_ldap_dn='ou=users,dc=yunohost,dc=org';
$dolibarr_main_auth_ldap_filter = '&(objectClass=posixAccount)';
//$dolibarr_main_auth_ldap_admin_login='uid=admin,dc=yunohost,dc=org';
//$dolibarr_main_auth_ldap_admin_pass='secret';
//$dolibarr_main_auth_ldap_debug='false';

View file

@ -48,7 +48,7 @@ ram.runtime = "50M"
[resources.install_dir]
[resources.data_dir]
#[resources.data_dir]
[resources.permissions]
main.url = "/"

View file

@ -77,7 +77,9 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/install.forced.php" --destination="$install_dir/htdocs/install/install.forced.php"
ynh_add_config --template="../conf/conf.php" --destination="$install_dir/htdocs/conf/conf.php"
#ynh_add_config --template="../conf/install.forced.php" --destination="$install_dir/htdocs/install/install.forced.php"
#=================================================
# SETUP APPLICATION WITH CURL
@ -131,26 +133,26 @@ ynh_local_curl "/install/step5.php" \
ynh_exec_fully_quiet sleep 5
ynh_script_progression --message="configuring LDAP" --weight=1
#ynh_script_progression --message="configuring LDAP" --weight=1
# Populate the LDAP parameters
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/ldap.sql
# # Populate the LDAP parameters
# ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/ldap.sql
# Populate the database with YNH users.
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/ldap_user.sql
# # Populate the database with YNH users.
# ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/ldap_user.sql
if php$phpversion $install_dir/scripts/user/sync_users_ldap2dolibarr.php commitiferror --server=localhost -y; then
ynh_print_info --message="LDAP user update ok"
else
ynh_print_info --message="LDAP user update ended with error"
fi
# if php$phpversion $install_dir/scripts/user/sync_users_ldap2dolibarr.php commitiferror --server=localhost -y; then
# ynh_print_info --message="LDAP user update ok"
# else
# ynh_print_info --message="LDAP user update ended with error"
# fi
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="configuring config file" --weight=1
# Setup HTTP auth in conf
ynh_script_progression --message="configuring config file" --weight=1
ynh_replace_string --match_string="dolibarr_main_authentication='dolibarr'" --replace_string="dolibarr_main_authentication='http'" --target_file="$install_dir/htdocs/conf/conf.php"
#=================================================