chore(gluetun): Rework port forward

This commit is contained in:
Peter 2026-04-27 13:20:35 +02:00
parent bdeec6d819
commit 2b9630eb04
Signed by: Peter
SSH key fingerprint: SHA256:B5tYaxBExaDm74r1px9iVeZ6F/ZDiyiy9SbBqfZYrvg
2 changed files with 20 additions and 8 deletions

View file

@ -9,20 +9,26 @@ data:
VPN_TYPE: "wireguard"
VPN_PORT_FORWARDING: on
VPN_PORT_FORWARDING_PROVIDER: protonvpn
VPN_PORT_FORWARDING_UP_COMMAND: |
/bin/sh -c '
VPN_PORT_FORWARDING_UP_COMMAND: "/scripts/port-up.sh"
VPN_PORT_FORWARDING_DOWN_COMMAND: "/scripts/port-down.sh"
FIREWALL_OUTBOUND_SUBNETS: 10.244.0.0/16,10.96.0.0/12
FIREWALL_INPUT_PORTS: "8112"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gluetun-scripts
data:
port-up.sh: |
#!/bin/sh
wget -O- --retry-connrefused \
--post-data "json={\"listen_port\":{{PORTS}},\"current_network_interface\":\"tun0\",\"random_port\":false,\"upnp\":false}" \
http://127.0.0.1:8112/api/v2/app/setPreferences 2>&1
'
VPN_PORT_FORWARDING_DOWN_COMMAND: |
/bin/sh -c '
port-down.sh: |
#!/bin/sh
wget -O- --retry-connrefused \
--post-data "json={\"listen_port\":0,\"current_network_interface\":\"lo\"}" \
http://127.0.0.1:8112/api/v2/app/setPreferences 2>&1
'
FIREWALL_OUTBOUND_SUBNETS: 10.244.0.0/16,10.96.0.0/12
FIREWALL_INPUT_PORTS: "8112"
---
apiVersion: v1
kind: ConfigMap

View file

@ -33,6 +33,8 @@ spec:
- mountPath: "/gluetun/wireguard"
name: gluetun-wgconfig
readOnly: true
- name: gluetun-scripts
mountPath: /scripts
- name: gluetun-tmp
mountPath: /tmp/gluetun
restartPolicy: Always
@ -128,6 +130,10 @@ spec:
- name: gluetun-wgconfig
secret:
secretName: gluetun-wgconfig
- name: gluetun-scripts
configMap:
name: gluetun-scripts
defaultMode: 0755
- name: gluetun-tmp
emptyDir: {}
- name: nfs-media