Răsfoiți Sursa

fix wg-easy interface (#1931)

* fix wg-easy interface

* correct device name

* add upgrade strategy
Stavros Kois 1 an în urmă
părinte
comite
30bd5129f5

+ 2 - 2
library/ix-dev/charts/wg-easy/Chart.yaml

@@ -3,9 +3,9 @@ description: WG-Easy is the easiest way to install & manage WireGuard!
 annotations:
   title: WG Easy
 type: application
-version: 2.0.4
+version: 2.0.5
 apiVersion: v2
-appVersion: "7"
+appVersion: "8"
 kubeVersion: ">=1.16.0-0"
 maintainers:
   - name: truenas

+ 7 - 0
library/ix-dev/charts/wg-easy/questions.yaml

@@ -111,6 +111,13 @@ questions:
             type: int
             required: true
             default: 0
+        - variable: deviceName
+          label: Device Name
+          description: Ethernet device the wireguard traffic should be forwarded through.
+          schema:
+            type: string
+            required: true
+            default: eth0
         - variable: clientMTU
           label: Clients MTU
           description: The MTU the clients will use.

+ 2 - 0
library/ix-dev/charts/wg-easy/templates/_wgeasy.tpl

@@ -24,6 +24,7 @@ workload:
                 - SYS_MODULE
           env:
             WG_PORT: {{ .Values.wgNetwork.udpPort }}
+            WG_PATH: /etc/wireguard
             PORT: {{ .Values.wgNetwork.webPort }}
             WG_HOST: {{ .Values.wgConfig.host | quote }}
             PASSWORD: {{ .Values.wgConfig.password | quote }}
@@ -31,6 +32,7 @@ workload:
             WG_MTU: {{ .Values.wgConfig.clientMTU }}
             WG_DEFAULT_ADDRESS: {{ .Values.wgConfig.clientAddressRange }}
             WG_DEFAULT_DNS: {{ .Values.wgConfig.clientDNSServer }}
+            WG_DEVICE: {{ .Values.wgConfig.deviceName | default "eth0" }}
             WG_ALLOWED_IPS: {{ join "," .Values.wgConfig.allowedIPs | default "0.0.0.0/0,::/0" | quote }}
           fixedEnv:
             PUID: 0

+ 31 - 0
library/ix-dev/charts/wg-easy/upgrade_strategy

@@ -0,0 +1,31 @@
+#!/usr/bin/python3
+import json
+import re
+import sys
+
+from catalog_update.upgrade_strategy import semantic_versioning
+
+
+RE_STABLE_VERSION = re.compile(r'[0-9]+')
+
+
+def newer_mapping(image_tags):
+    key = list(image_tags.keys())[0]
+    tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
+    version = semantic_versioning(list(tags))
+    if not version:
+        return {}
+
+    return {
+        'tags': {key: tags[version]},
+        '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)))

+ 3 - 2
library/ix-dev/charts/wg-easy/values.yaml

@@ -1,7 +1,7 @@
 image:
   pullPolicy: IfNotPresent
-  repository: weejewel/wg-easy
-  tag: "7"
+  repository: ghcr.io/wg-easy/wg-easy
+  tag: "8"
 
 resources:
   limits:
@@ -24,6 +24,7 @@ wgConfig:
   clientMTU: 1420
   clientAddressRange: 10.8.0.x
   clientDNSServer: "1.1.1.1"
+  deviceName: eth0
   allowedIPs: []
   additionalEnvs: []