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 0000000000..0bc0da8452 Binary files /dev/null and b/test/wg-easy/1.0.0/charts/common-2207.0.0.tgz differ 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)))