mirror of
https://github.com/YunoHost-Apps/grist_ynh.git
synced 2024-09-03 20:36:18 +02:00
Add session secret
This commit is contained in:
parent
d797e7d4c8
commit
20bff16b60
4 changed files with 21 additions and 1 deletions
|
@ -11,6 +11,7 @@ GRIST_DATA_DIR=__DATA_DIR__/docs/
|
|||
TYPEORM_DATABASE=__DATA_DIR__/home.db
|
||||
PORT=__PORT__
|
||||
GRIST_DEFAULT_EMAIL=__ADMIN_EMAIL__
|
||||
GRIST_SESSION_SECRET=__SESSION_SECRET__
|
||||
|
||||
# Authentication
|
||||
GRIST_FORWARD_AUTH_HEADER=Email
|
||||
|
|
|
@ -33,6 +33,8 @@ ynh_script_progression --message="Updating env configuration file..." --weight=1
|
|||
domain="$new_domain"
|
||||
path="$new_path"
|
||||
admin_email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||
session_secret=$(ynh_app_setting_get --app=$app --key=session_secret)
|
||||
ynh_add_config --template="default.env" --destination="$install_dir/default.env"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -9,6 +9,14 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
|
||||
#=================================================
|
||||
# INITIALIZE AND STORE SETTINGS
|
||||
#=================================================
|
||||
|
||||
session_secret=$(ynh_string_random --length=32)
|
||||
ynh_app_setting_set --app=$app --key=session_secret --value=$session_secret
|
||||
|
||||
#=================================================
|
||||
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
||||
#=================================================
|
||||
|
|
|
@ -12,7 +12,7 @@ source _common.sh
|
|||
source /usr/share/yunohost/helpers
|
||||
|
||||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||
|
||||
session_secret=$(ynh_app_setting_get --app=$app --key=session_secret)
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
|
@ -23,6 +23,15 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
||||
if [ -z "$session_secret" ]; then
|
||||
session_secret=$(ynh_string_random --length=32)
|
||||
ynh_app_setting_set --app=$app --key=session_secret --value=$session_secret
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue