1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/acropolis_ynh.git synced 2024-09-03 18:06:22 +02:00

Remove not used secret_key_base

This commit is contained in:
yalh76 2022-07-15 15:37:06 +02:00
parent 5740935db9
commit c80c2f2cf4
2 changed files with 1 additions and 16 deletions

View file

@ -155,9 +155,6 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
database_yml="$final_path/config/database.yml" database_yml="$final_path/config/database.yml"
diaspora_toml="$final_path/config/diaspora.toml" diaspora_toml="$final_path/config/diaspora.toml"
secret_key_base=$(ynh_string_random --length=128)
ynh_app_setting_set --app="$app" --key=secret_key_base --value="$secret_key_base"
ynh_add_config --template="../conf/database_yml.example" --destination="$database_yml" ynh_add_config --template="../conf/database_yml.example" --destination="$database_yml"
ynh_add_config --template="../conf/diaspora_toml.example" --destination="$diaspora_toml" ynh_add_config --template="../conf/diaspora_toml.example" --destination="$diaspora_toml"

View file

@ -24,7 +24,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$(ynh_app_setting_get --app=$app --key=db_user) db_user=$(ynh_app_setting_get --app=$app --key=db_user)
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
port_web=$(ynh_app_setting_get --app=$app --key=port_web) port_web=$(ynh_app_setting_get --app=$app --key=port_web)
secret_key_base=$(ynh_app_setting_get --app=$app --key=secret_key_base)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -85,17 +84,9 @@ if [[ -z "$db_pwd" ]]; then
ynh_replace_string --match_string="DB_PASS=" --replace_string="DB_PASS=${db_pwd}" --target_file="$config" ynh_replace_string --match_string="DB_PASS=" --replace_string="DB_PASS=${db_pwd}" --target_file="$config"
fi fi
# If secret_key_base doesn't exist, retrieve it or create it
if [[ -z "$secret_key_base" ]]; then
secret_key_base=$(grep -oP "SECRET_KEY_BASE=\K\w+" $config)
if [[ -z "$secret_key_base" ]]; then
secret_key_base=$(ynh_string_random --length=128)
fi
ynh_app_setting_set --app=$app --key=secret_key_base --value="$secret_key_base"
fi
ynh_remove_extra_repo ynh_remove_extra_repo
ynh_app_setting_delete --app=$app --key=redis_namespace ynh_app_setting_delete --app=$app --key=redis_namespace
ynh_app_setting_delete --app=$app --key=secret_key_base
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -158,9 +149,6 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1
database_yml="$final_path/config/database.yml" database_yml="$final_path/config/database.yml"
diaspora_toml="$final_path/config/diaspora.toml" diaspora_toml="$final_path/config/diaspora.toml"
secret_key_base=$(ynh_string_random --length=128)
ynh_app_setting_set --app="$app" --key=secret_key_base --value="$secret_key_base"
ynh_add_config --template="../conf/database_yml.example" --destination="$database_yml" ynh_add_config --template="../conf/database_yml.example" --destination="$database_yml"
ynh_add_config --template="../conf/diaspora_toml.example" --destination="$diaspora_toml" ynh_add_config --template="../conf/diaspora_toml.example" --destination="$diaspora_toml"