mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
removing vapid_private_key
This commit is contained in:
parent
9719db911b
commit
750402c9c2
1 changed files with 10 additions and 10 deletions
|
@ -243,16 +243,16 @@ pushd "$final_path/live"
|
|||
popd
|
||||
|
||||
# If vapid_private_key doesn't exist, retrieve it or create it
|
||||
if [[ -z "$vapid_private_key" ]]; then
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
|
||||
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" "$final_path/live/key.txt")
|
||||
vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" "$final_path/live/key.txt")
|
||||
ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key"
|
||||
ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
|
||||
ynh_secure_remove "$final_path/live/key.txt"
|
||||
ynh_replace_string "__VAPID_PRIVATE_KEY__" "$vapid_private_key" "${final_path}/live/.env.production"
|
||||
ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "${final_path}/live/.env.production"
|
||||
fi
|
||||
#if [[ -z "$vapid_private_key" ]]; then
|
||||
# sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
|
||||
# vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" "$final_path/live/key.txt")
|
||||
# vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" "$final_path/live/key.txt")
|
||||
# ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key"
|
||||
# ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
|
||||
# ynh_secure_remove "$final_path/live/key.txt"
|
||||
# ynh_replace_string "__VAPID_PRIVATE_KEY__" "$vapid_private_key" "${final_path}/live/.env.production"
|
||||
# ynh_replace_string "__VAPID_PUBLIC_KEY__" "$vapid_public_key" "${final_path}/live/.env.production"
|
||||
#fi
|
||||
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum "${final_path}/live/.env.production"
|
||||
|
|
Loading…
Add table
Reference in a new issue