From 8ef998c9cff8cecbb02d5c897d8ce9746346c6e4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 15:44:13 +0100 Subject: [PATCH] Update install --- scripts/install | 55 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index cc4085a..ed3548e 100644 --- a/scripts/install +++ b/scripts/install @@ -121,35 +121,58 @@ mkdir -p "$datadir/data/attachments" # MODIFY A CONFIG FILE #================================================= -cp ../conf/app.ini "$final_path/custom/conf" if [ "$path_url" = "/" ] then - ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" + url="$domain" else - ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url}" --target_file="$final_path/custom/conf/app.ini" + url="$domain${path_url}" fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" - if [[ "$is_public" = '1' ]] then - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" + private_mode="false" else - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" + private_mode="true" fi +ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini" + +chmod 400 "$final_path/custom/conf/app.ini" +chown $app:$app "$final_path/custom/conf/app.ini" + + + + +# cp ../conf/app.ini "$final_path/custom/conf" + +# if [ "$path_url" = "/" ] +# then +# ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +# else +# ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url}" --target_file="$final_path/custom/conf/app.ini" +# fi + +# ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" + +# if [[ "$is_public" = '1' ]] +# then +# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" +# else +# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" +# fi + ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" -ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" +#ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" # Configure init script ynh_add_systemd_config