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

First release

Added choice for data base engine
Protected password special chars before calling curl. Should it be extended to any parameter ?
Keeping all files in config across upgrade, as there may be extra personnal files (exports for example). Is it the proper way ?
This commit is contained in:
AlainCas 2024-07-19 22:22:37 +02:00
parent 36a646172c
commit 9fdf008dbc
2 changed files with 4 additions and 15 deletions

View file

@ -27,7 +27,8 @@ chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# DATA BASE CREATION (not done via ressources_database
# DATA BASE CREATION
# as we want to choose the database engine, we cannot rely on manifest to do this
#=================================================
ynh_script_progression --message="créating data base for $app..." --weight=1
db_name=$(ynh_sanitize_dbid --db_name=$app)
@ -57,19 +58,6 @@ ynh_add_nginx_config
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# SPECIFIC SETUP
#=================================================
# ADD A CONFIGURATION
# suppress to let galette create it it's proper way
#=================================================
#ynh_script_progression --message="Adding a configuration file..." --weight=1
#ynh_add_config --template="config.inc.php" --destination="$install_dir/galette/config/config.inc.php"
#chmod 400 "$install_dir/galette/config/config.inc.php"
#chown $app:$app "$install_dir/galette/config/config.inc.php"
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
@ -89,6 +77,7 @@ ynh_local_curl "/installer.php" "install_type=i"
ynh_local_curl "/installer.php" "install_dbtype=$db_type" "install_dbhost=localhost" "install_dbport=$db_port" "install_dbuser=$db_user" "install_dbpass=$db_pwd" "install_dbname=$db_name" "install_dbprefix=$tb_prefix"
ynh_local_curl "/installer.php" "install_dbperms_ok=1"
ynh_local_curl "/installer.php" "install_dbwrite_ok=1"
password=`jq -Rj @uri <<<$password` #to escape special characters that may appear in a password
ynh_local_curl "/installer.php" "install_adminlogin=$admin" "install_adminpass=$password" "install_adminpass_verif=$password"
ynh_local_curl "/installer.php" "install_telemetry_ok=1"
ynh_local_curl "/installer.php" "install_prefs_ok=1"

View file

@ -20,7 +20,7 @@ timezone="$(cat /etc/timezone)"
#=================================================
ynh_script_progression --message="Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir" --keep="galette/config/config.inc.php galette/data galette/plugins"
ynh_setup_source --dest_dir="$install_dir" --keep="galette/config galette/data galette/plugins"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"