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

Fixes for Apple Pay integration

This commit is contained in:
tituspijean 2024-04-09 19:58:45 +02:00
parent 99ee6e8d88
commit 6c6c76a954
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
2 changed files with 14 additions and 8 deletions

View file

@ -10,4 +10,4 @@ name = "Ghost configuration"
ask = "Upload the apple-developer-merchantid-domain-association file"
type = "file"
help = "It is provided by Stripe"
bind = "__INSTALL_DIR__/apple_pay.__APP__.conf"
bind = "__INSTALL_DIR__/apple-developer-merchantid-domain-association"

View file

@ -11,29 +11,35 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
domain=$(ynh_app_setting_get --app=$app --key=domain)
#=================================================
# OVERWRITING VALIDATE STEP
#=================================================
ynh_app_config_apply() {
_ynh_app_config_apply
if [ -f $install_dir/apple-developer-merchantid-domain-association ]
then
ynh_add_config --template="apple_pay.conf" --destination="/etc/nginx/conf.d/$domain.d/apple_pay.$app.conf"
if [ ! ynh_permission_exists --permission="$app.apple_pay" ]; then
ynh_permission_create --permission="$app.apple_pay" --url="$domain/.well-known/apple-developer-merchantid-domain-association" --allowed=visitors --protected --auth_header=false
if ! ynh_permission_exists --permission="apple_pay"; then
ynh_permission_create --permission="apple_pay" --url="$domain/.well-known/apple-developer-merchantid-domain-association" --allowed=visitors --protected --auth_header=false
fi
else
ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/apple_pay.$app.conf"
if [ ynh_permission_exists --permission="$app.apple_pay" ]; then
ynh_permission_delete --permission="$app.apple_pay"
if ynh_permission_exists --permission="apple_pay"; then
ynh_permission_delete --permission="apple_pay"
fi
fi
ynh_systemd_action --service_name=nginx --action=reload
_ynh_app_config_apply
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run $1
ynh_app_config_run "$1"