From 0390a882297c28020bbc326c4bab93a046f2a3eb Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Mon, 13 Sep 2021 10:46:07 +0200 Subject: [PATCH] Move VPN section of testbed to include --- charts/incubator/testbed/Chart.yaml | 2 +- charts/incubator/testbed/SCALE/questions.yaml | 121 +----------------- templates/questions/vpn.yaml | 121 ++++++++++++++++++ tools/build-release.sh | 14 ++ 4 files changed, 137 insertions(+), 121 deletions(-) create mode 100644 templates/questions/vpn.yaml diff --git a/charts/incubator/testbed/Chart.yaml b/charts/incubator/testbed/Chart.yaml index 9c9943dfc87..f4aac385f66 100644 --- a/charts/incubator/testbed/Chart.yaml +++ b/charts/incubator/testbed/Chart.yaml @@ -24,4 +24,4 @@ name: testbed sources: - https://github.com/Jackett/Jackett type: application -version: 7.0.12 +version: 7.0.13 diff --git a/charts/incubator/testbed/SCALE/questions.yaml b/charts/incubator/testbed/SCALE/questions.yaml index 6a25f6a576f..b8ec02de029 100644 --- a/charts/incubator/testbed/SCALE/questions.yaml +++ b/charts/incubator/testbed/SCALE/questions.yaml @@ -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} diff --git a/templates/questions/vpn.yaml b/templates/questions/vpn.yaml new file mode 100644 index 00000000000..fca1d2ccfd0 --- /dev/null +++ b/templates/questions/vpn.yaml @@ -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 diff --git a/tools/build-release.sh b/tools/build-release.sh index afb42550d0b..b0e485fd99a 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -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