From 58960200c01f747759cb6941002a3c90a37cda6a Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Mon, 7 Nov 2022 15:37:09 +0200 Subject: [PATCH] add wg-easy app (init bolierplate) --- test/wg-easy/.helmignore | 2 + test/wg-easy/1.0.0/Chart.lock | 6 + test/wg-easy/1.0.0/Chart.yaml | 15 ++ test/wg-easy/1.0.0/README.md | 3 + test/wg-easy/1.0.0/app-readme.md | 3 + test/wg-easy/1.0.0/charts/common-2207.0.0.tgz | Bin 0 -> 4976 bytes test/wg-easy/1.0.0/ix_values.yaml | 4 + test/wg-easy/1.0.0/questions.yaml | 246 ++++++++++++++++++ test/wg-easy/1.0.0/test_values.yaml | 0 test/wg-easy/item.yaml | 5 + test/wg-easy/upgrade_info.json | 1 + test/wg-easy/upgrade_strategy | 37 +++ 12 files changed, 322 insertions(+) create mode 100644 test/wg-easy/.helmignore create mode 100644 test/wg-easy/1.0.0/Chart.lock create mode 100644 test/wg-easy/1.0.0/Chart.yaml create mode 100644 test/wg-easy/1.0.0/README.md create mode 100644 test/wg-easy/1.0.0/app-readme.md create mode 100644 test/wg-easy/1.0.0/charts/common-2207.0.0.tgz create mode 100644 test/wg-easy/1.0.0/ix_values.yaml create mode 100644 test/wg-easy/1.0.0/questions.yaml create mode 100644 test/wg-easy/1.0.0/test_values.yaml create mode 100644 test/wg-easy/item.yaml create mode 100644 test/wg-easy/upgrade_info.json create mode 100755 test/wg-easy/upgrade_strategy diff --git a/test/wg-easy/.helmignore b/test/wg-easy/.helmignore new file mode 100644 index 0000000000..c1347c2c27 --- /dev/null +++ b/test/wg-easy/.helmignore @@ -0,0 +1,2 @@ +# Patterns to ignore when building packages. +*.png diff --git a/test/wg-easy/1.0.0/Chart.lock b/test/wg-easy/1.0.0/Chart.lock new file mode 100644 index 0000000000..332bddc6b2 --- /dev/null +++ b/test/wg-easy/1.0.0/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../library/common/2207.0.0 + version: 2207.0.0 +digest: sha256:f17f3d458ca0210a52e39da0dce35034e900b36f2040d4b19bed46a7aae91506 +generated: "2022-11-07T14:53:51.774827549+02:00" diff --git a/test/wg-easy/1.0.0/Chart.yaml b/test/wg-easy/1.0.0/Chart.yaml new file mode 100644 index 0000000000..fc41a1d643 --- /dev/null +++ b/test/wg-easy/1.0.0/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v2 +appVersion: REPLACE +dependencies: +- name: common + repository: file://../../../library/common/2207.0.0 + version: 2207.0.0 +description: WG-Easy is the easiest way to install & manage WireGuard! +home: https://github.com/WeeJeWel/wg-easy +icon: https://raw.githubusercontent.com/WeeJeWel/wg-easy/master/src/www/img/logo.png +keywords: +- wireguard +- network +- vpn +name: wg-easy +version: 1.0.0 diff --git a/test/wg-easy/1.0.0/README.md b/test/wg-easy/1.0.0/README.md new file mode 100644 index 0000000000..8c6f958538 --- /dev/null +++ b/test/wg-easy/1.0.0/README.md @@ -0,0 +1,3 @@ +# WG-Easy + +[WG-Easy (WireGuard Easy)](https://github.com/WeeJeWel/wg-easy) is the easiest way to install & manage WireGuard! diff --git a/test/wg-easy/1.0.0/app-readme.md b/test/wg-easy/1.0.0/app-readme.md new file mode 100644 index 0000000000..8c6f958538 --- /dev/null +++ b/test/wg-easy/1.0.0/app-readme.md @@ -0,0 +1,3 @@ +# WG-Easy + +[WG-Easy (WireGuard Easy)](https://github.com/WeeJeWel/wg-easy) is the easiest way to install & manage WireGuard! diff --git a/test/wg-easy/1.0.0/charts/common-2207.0.0.tgz b/test/wg-easy/1.0.0/charts/common-2207.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..0bc0da84525a1602db1da3fa55da2afcfc350f0f GIT binary patch literal 4976 zcmV-$6OZg4iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<$bKAC-{j6VcmPzN@*_wJ-v3ESvne{rkx1Od>CeGyE&d!bt zk&uL%1Q-C6qfNcPeF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>n3y4p;FKydkcZ@8x_uZ=+WJ z!#Pe;GNX*+&)>#c`9FMK|Ni&!V0ZrOR>~9gt|Bp~dZE{FfO_AcFv&?06FP$oMb~JC zMc8`+`fxn^K|ldwj*|pt37eR`NQBOQ0FDzR$pRZaQr<^2?mYpDXGWg)GLEO@BaY3N z9{+7W1idi8sII9GbV8IKPC8*YDt$ zm!}u+;N5HZua|Isary4_)vK2;;KljdmuK%@{rc=#&m6Bw1R(hDpKy{^oByA^xs;hW z>G$221Y#D6zGNARv}>wBuk`V)qW?s}?1yl!9P=#a8525BU3Fo`S)M87x5T$AZe{Epq+!jG;tPGQp}VFW&wd z_IgjAz&Vwi#ko$|u>)!jzqOe;!u7h?EI7wWhPi;7If>>FAzGa3EE&XjffJSi#W#+u uT&El932IEqzB345K8wJ^Z$Z!P%C79nuIx&+{C@xd0RR6+N*1XAiU0u9?%!4b literal 0 HcmV?d00001 diff --git a/test/wg-easy/1.0.0/ix_values.yaml b/test/wg-easy/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..869ce8aa79 --- /dev/null +++ b/test/wg-easy/1.0.0/ix_values.yaml @@ -0,0 +1,4 @@ +image: + pullPolicy: IfNotPresent + repository: weejewel/wg-easy + tag: 7 diff --git a/test/wg-easy/1.0.0/questions.yaml b/test/wg-easy/1.0.0/questions.yaml new file mode 100644 index 0000000000..637a18b0f3 --- /dev/null +++ b/test/wg-easy/1.0.0/questions.yaml @@ -0,0 +1,246 @@ +groups: + - name: Configuration + description: WG-Easy application configuration + - name: Storage + description: Configure storage for WG-Easy + - name: Networking + description: Networking Configuration for WG-Easy + - name: Advanced DNS Settings + description: Configure DNS settings + - name: Resource Limits + description: Set CPU/memory limits for Kubernetes Pod + +portals: + web_portal: + protocols: + - http + host: + - $node_ip + ports: + - $variable-web_port + path: / + +questions: + - variable: wgUDPPort + label: WireGuard UPD Node Port for WG-Easy + group: Networking + schema: + type: int + min: 9000 + max: 65535 + default: 20920 + required: true + - variable: webUIPort + label: WebUI Node Port for WG-Easy + group: Networking + schema: + type: int + min: 9000 + max: 65535 + default: 20921 + required: true + + - variable: dnsConfig + label: DNS Configuration + group: Advanced DNS Settings + schema: + type: dict + attrs: + - variable: options + label: DNS Options + schema: + type: list + items: + - variable: optionsEntry + label: Option Entry Configuration + schema: + type: dict + attrs: + - variable: name + label: Option Name + schema: + type: string + required: true + - variable: value + label: Option Value + schema: + type: string + required: true + + - variable: wg_easy + label: WG-Easy Configuration + group: Configuration + schema: + type: dict + additional_attrs: true + attrs: + - variable: host + label: Hostname or IP + description: The public hostname or IP of your VPN server. + schema: + type: string + required: true + $ref: + - "definitions/nodeIP" + - variable: password + label: Password for WebUI + description: When set, requires a password when logging in to the Web UI. + schema: + type: string + private: true + default: "" + - variable: keep_alive + label: Persistent Keep Alive + description: Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. + schema: + type: int + required: true + default: 0 + - variable: client_address_range + label: Clients IP Address Range + description: Clients IP address range. + schema: + type: string + required: true + default: 10.8.0.x + - variable: client_dns_server + label: Clients DNS Server + description: Clients DNS Server. + schema: + type: string + required: true + default: "1.1.1.1" + - variable: allowed_ips + label: Allowed IPs + description: Allowed IPs clients will use. If none provided, <0.0.0.0/0,::/0> will be used. + schema: + type: list + default: [] + items: + - variable: entry + label: Allowed IP Entry + schema: + type: string + required: true + default: "" + + - variable: environmentVariables + label: WG-Easy Environment + group: Configuration + schema: + type: list + default: [] + items: + - variable: environmentVariable + label: Environment Variable + schema: + type: dict + attrs: + - variable: name + label: Name + schema: + type: string + required: true + default: "" + - variable: value + label: Value + schema: + type: string + default: "" + required: true + + - variable: appVolumeMounts + label: WG-Easy Storage + group: Storage + schema: + type: dict + attrs: + - variable: config + label: Configuration Volume + schema: + type: dict + attrs: + - variable: datasetName + label: Configuration Volume Dataset Name + schema: + type: string + hidden: true + $ref: + - normalize/ixVolume + show_if: [["hostPathEnabled", "=", false]] + default: ix-wg-easy_config + editable: false + - variable: mountPath + label: Configuration Mount Path + description: Path where the volume will be mounted inside the pod + schema: + type: path + hidden: true + editable: true + default: /etc/wireguard + - variable: hostPathEnabled + label: Enable Custom Host Path for WG-Easy Configuration Volume + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: Host Path for WG-Easy Configuration Volume + schema: + type: hostpath + required: true + $ref: + - validations/lockedHostPath + + - variable: extraAppVolumeMounts + label: Extra Host Path Volumes + group: Storage + schema: + type: list + items: + - variable: extraAppVolume + label: Host Path Volume + description: Add an extra host path volume for WG-Easy application + schema: + type: dict + attrs: + - variable: mountPath + label: Mount Path in Pod + description: Path where the volume will be mounted inside the pod + schema: + type: path + required: true + - variable: hostPath + label: Host Path + description: Host path + schema: + type: hostpath + required: true + $ref: + - validations/lockedHostPath + + - variable: enableResourceLimits + label: Enable Pod resource limits + group: Resource Limits + schema: + type: boolean + default: false + - variable: cpuLimit + label: CPU Limit resource limits + description: CPU resource limit allow plain integer values with suffix m(milli) e.g 1000m, 100. + group: Resource Limits + schema: + type: string + show_if: [["enableResourceLimits", "=", true]] + valid_chars: "^\\d+(?:\\.\\d+(?!.*m$)|m?$)" + default: 4000m + - variable: memLimit + label: Memory Limit + group: Resource Limits + description: Memory limits is specified by number of bytes. Followed by quantity suffix like E,P,T,G,M,k and Ei,Pi,Ti,Mi,Gi,Ki can also be used. e.g 129e6, 129M, 128974848000m, 123Mi + schema: + type: string + show_if: [["enableResourceLimits", "=", true]] + valid_chars: "^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + default: 8Gi diff --git a/test/wg-easy/1.0.0/test_values.yaml b/test/wg-easy/1.0.0/test_values.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/wg-easy/item.yaml b/test/wg-easy/item.yaml new file mode 100644 index 0000000000..d14a20abcc --- /dev/null +++ b/test/wg-easy/item.yaml @@ -0,0 +1,5 @@ +icon_url: https://raw.githubusercontent.com/WeeJeWel/wg-easy/master/src/www/img/logo.png +categories: +- wireguard +- network +- vpn diff --git a/test/wg-easy/upgrade_info.json b/test/wg-easy/upgrade_info.json new file mode 100644 index 0000000000..f22ddd1aee --- /dev/null +++ b/test/wg-easy/upgrade_info.json @@ -0,0 +1 @@ +{"filename": "ix_values.yaml", "keys": ["image"], "test_filename": "test_values.yaml"} diff --git a/test/wg-easy/upgrade_strategy b/test/wg-easy/upgrade_strategy new file mode 100755 index 0000000000..6efc75abf9 --- /dev/null +++ b/test/wg-easy/upgrade_strategy @@ -0,0 +1,37 @@ +#!/usr/bin/python3 +import json +import sys +import re + +from catalog_update.upgrade_strategy import datetime_versioning + + +# Upstream uses only a single digit for tags +VERSION_REG = r'[0-9]*' + + +def newer_mapping(image_tags): + key = list(image_tags.keys())[0] + tags = [] + for tag in image_tags[key]: + match = re.fullmatch(VERSION_REG, tag) + if match: + tags.append(tag.split('-')[0]) + + version = datetime_versioning(list(tags), '%y%m%d') + if not version: + return {} + + return { + 'tags': {key: f'{version}-bullseye'}, + 'app_version': version, + } + + +if __name__ == '__main__': + try: + versions_json = json.loads(sys.stdin.read()) + except ValueError: + raise ValueError('Invalid json specified') + + print(json.dumps(newer_mapping(versions_json)))