1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/glitchsoc_ynh.git synced 2024-09-03 19:15:59 +02:00

Add missing configuration keys

This commit is contained in:
Salamandar 2024-07-01 13:51:09 +02:00
parent 8f77c664ce
commit 2732cc2d98
3 changed files with 26 additions and 2 deletions

View file

@ -284,3 +284,8 @@ MAX_VIDEO_SIZE=__MAX_VIDEO_SIZE__
# Units are in bytes # Units are in bytes
MAX_EMOJI_SIZE=__MAX_EMOJI_SIZE__ MAX_EMOJI_SIZE=__MAX_EMOJI_SIZE__
MAX_REMOTE_EMOJI_SIZE=__MAX_REMOTE_EMOJI_SIZE__ MAX_REMOTE_EMOJI_SIZE=__MAX_REMOTE_EMOJI_SIZE__
# Required by ActiveRecord encryption feature
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=__DB_DETERMINISTIC_KEY__
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=__DB_KEY_DERIVATION_SALT__
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=__DB_PRIMARY_KEY__

View file

@ -50,6 +50,15 @@ ynh_app_setting_set --app="$app" --key=secret_key_base --value="$secret_key_base
otp_secret=$(ynh_string_random --length=128) otp_secret=$(ynh_string_random --length=128)
ynh_app_setting_set --app="$app" --key=otp_secret --value="$otp_secret" ynh_app_setting_set --app="$app" --key=otp_secret --value="$otp_secret"
db_deterministic_key=$(ynh_string_random --length=32)
ynh_app_setting_set --app="$app" --key="db_deterministic_key" --value="$db_deterministic_key"
db_key_derivation_salt=$(ynh_string_random --length=32)
ynh_app_setting_set --app="$app" --key="db_key_derivation_salt" --value="$db_key_derivation_salt"
db_primary_key=$(ynh_string_random --length=32)
ynh_app_setting_set --app="$app" --key="db_primary_key" --value="$db_primary_key"
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
@ -132,7 +141,6 @@ pushd "$install_dir/live"
# This export might be removed in yunohost 12 # This export might be removed in yunohost 12
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install
echo "SAFETY_ASSURED=1">> "$config" echo "SAFETY_ASSURED=1">> "$config"
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:encryption:init
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate --quiet ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate --quiet
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:precompile --quiet ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:precompile --quiet
# Generate vapid keys # Generate vapid keys

View file

@ -44,6 +44,17 @@ if ynh_compare_current_package_version --comparison lt --version 2024.05.01~ynh1
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:encryption:init ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:encryption:init
fi fi
if [[ -z "${db_deterministic_key:-}" ]]; then
db_deterministic_key=$(ynh_string_random --length=32)
ynh_app_setting_set --app="$app" --key="db_deterministic_key" --value="$db_deterministic_key"
db_key_derivation_salt=$(ynh_string_random --length=32)
ynh_app_setting_set --app="$app" --key="db_key_derivation_salt" --value="$db_key_derivation_salt"
db_primary_key=$(ynh_string_random --length=32)
ynh_app_setting_set --app="$app" --key="db_primary_key" --value="$db_primary_key"
fi
#================================================= #=================================================
# ADD SWAP IF NEEDED # ADD SWAP IF NEEDED
#================================================= #=================================================