chore(gluetun): Rework port forward
This commit is contained in:
parent
bdeec6d819
commit
2b9630eb04
2 changed files with 20 additions and 8 deletions
|
|
@ -9,20 +9,26 @@ data:
|
||||||
VPN_TYPE: "wireguard"
|
VPN_TYPE: "wireguard"
|
||||||
VPN_PORT_FORWARDING: on
|
VPN_PORT_FORWARDING: on
|
||||||
VPN_PORT_FORWARDING_PROVIDER: protonvpn
|
VPN_PORT_FORWARDING_PROVIDER: protonvpn
|
||||||
VPN_PORT_FORWARDING_UP_COMMAND: |
|
VPN_PORT_FORWARDING_UP_COMMAND: "/scripts/port-up.sh"
|
||||||
/bin/sh -c '
|
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 \
|
wget -O- --retry-connrefused \
|
||||||
--post-data "json={\"listen_port\":{{PORTS}},\"current_network_interface\":\"tun0\",\"random_port\":false,\"upnp\":false}" \
|
--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
|
http://127.0.0.1:8112/api/v2/app/setPreferences 2>&1
|
||||||
'
|
port-down.sh: |
|
||||||
VPN_PORT_FORWARDING_DOWN_COMMAND: |
|
#!/bin/sh
|
||||||
/bin/sh -c '
|
|
||||||
wget -O- --retry-connrefused \
|
wget -O- --retry-connrefused \
|
||||||
--post-data "json={\"listen_port\":0,\"current_network_interface\":\"lo\"}" \
|
--post-data "json={\"listen_port\":0,\"current_network_interface\":\"lo\"}" \
|
||||||
http://127.0.0.1:8112/api/v2/app/setPreferences 2>&1
|
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
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ spec:
|
||||||
- mountPath: "/gluetun/wireguard"
|
- mountPath: "/gluetun/wireguard"
|
||||||
name: gluetun-wgconfig
|
name: gluetun-wgconfig
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
- name: gluetun-scripts
|
||||||
|
mountPath: /scripts
|
||||||
- name: gluetun-tmp
|
- name: gluetun-tmp
|
||||||
mountPath: /tmp/gluetun
|
mountPath: /tmp/gluetun
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
|
|
@ -128,6 +130,10 @@ spec:
|
||||||
- name: gluetun-wgconfig
|
- name: gluetun-wgconfig
|
||||||
secret:
|
secret:
|
||||||
secretName: gluetun-wgconfig
|
secretName: gluetun-wgconfig
|
||||||
|
- name: gluetun-scripts
|
||||||
|
configMap:
|
||||||
|
name: gluetun-scripts
|
||||||
|
defaultMode: 0755
|
||||||
- name: gluetun-tmp
|
- name: gluetun-tmp
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: nfs-media
|
- name: nfs-media
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue