rego-tunnel: wire TSCLIENT + fix CIDR defaults
Some checks failed
Test / test (push) Has been cancelled
Some checks failed
Test / test (push) Has been cancelled
This commit is contained in:
@@ -11,11 +11,19 @@ set -e
|
||||
|
||||
BRIDGE_NAME="${BRIDGE_NAME:-br-rego-vpn}"
|
||||
TAP_NAME="${TAP_NAME:-tap0}"
|
||||
BRIDGE_CIDR="${BRIDGE_CIDR:-100.100.0.1}/24"
|
||||
BRIDGE_CIDR="${BRIDGE_CIDR:-100.100.0.1}"
|
||||
VM_NET_IP="${VM_NET_IP:-100.100.0.2}"
|
||||
VM_SUBNET="${VM_SUBNET:-100.100.0.0}/24"
|
||||
VM_SUBNET="${VM_SUBNET:-100.100.0.0}"
|
||||
TARGET_IP="${TARGET_IP:-10.35.33.230}"
|
||||
|
||||
if [[ "$BRIDGE_CIDR" != */* ]]; then
|
||||
BRIDGE_CIDR="$BRIDGE_CIDR/24"
|
||||
fi
|
||||
|
||||
if [[ "$VM_SUBNET" != */* ]]; then
|
||||
VM_SUBNET="$VM_SUBNET/24"
|
||||
fi
|
||||
|
||||
# Pick the outbound interface based on the container's default route.
|
||||
# (In Docker, this is not always eth1 when multiple networks are attached.)
|
||||
WAN_IF="$(ip route show default 0.0.0.0/0 2>/dev/null | awk '{for(i=1;i<=NF;i++) if($i=="dev"){print $(i+1); exit}}')"
|
||||
|
||||
@@ -2,13 +2,17 @@
|
||||
set -euo pipefail
|
||||
|
||||
BRIDGE_NAME="${BRIDGE_NAME:-br-rego-vpn}"
|
||||
BRIDGE_CIDR="${BRIDGE_CIDR:-100.100.0.1}/24"
|
||||
BRIDGE_CIDR="${BRIDGE_CIDR:-100.100.0.1}"
|
||||
VM_NET_IP="${VM_NET_IP:-100.100.0.2}"
|
||||
VM_MAC="${VM_MAC:-52:54:00:12:34:56}"
|
||||
|
||||
LEASE_TIME="${LEASE_TIME:-12h}"
|
||||
DNS_SERVERS="${DNS_SERVERS:-1.1.1.1,8.8.8.8}"
|
||||
|
||||
if [[ "$BRIDGE_CIDR" != */* ]]; then
|
||||
BRIDGE_CIDR="$BRIDGE_CIDR/24"
|
||||
fi
|
||||
|
||||
GATEWAY_IP="${BRIDGE_CIDR%%/*}"
|
||||
|
||||
mkdir -p /etc/dnsmasq.d
|
||||
|
||||
@@ -110,16 +110,16 @@
|
||||
"placeholder": "12h",
|
||||
"required": true,
|
||||
"env_variable": "LEASE_TIME",
|
||||
"default": "288h"
|
||||
"default": "12h"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"label": "Host share directory",
|
||||
"hint": "Directory on the host to share with the VM",
|
||||
"placeholder": "${APP_DATA_DIR}/hostshare",
|
||||
"hint": "Directory on the host to share with the VM (exported to the VM as 9p tag TSCLIENT)",
|
||||
"placeholder": "/etc/runtipi/app-data",
|
||||
"required": false,
|
||||
"env_variable": "TSCLIENT",
|
||||
"default": "${APP_DATA_DIR}/hostshare"
|
||||
"default": "/etc/runtipi/app-data"
|
||||
}
|
||||
],
|
||||
"supported_architectures": ["amd64"]
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
{
|
||||
"key": "BRIDGE_CIDR",
|
||||
"value": "${BRIDGE_CIDR:-100.100.0.1/24}"
|
||||
"value": "${BRIDGE_CIDR:-100.100.0.1}"
|
||||
},
|
||||
{
|
||||
"key": "VM_NET_IP",
|
||||
@@ -31,7 +31,7 @@
|
||||
},
|
||||
{
|
||||
"key": "VM_SUBNET",
|
||||
"value": "${VM_SUBNET:-100.100.0.0/24}"
|
||||
"value": "${VM_SUBNET:-100.100.0.0}"
|
||||
},
|
||||
{
|
||||
"key": "TARGET_IP",
|
||||
@@ -51,7 +51,7 @@
|
||||
},
|
||||
{
|
||||
"key": "TSCLIENT",
|
||||
"value": "${TSCLIENT:-${APP_DATA_DIR}/hostshare}"
|
||||
"value": "${TSCLIENT:-/etc/runtipi/app-data}"
|
||||
}
|
||||
],
|
||||
"internalPort": 8006,
|
||||
@@ -71,7 +71,7 @@
|
||||
"private": false
|
||||
},
|
||||
{
|
||||
"hostPath": "${TSCLIENT}",
|
||||
"hostPath": "${TSCLIENT:-/etc/runtipi/app-data}",
|
||||
"containerPath": "/hostshare",
|
||||
"readOnly": false,
|
||||
"shared": false,
|
||||
|
||||
@@ -17,18 +17,18 @@ services:
|
||||
- VM_CPUS=${WINDOWS_CPU_CORES}
|
||||
- BRIDGE_NAME=${BRIDGE_NAME:-br-rego-vpn}
|
||||
- TAP_NAME=${TAP_NAME:-tap0}
|
||||
- BRIDGE_CIDR=${BRIDGE_CIDR:-100.100.0.1/24}
|
||||
- BRIDGE_CIDR=${BRIDGE_CIDR:-100.100.0.1}
|
||||
- VM_NET_IP=${VM_NET_IP:-100.100.0.2}
|
||||
- VM_SUBNET=${VM_SUBNET:-100.100.0.0/24}
|
||||
- VM_SUBNET=${VM_SUBNET:-100.100.0.0}
|
||||
- TARGET_IP=${TARGET_IP:-10.35.33.230}
|
||||
- VM_MAC=${VM_MAC:-52:54:00:12:34:56}
|
||||
- DNS_SERVERS=${DNS_SERVERS:-1.1.1.1,8.8.8.8}
|
||||
- LEASE_TIME=${LEASE_TIME:-12h}
|
||||
- TSCLIENT=${TSCLIENT:-/hostshare}
|
||||
- TSCLIENT=${TSCLIENT:-/etc/runtipi/app-data}
|
||||
volumes:
|
||||
- /etc/runtipi/user-config/runtipi/rego-tunnel/storage/linux-vm.qcow2:/vm/linux-vm.qcow2
|
||||
- /etc/runtipi/user-config/runtipi/rego-tunnel/shared:/shared
|
||||
- ${TSCLIENT}:/shared/app-data
|
||||
- ${TSCLIENT:-/etc/runtipi/app-data}:/hostshare
|
||||
networks:
|
||||
- tipi_main_network
|
||||
sysctls:
|
||||
|
||||
Reference in New Issue
Block a user