From 3ea23beb7408cc7924535831f5f922cd0b7bdb87 Mon Sep 17 00:00:00 2001 From: dschlueter Date: Wed, 6 May 2026 01:15:42 +0200 Subject: [PATCH] =?UTF-8?q?scripts:=20YunoHost=20post=5Fapp=5Fupgrade=20ho?= =?UTF-8?q?ok=20f=C3=BCr=20n8n-Proxy-Config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stellt my_webapp.conf nach yunohost app upgrade automatisch wieder her. Deploy: /etc/yunohost/hooks.d/post_app_upgrade/99-n8n-proxy Co-Authored-By: Claude Sonnet 4.6 --- scripts/yunohost-hook-restore-n8n-proxy.sh | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 scripts/yunohost-hook-restore-n8n-proxy.sh diff --git a/scripts/yunohost-hook-restore-n8n-proxy.sh b/scripts/yunohost-hook-restore-n8n-proxy.sh new file mode 100755 index 0000000..3a47619 --- /dev/null +++ b/scripts/yunohost-hook-restore-n8n-proxy.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# YunoHost post_app_upgrade hook +# Deploy to: /etc/yunohost/hooks.d/post_app_upgrade/99-n8n-proxy +# Permissions: chmod 700 +# +# Restores the n8n reverse-proxy location block in my_webapp.conf +# after a "yunohost app upgrade my_webapp" overwrites it. + +set -euo pipefail + +CONF=/etc/nginx/conf.d/n8n.linix.de.d/my_webapp.conf + +[[ -f "$CONF" ]] || exit 0 +grep -q 'proxy_pass' "$CONF" && exit 0 + +cat > "$CONF" << 'NGINX' +#sub_path_only rewrite ^/$ / permanent; +location / { + proxy_pass http://192.168.179.124:8088; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_read_timeout 300s; + proxy_send_timeout 300s; + client_max_body_size 50m; +} +NGINX + +nginx -t && systemctl reload nginx +echo "[n8n-proxy hook] nginx proxy config restored after my_webapp upgrade."