From 9520ccc731e30d7a345f90c4552c085dfe231d63 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Fri, 3 May 2024 12:16:06 +0300 Subject: [PATCH] wg-easy: fix port issue (#2430) --- library/ix-dev/charts/wg-easy/Chart.yaml | 2 +- library/ix-dev/charts/wg-easy/migrations/migrate | 2 ++ library/ix-dev/charts/wg-easy/questions.yaml | 11 ++++++++++- library/ix-dev/charts/wg-easy/templates/_wgeasy.tpl | 2 +- library/ix-dev/charts/wg-easy/values.yaml | 1 + 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/library/ix-dev/charts/wg-easy/Chart.yaml b/library/ix-dev/charts/wg-easy/Chart.yaml index 39ad45c7a9..5e011f6224 100644 --- a/library/ix-dev/charts/wg-easy/Chart.yaml +++ b/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' diff --git a/library/ix-dev/charts/wg-easy/migrations/migrate b/library/ix-dev/charts/wg-easy/migrations/migrate index c3c949d3d6..8525d6859c 100755 --- a/library/ix-dev/charts/wg-easy/migrations/migrate +++ b/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) diff --git a/library/ix-dev/charts/wg-easy/questions.yaml b/library/ix-dev/charts/wg-easy/questions.yaml index 08eef36eb9..c343c92166 100644 --- a/library/ix-dev/charts/wg-easy/questions.yaml +++ b/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.
+ 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
- Suffixed with E/P/T/G/M/K - eg. 1G
diff --git a/library/ix-dev/charts/wg-easy/templates/_wgeasy.tpl b/library/ix-dev/charts/wg-easy/templates/_wgeasy.tpl index 06293a7fbd..d5cdec1511 100644 --- a/library/ix-dev/charts/wg-easy/templates/_wgeasy.tpl +++ b/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 }} diff --git a/library/ix-dev/charts/wg-easy/values.yaml b/library/ix-dev/charts/wg-easy/values.yaml index 3824f47ceb..52f7da725e 100644 --- a/library/ix-dev/charts/wg-easy/values.yaml +++ b/library/ix-dev/charts/wg-easy/values.yaml @@ -19,6 +19,7 @@ wgNetwork: wgConfig: host: '' + externalPort: 51820 password: '' keepAlive: 0 clientMTU: 1420