From 7d15dc372ff6c1400ddc9840250b84fe2173a342 Mon Sep 17 00:00:00 2001 From: Michael Walter Van Der Velden Date: Fri, 3 Nov 2023 11:30:20 +0000 Subject: [PATCH] feat(ingressAdvanced): use tc-opencors-chain if allow-cors is enabled (#13240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Allows for the optional use of the existing Traefik CORS setup for Apps as CORS is required to use the official [jellyfin-vue client](https://github.com/jellyfin/jellyfin-vue). Has been updated to rely on https://github.com/truecharts/library-charts/pull/530 **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** Manually edited the chart's files on my own TrueNas Scale Server. Checked that jellyffin was using the tf-opencors-chain in Traefik rather than basic-chain and ensured I could connect to jellyfin via a custom app of [jellyfin-vue client](https://github.com/jellyfin/jellyfin-vue) when the added config was enabled but not if disabled. Evidence of the correct chain being used in
Traefik
Added config option **📃 Notes:** This PR uses the same cors middleware setup as the existing [audiobookshelf](https://github.com/truecharts/charts/tree/eec761785c474f47dc76124f0d2491d16bf60715/charts/stable/audiobookshelf) app to ensure conistancy. While it may be expected that the `tf-opencors-headers` middleware could be added within the UI this unfortunately results in the `Access-Control-Allow-Origin` header still being missing as the common chain conflicts. **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [x] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [x] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Michael Walter Van Der Velden --- charts/stable/jellyfin/values.yaml | 2 +- templates/questions/ingress/ingressAdvanced.yaml | 6 ++++++ templates/questions/ingress/ingressList.yaml | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/stable/jellyfin/values.yaml b/charts/stable/jellyfin/values.yaml index f32aefc065e..4bf5eaf09ce 100644 --- a/charts/stable/jellyfin/values.yaml +++ b/charts/stable/jellyfin/values.yaml @@ -97,4 +97,4 @@ workload: # -- enable Jellyfin autodiscovery on LAN autodiscovery: - enabled: false + enabled: false \ No newline at end of file diff --git a/templates/questions/ingress/ingressAdvanced.yaml b/templates/questions/ingress/ingressAdvanced.yaml index b33985ef5f0..370ab92447a 100644 --- a/templates/questions/ingress/ingressAdvanced.yaml +++ b/templates/questions/ingress/ingressAdvanced.yaml @@ -12,6 +12,12 @@ default: websecure show_if: [["advanced", "=", true]] required: true + - variable: allowCors + label: "Allow Cross Origin Requests" + schema: + type: boolean + show_if: [["advanced", "=", true]] + default: false - variable: ingressClassName label: (Advanced/Optional) IngressClass Name schema: diff --git a/templates/questions/ingress/ingressList.yaml b/templates/questions/ingress/ingressList.yaml index 20484474ab1..ebc1f295d44 100644 --- a/templates/questions/ingress/ingressList.yaml +++ b/templates/questions/ingress/ingressList.yaml @@ -27,6 +27,12 @@ schema: type: string default: "" + - variable: allowCors + label: "Allow Cross Origin Requests" + schema: + type: boolean + show_if: [["advanced", "=", true]] + default: false - variable: hosts label: Hosts schema: