瀏覽代碼

wg-easy: fix port issue (#2430)

Stavros Kois 1 年之前
父節點
當前提交
9520ccc731

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

@@ -3,7 +3,7 @@ description: WG-Easy is the easiest way to install & manage WireGuard!
 annotations:
   title: WG Easy
 type: application
-version: 2.0.16
+version: 2.0.17
 apiVersion: v2
 appVersion: '12'
 kubeVersion: '>=1.16.0-0'

+ 2 - 0
library/ix-dev/charts/wg-easy/migrations/migrate

@@ -78,6 +78,8 @@ def migrate(values):
     if not 'wgeasy' in values.keys():
         return values
 
+    if not values['wgConfig'].get('externalPort', None):
+        values['wgConfig']['externalPort'] = values['wgNetwork'].get('udpPort', 30057)
 
     return migrate_common_lib(values)
 

+ 10 - 1
library/ix-dev/charts/wg-easy/questions.yaml

@@ -98,6 +98,15 @@ questions:
             required: true
             $ref:
               - "definitions/nodeIP"
+        - variable: externalPort
+          label: Port for Client Configuration
+          description: |
+            The port accessible from the clients.</br>
+            This is ONLY used on the client configuration generation in the "Endpoint" field.
+          schema:
+            type: int
+            required: true
+            default: 51820
         - variable: password
           label: Password for WebUI
           description: When set, requires a password when logging in to the Web UI.
@@ -435,7 +444,7 @@ questions:
                 schema:
                   type: string
                   max_length: 12
-                  valid_chars: '^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$'
+                  valid_chars: "^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$"
                   valid_chars_error: |
                     Valid Memory limit formats are</br>
                     - Suffixed with E/P/T/G/M/K - eg. 1G</br>

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

@@ -23,7 +23,7 @@ workload:
                 - NET_RAW
                 - SYS_MODULE
           env:
-            WG_PORT: {{ .Values.wgNetwork.udpPort }}
+            WG_PORT: {{ .Values.wgConfig.externalPort }}
             WG_PATH: /etc/wireguard
             PORT: {{ .Values.wgNetwork.webPort }}
             WG_HOST: {{ .Values.wgConfig.host | quote }}

+ 1 - 0
library/ix-dev/charts/wg-easy/values.yaml

@@ -19,6 +19,7 @@ wgNetwork:
 
 wgConfig:
   host: ''
+  externalPort: 51820
   password: ''
   keepAlive: 0
   clientMTU: 1420