Move VPN section of testbed to include

This commit is contained in:
kjeld Schouten-Lebbing
2021-09-13 10:46:07 +02:00
parent 8dea0c3c7e
commit 0390a88229
4 changed files with 137 additions and 121 deletions

View File

@@ -24,4 +24,4 @@ name: testbed
sources:
- https://github.com/Jackett/Jackett
type: application
version: 7.0.12
version: 7.0.13

View File

@@ -1345,123 +1345,4 @@ questions:
type: int
default: 80
- variable: addons
group: "Addons"
label: ""
schema:
type: dict
attrs:
- variable: vpn
label: "VPN"
schema:
type: dict
attrs:
- variable: type
label: "Type"
schema:
type: string
default: "disabled"
enum:
- value: "disabled"
description: "disabled"
- value: "openvpn"
description: "OpenVPN"
- value: "wireguard"
description: "Wireguard"
- variable: openvpn
label: "OpenVPN Settings"
schema:
type: dict
show_if: [["type", "=", "openvpn"]]
attrs:
- variable: auth
label: "auth"
schema:
type: string
default: ""
- variable: authSecret
label: "authSecret"
schema:
type: string
default: ""
- variable: wireguard
label: "Wireguard Settings"
schema:
type: dict
show_if: [["type", "=", "wireguard"]]
attrs:
- variable: KILLSWITCH
label: "Enable killswitch"
schema:
type: boolean
default: false
- variable: KILLSWITCH_EXCLUDEDNETWORKS_IPV4
label: "Killswitch Excluded IPv4 networks"
description: "list of killswitch excluded ipv4 addresses seperated by ;"
schema:
type: string
default: "172.16.0.0/12"
- variable: KILLSWITCH_EXCLUDEDNETWORKS_IPV6
label: "Killswitch Excluded IPv6 networks"
description: "list of killswitch excluded ipv4 addresses seperated by ;"
schema:
type: string
default: ""
- variable: configFile
label: "VPN Config File Location"
schema:
type: dict
show_if: [["type", "!=", "disabled"]]
attrs:
- variable: enabled
label: "enabled"
schema:
type: boolean
default: true
hidden: true
- variable: type
label: "type"
schema:
type: string
default: "hostPath"
hidden: true
- variable: hostPathType
label: "hostPathType"
schema:
type: string
default: "File"
hidden: true
- variable: noMount
label: "noMount"
schema:
type: boolean
default: true
hidden: true
- variable: hostPath
label: "Full path to file"
schema:
type: string
default: "/mnt/tank/config/YourVPN-Config.conf"
required: true
- variable: envList
label: "VPN environment Variables"
schema:
type: list
show_if: [["type", "!=", "disabled"]]
default: []
items:
- variable: envItem
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
required: true
- variable: value
label: "Value"
schema:
type: string
required: true
# Include{VPN}

View File

@@ -0,0 +1,121 @@
- variable: addons
group: "Addons"
label: ""
schema:
type: dict
attrs:
- variable: vpn
label: "VPN"
schema:
type: dict
attrs:
- variable: type
label: "Type"
schema:
type: string
default: "disabled"
enum:
- value: "disabled"
description: "disabled"
- value: "openvpn"
description: "OpenVPN"
- value: "wireguard"
description: "Wireguard"
- variable: openvpn
label: "OpenVPN Settings"
schema:
type: dict
show_if: [["type", "=", "openvpn"]]
attrs:
- variable: auth
label: "auth"
schema:
type: string
default: ""
- variable: authSecret
label: "authSecret"
schema:
type: string
default: ""
- variable: wireguard
label: "Wireguard Settings"
schema:
type: dict
show_if: [["type", "=", "wireguard"]]
attrs:
- variable: KILLSWITCH
label: "Enable killswitch"
schema:
type: boolean
default: false
- variable: KILLSWITCH_EXCLUDEDNETWORKS_IPV4
label: "Killswitch Excluded IPv4 networks"
description: "list of killswitch excluded ipv4 addresses seperated by ;"
schema:
type: string
default: "172.16.0.0/12"
- variable: KILLSWITCH_EXCLUDEDNETWORKS_IPV6
label: "Killswitch Excluded IPv6 networks"
description: "list of killswitch excluded ipv4 addresses seperated by ;"
schema:
type: string
default: ""
- variable: configFile
label: "VPN Config File Location"
schema:
type: dict
show_if: [["type", "!=", "disabled"]]
attrs:
- variable: enabled
label: "enabled"
schema:
type: boolean
default: true
hidden: true
- variable: type
label: "type"
schema:
type: string
default: "hostPath"
hidden: true
- variable: hostPathType
label: "hostPathType"
schema:
type: string
default: "File"
hidden: true
- variable: noMount
label: "noMount"
schema:
type: boolean
default: true
hidden: true
- variable: hostPath
label: "Full path to file"
schema:
type: string
default: "/mnt/tank/config/YourVPN-Config.conf"
required: true
- variable: envList
label: "VPN environment Variables"
schema:
type: list
show_if: [["type", "!=", "disabled"]]
default: []
items:
- variable: envItem
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
required: true
- variable: value
label: "Value"
schema:
type: string
required: true

View File

@@ -88,6 +88,7 @@ main() {
clean_apps "$chart" "$chartname" "$train" "$chartversion"
copy_apps "$chart" "$chartname" "$train" "$chartversion"
patch_apps "$chart" "$chartname" "$train" "$chartversion"
include_questions "$chart" "$chartname" "$train" "$chartversion"
clean_catalog "$chart" "$chartname" "$train" "$chartversion"
else
echo "Skipping chart ${chart}, no correct SCALE compatibility layer detected"
@@ -117,6 +118,19 @@ main() {
popd > /dev/null
}
include_questions(){
local chart="$1"
local chartname="$2"
local train="$3"
local chartversion="$4"
local target="catalog/${train}/${chartname}/${chartversion}"
echo "Including standardised questions.yaml includes for: ${chartname}"
# Replace # Include{VPN} with the standard VPN codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{VPN}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/vpn.yaml ${target}/questions.yaml
}
clean_catalog() {
local chart="$1"
local chartname="$2"