diff --git a/conf/config-subdomain.php b/conf/config-subdomain.php new file mode 100644 index 0000000..923fdd4 --- /dev/null +++ b/conf/config-subdomain.php @@ -0,0 +1,27 @@ + 'https://__DOMAIN__', + 'db' => array ( + 'connection' => 'mysql', + 'dsn' => 'host=localhost;port=3306;dbname=__DB_NAME__', + 'username' => '__DB_NAME__', + 'password' => '__DB_PWD__', + ), + + 'storage' => array( + 'driver' => 'local', + 'path' => '__DATA_DIR__', + ), + + 'ldap' => array( + 'enabled' => true, + 'schema' => 'ldap', + 'host' => 'ldap://127.0.0.1', + 'port' => 389, + 'base_domain' => 'dc=yunohost,dc=org', + 'search_filter' => '(&(|(objectclass=posixAccount))(uid={{username}})(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))', + 'user_domain' => 'ou=Users', + 'rdn_attribute' => 'uid=', + ), +); diff --git a/conf/config.php b/conf/config-withpath.php similarity index 100% rename from conf/config.php rename to conf/config-withpath.php diff --git a/scripts/install b/scripts/install index 28274c0..fda7377 100755 --- a/scripts/install +++ b/scripts/install @@ -41,7 +41,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php" +if "$path" == "/" then ynh_add_config --template="../conf/config-subdomain.php" --destination="$install_dir/config.php" else ynh_add_config --template="../conf/config-withpath.php" chmod 400 "$install_dir/config.php" chown $app:$app "$install_dir/config.php"