fix: worker gluetun endpoint IP approach, add VPN key secrets
This commit is contained in:
@@ -25,12 +25,13 @@ spec:
|
|||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- >-
|
||||||
mkdir -p /dev/net && [ -c /dev/net/tun ] || mknod /dev/net/tun c 10 200 && \
|
mkdir -p /dev/net &&
|
||||||
chmod 666 /dev/net/tun && \
|
[ -c /dev/net/tun ] || mknod /dev/net/tun c 10 200 &&
|
||||||
sysctl -w net.ipv6.conf.all.disable_ipv6=1 || true && \
|
chmod 666 /dev/net/tun &&
|
||||||
ip route flush table 51820 2>/dev/null || true && \
|
sysctl -w net.ipv6.conf.all.disable_ipv6=1 || true &&
|
||||||
ip rule del priority 101 2>/dev/null || true && \
|
ip route flush table 51820 2>/dev/null || true &&
|
||||||
|
ip rule del priority 101 2>/dev/null || true &&
|
||||||
ip rule del table 51820 2>/dev/null || true
|
ip rule del table 51820 2>/dev/null || true
|
||||||
- name: qbt-config-patch
|
- name: qbt-config-patch
|
||||||
image: busybox:latest
|
image: busybox:latest
|
||||||
@@ -70,8 +71,18 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: fornax-worker-WORKER_ID-secrets
|
name: fornax-worker-WORKER_ID-secrets
|
||||||
key: PROTONVPN_PRIVATE_KEY
|
key: PROTONVPN_PRIVATE_KEY
|
||||||
- name: SERVER_NAMES
|
- name: WIREGUARD_PUBLIC_KEY
|
||||||
value: PROTONVPN_SERVER
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: fornax-worker-WORKER_ID-secrets
|
||||||
|
key: PROTONVPN_PUBLIC_KEY
|
||||||
|
- name: WIREGUARD_ENDPOINT_IP
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: fornax-worker-WORKER_ID-secrets
|
||||||
|
key: PROTONVPN_ENDPOINT_IP
|
||||||
|
- name: WIREGUARD_ENDPOINT_PORT
|
||||||
|
value: "51820"
|
||||||
- name: VPN_PORT_FORWARDING
|
- name: VPN_PORT_FORWARDING
|
||||||
value: "on"
|
value: "on"
|
||||||
- name: FIREWALL_OUTBOUND_SUBNETS
|
- name: FIREWALL_OUTBOUND_SUBNETS
|
||||||
@@ -102,7 +113,7 @@ spec:
|
|||||||
if [ -f /tmp/gluetun/forwarded_port ]; then
|
if [ -f /tmp/gluetun/forwarded_port ]; then
|
||||||
PORT=$(cat /tmp/gluetun/forwarded_port)
|
PORT=$(cat /tmp/gluetun/forwarded_port)
|
||||||
if [ -n "$PORT" ] && [ "$PORT" != "0" ]; then
|
if [ -n "$PORT" ] && [ "$PORT" != "0" ]; then
|
||||||
echo "$(date): Forwarded port: $PORT — updating qBittorrent"
|
echo "$(date): Forwarded port: $PORT - updating qBittorrent"
|
||||||
curl -s -c /tmp/qbt.txt -X POST http://localhost:8080/api/v2/auth/login \
|
curl -s -c /tmp/qbt.txt -X POST http://localhost:8080/api/v2/auth/login \
|
||||||
-d "username=admin&password=adminadmin" >/dev/null 2>&1
|
-d "username=admin&password=adminadmin" >/dev/null 2>&1
|
||||||
curl -s -b /tmp/qbt.txt -X POST http://localhost:8080/api/v2/app/setPreferences \
|
curl -s -b /tmp/qbt.txt -X POST http://localhost:8080/api/v2/app/setPreferences \
|
||||||
|
|||||||
@@ -16,3 +16,11 @@ spec:
|
|||||||
remoteRef:
|
remoteRef:
|
||||||
key: secret/data/fornax/worker-WORKER_ID
|
key: secret/data/fornax/worker-WORKER_ID
|
||||||
property: private_key
|
property: private_key
|
||||||
|
- secretKey: PROTONVPN_ENDPOINT_IP
|
||||||
|
remoteRef:
|
||||||
|
key: secret/data/fornax/worker-WORKER_ID
|
||||||
|
property: endpoint_ip
|
||||||
|
- secretKey: PROTONVPN_PUBLIC_KEY
|
||||||
|
remoteRef:
|
||||||
|
key: secret/data/fornax/worker-WORKER_ID
|
||||||
|
property: public_key
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ../../base
|
- ../../base
|
||||||
|
|
||||||
namePrefix: ""
|
|
||||||
nameSuffix: ""
|
|
||||||
|
|
||||||
patches:
|
patches:
|
||||||
- target:
|
- target:
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -23,12 +20,15 @@ patches:
|
|||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/template/metadata/labels/app
|
path: /spec/template/metadata/labels/app
|
||||||
value: fornax-worker-tx253
|
value: fornax-worker-tx253
|
||||||
- op: replace
|
|
||||||
path: /spec/template/spec/containers/0/env/3/value
|
|
||||||
value: US-TX#253
|
|
||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/template/spec/containers/0/env/2/valueFrom/secretKeyRef/name
|
path: /spec/template/spec/containers/0/env/2/valueFrom/secretKeyRef/name
|
||||||
value: fornax-worker-tx253-secrets
|
value: fornax-worker-tx253-secrets
|
||||||
|
- op: replace
|
||||||
|
path: /spec/template/spec/containers/0/env/3/valueFrom/secretKeyRef/name
|
||||||
|
value: fornax-worker-tx253-secrets
|
||||||
|
- op: replace
|
||||||
|
path: /spec/template/spec/containers/0/env/4/valueFrom/secretKeyRef/name
|
||||||
|
value: fornax-worker-tx253-secrets
|
||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/template/spec/volumes/1/persistentVolumeClaim/claimName
|
path: /spec/template/spec/volumes/1/persistentVolumeClaim/claimName
|
||||||
value: fornax-worker-tx253-config
|
value: fornax-worker-tx253-config
|
||||||
@@ -65,3 +65,9 @@ patches:
|
|||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/data/0/remoteRef/key
|
path: /spec/data/0/remoteRef/key
|
||||||
value: secret/data/fornax/worker-tx253
|
value: secret/data/fornax/worker-tx253
|
||||||
|
- op: replace
|
||||||
|
path: /spec/data/1/remoteRef/key
|
||||||
|
value: secret/data/fornax/worker-tx253
|
||||||
|
- op: replace
|
||||||
|
path: /spec/data/2/remoteRef/key
|
||||||
|
value: secret/data/fornax/worker-tx253
|
||||||
|
|||||||
@@ -20,12 +20,15 @@ patches:
|
|||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/template/metadata/labels/app
|
path: /spec/template/metadata/labels/app
|
||||||
value: fornax-worker-tx34
|
value: fornax-worker-tx34
|
||||||
- op: replace
|
|
||||||
path: /spec/template/spec/containers/0/env/3/value
|
|
||||||
value: US-TX#34
|
|
||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/template/spec/containers/0/env/2/valueFrom/secretKeyRef/name
|
path: /spec/template/spec/containers/0/env/2/valueFrom/secretKeyRef/name
|
||||||
value: fornax-worker-tx34-secrets
|
value: fornax-worker-tx34-secrets
|
||||||
|
- op: replace
|
||||||
|
path: /spec/template/spec/containers/0/env/3/valueFrom/secretKeyRef/name
|
||||||
|
value: fornax-worker-tx34-secrets
|
||||||
|
- op: replace
|
||||||
|
path: /spec/template/spec/containers/0/env/4/valueFrom/secretKeyRef/name
|
||||||
|
value: fornax-worker-tx34-secrets
|
||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/template/spec/volumes/1/persistentVolumeClaim/claimName
|
path: /spec/template/spec/volumes/1/persistentVolumeClaim/claimName
|
||||||
value: fornax-worker-tx34-config
|
value: fornax-worker-tx34-config
|
||||||
@@ -62,3 +65,9 @@ patches:
|
|||||||
- op: replace
|
- op: replace
|
||||||
path: /spec/data/0/remoteRef/key
|
path: /spec/data/0/remoteRef/key
|
||||||
value: secret/data/fornax/worker-tx34
|
value: secret/data/fornax/worker-tx34
|
||||||
|
- op: replace
|
||||||
|
path: /spec/data/1/remoteRef/key
|
||||||
|
value: secret/data/fornax/worker-tx34
|
||||||
|
- op: replace
|
||||||
|
path: /spec/data/2/remoteRef/key
|
||||||
|
value: secret/data/fornax/worker-tx34
|
||||||
|
|||||||
Reference in New Issue
Block a user