From 741f0425fed9cb5b2f2d62e9648d2f46d7fc6623 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:12:25 +0300 Subject: [PATCH] feat(plex): Pre-fill ADVERTISE_IP with the server ip and ingress (#3464) * feat(plex): Pre-fill ADVERTISE_IP with the server ip * slight change * update values * remove * url with port * update description * move non-env values to another dict * fix reference --- charts/stable/plex/Chart.yaml | 2 +- charts/stable/plex/questions.yaml | 29 ++++++++++++++++++++++------- charts/stable/plex/values.yaml | 12 +++++++++++- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/charts/stable/plex/Chart.yaml b/charts/stable/plex/Chart.yaml index 6b98fde69a5..e4a804f9497 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.34 +version: 10.1.0 annotations: truecharts.org/catagories: | - media diff --git a/charts/stable/plex/questions.yaml b/charts/stable/plex/questions.yaml index d31d96acd44..0a78746f5de 100644 --- a/charts/stable/plex/questions.yaml +++ b/charts/stable/plex/questions.yaml @@ -13,6 +13,28 @@ questions: # Include{recreate} # Include{controllerExpert} # Include{controllerExpertExtraArgs} + - variable: plex + group: "Container Configuration" + label: "Plex Configuration" + schema: + additional_attrs: true + type: dict + attrs: + - variable: serverIP + label: "Server IP" + description: "Set to the IP-Address used to reach Plex." + schema: + type: string + required: true + $ref: + - "definitions/nodeIP" + - variable: additionalAdvertiseURL + label: "Addition Advertise URLs" + description: "URLs to advertise to Plex, format http(s)://IPorDNS:3200. By default your serverIP and ingress URL is added" + schema: + type: string + valid_chars: '^$|^(http(s)?:\/\/([a-zA-Z0-9.-]*)(:\d{0,5})?,?)*$' + default: "" - variable: env group: "Container Configuration" label: "Image Environment" @@ -20,13 +42,6 @@ questions: additional_attrs: true type: dict attrs: - - variable: ADVERTISE_IP - label: "Advertise IP" - description: "IP to advertise to Plex, Change SERVER_IP to your actual server IP" - schema: - type: string - valid_chars: '^$|^(http(s)?:\/\/([a-zA-Z0-9.-]*)(:\d{0,5})?,?)*$' - default: "http://SERVER_IP:32400" - variable: ALLOWED_NETWORKS label: "Allowed Networks" description: "Networks allowed to connect to plex. Add your local network IP to this list" diff --git a/charts/stable/plex/values.yaml b/charts/stable/plex/values.yaml index 1acfbe21195..8310c5d426b 100644 --- a/charts/stable/plex/values.yaml +++ b/charts/stable/plex/values.yaml @@ -7,6 +7,7 @@ service: main: ports: main: + protocol: HTTP port: 32400 targetPort: 32400 @@ -15,9 +16,18 @@ persistence: enabled: true mountPath: "/config" +plex: + serverURL: "{{ .Values.service.main.ports.main.protocol | lower }}://{{ .Values.plex.serverIP }}:{{ .Values.service.main.ports.main.port }}" + serverIngressURL: "{{ if .Values.ingress.main.enabled }}{{ with (first .Values.ingress.main.hosts) }},https://{{ .host }}{{ end }}{{ end }}" + serverIngressURLPort: "{{ if .Values.ingress.main.enabled }}{{ with (first .Values.ingress.main.hosts) }},https://{{ .host }}:{{ .Values.service.main.ports.main.port }}{{ end }}{{ end }}" + # User Defined + serverIP: "127.0.0.1" + additionalAdvertiseURL: "" + env: + ADVERTISE_IP: "{{ tpl (.Values.plex.serverURL) .}}{{ tpl (.Values.plex.serverIngressURL) . }}{{ tpl (.Values.plex.serverIngressURLPort) . }}{{ with .Values.plex.additionalAdvertiseURL }},{{ . }}{{ end }}" + # User Defined ALLOWED_NETWORKS: "172.16.0.0/12,10.0.0.0/8,192.168.0.0/16" - ADVERTISE_IP: "" PLEX_CLAIM: "" portal: