1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galette_ynh.git synced 2024-09-03 18:36:28 +02:00

add config file

This commit is contained in:
ericgaspar 2021-01-05 23:55:50 +01:00
parent 4c987cd43e
commit 68e37ff53c
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 64 additions and 17 deletions

25
conf/config.inc.php.dist Normal file
View file

@ -0,0 +1,25 @@
<?php
/*
This is an example for your configuration file,
read comments and replace the "blanks".
You can then copy the file in GALETTE_CONFIG_PATH/config.inc.php
$Id$
*/
/* choose your database engine, values : pgsql|mysql */
define("TYPE_DB", "mysql");
/* hostname for the database */
define("HOST_DB", "localhost");
/* tcp port for the database */
define("PORT_DB", "3306");
/* the username for the database */
define("USER_DB", "__DBNAME__");
/* password for the username define above */
define("PWD_DB", "__DBPASSWORD__");
/* the database name */
define("NAME_DB", "__DBNAME__");
/* tables name prefix (default is galette_) */
define("PREFIX_DB", "galette_");
/* FIXME will disappear soon */
define("STOCK_FILES", "tempimages");

View file

@ -67,7 +67,7 @@ ynh_setup_source --dest_dir="$final_path"
mv "$final_path"/galette/* "$final_path"/
ynh_secure_remove "$final_path"/tests
chown -R root:root "$final_path"
chown -R root: "$final_path"
#=================================================
# NGINX CONFIGURATION
@ -94,6 +94,17 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CONFIGURE GALETTE
#=================================================
ynh_script_progression --message="Configuring Galette..." --weight=1
cp ../conf/config.inc.php.dist "$final_path/config/config.inc.php"
# Change variables in Castopod configuration
ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config/config.inc.php"
ynh_replace_string --match_string="__DBPASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/config/config.inc.php"
#=================================================
# GENERIC FINALIZATION
#=================================================
@ -120,24 +131,35 @@ ynh_use_logrotate
# SETUP SSOWAT
#=================================================
if [[ "$path_url" == "/" ]]
then
# ynh panel is only comptable with non-root installation
ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
else
ynh_replace_string "^#sub_path_only" "" "$finalnginxconf"
fi
ynh_store_file_checksum "$finalnginxconf"
# if [[ "$path_url" == "/" ]]
# then
# # ynh panel is only comptable with non-root installation
# ynh_replace_string " include conf.d/" " #include conf.d/" "$finalnginxconf"
# else
# ynh_replace_string "^#sub_path_only" "" "$finalnginxconf"
# fi
# ynh_store_file_checksum "$finalnginxconf"
if [ "$is_public" -eq 0 ]
then # Remove the public access
ynh_app_setting_delete "$app" skipped_uris
fi
# Make app public if necessary
if [ "$is_public" -eq 1 ]
# if [ "$is_public" -eq 0 ]
# then # Remove the public access
# ynh_app_setting_delete "$app" skipped_uris
# fi
# # Make app public if necessary
# if [ "$is_public" -eq 1 ]
# then
# # unprotected_uris allows SSO credentials to be passed anyway.
# ynh_app_setting_set "$app" skipped_uris "/"
# fi
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1
# Make app public if necessary or protect it
if [ $is_public -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set "$app" skipped_uris "/"
ynh_permission_update --permission "main" --add "visitors"
fi
#=================================================