From 5a2b550682d36daff47d9ea412eeb7b3a577dff0 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 10 Aug 2022 18:04:40 +0300 Subject: [PATCH] fix(plex): Adjust input validation for comma separated list (#3430) --- charts/stable/plex/Chart.yaml | 2 +- charts/stable/plex/docs/validation.md | 18 ++++++++++++++---- charts/stable/plex/questions.yaml | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/charts/stable/plex/Chart.yaml b/charts/stable/plex/Chart.yaml index 594be7ac789..2c8377e2a81 100644 --- a/charts/stable/plex/Chart.yaml +++ b/charts/stable/plex/Chart.yaml @@ -21,7 +21,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/plex - https://github.com/k8s-at-home/container-images/pkgs/container/plex type: application -version: 10.0.30 +version: 10.0.31 annotations: truecharts.org/catagories: | - media diff --git a/charts/stable/plex/docs/validation.md b/charts/stable/plex/docs/validation.md index 664376bb619..a41f1fda1e0 100644 --- a/charts/stable/plex/docs/validation.md +++ b/charts/stable/plex/docs/validation.md @@ -1,15 +1,25 @@ # Input Validation **`Advertise IP`** + +Accepts: + +- `http://` or `https://` +- IP or DNS host +- Port is optional +- `,` Separated + Accepted formats are: - `https://192.168.1.100:32400` - `https://192.168.1.100:32400` -- `http://dnsname:32400` -- `https://dnsname:32400` +- `http://dnshost:32400` +- `https://dnshost:32400` +- `https://dnshost` +- `https://dnshost,http://192.168.1.100:32400` -Regex used to match this: `^http(s)?:\/\/.*:\d*$` -You can try live [here](https://regex101.com/r/3ehGWY/1) +Regex used to match this: `^(http(s)?:\/\/([a-z0-9.]*)(:\d{0,5})?,?)*$` +You can try live [here](https://regex101.com/r/9GBtUh/1) --- diff --git a/charts/stable/plex/questions.yaml b/charts/stable/plex/questions.yaml index ccfbe58231d..f78cae5d4a1 100644 --- a/charts/stable/plex/questions.yaml +++ b/charts/stable/plex/questions.yaml @@ -24,7 +24,7 @@ questions: description: "IP to advertise to Plex, Change SERVER_IP to your actual server IP" schema: type: string - valid_chars: '^http(s)?:\/\/.*:\d*$' + valid_chars: '^(http(s)?:\/\/([a-z0-9.]*)(:\d{0,5})?,?)*$' required: true default: "http://SERVER_IP:32400" - variable: ALLOWED_NETWORKS