From e37799fdf76f8e1dc2402b53fd85a00ef41a2990 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:26:52 -0500 Subject: [PATCH] migrate(fireshare): Migrate to new common (#15638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Another one to new common ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 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?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ 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: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> --- charts/incubator/fireshare/Chart.yaml | 18 ++++----- .../fireshare/templates/_secrets.tpl | 20 ++++------ .../incubator/fireshare/templates/common.yaml | 9 +++-- charts/incubator/fireshare/values.yaml | 40 ++++++++++--------- 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/charts/incubator/fireshare/Chart.yaml b/charts/incubator/fireshare/Chart.yaml index ef11db36352..93eba059ae6 100644 --- a/charts/incubator/fireshare/Chart.yaml +++ b/charts/incubator/fireshare/Chart.yaml @@ -1,8 +1,8 @@ kubeVersion: ">=1.24.0" apiVersion: v2 name: fireshare -version: 2.0.13 -appVersion: 1.2.8 +version: 3.0.0 +appVersion: 1.2.15 description: Share your game clips, videos, or other media via unique links. home: https://truecharts.org/charts/incubator/fireshare icon: https://truecharts.org/img/hotlink-ok/chart-icons/fireshare.png @@ -18,13 +18,13 @@ maintainers: keywords: - fireshare dependencies: - - name: common - version: 11.1.2 - repository: https://library-charts.truecharts.org - condition: "" - alias: "" - tags: [] - import-values: [] +- name: common + version: 15.3.1 + repository: https://library-charts.truecharts.org + condition: "" + alias: "" + tags: [] + import-values: [] annotations: max_scale_version: 23.10.1 min_scale_version: 22.12.4 diff --git a/charts/incubator/fireshare/templates/_secrets.tpl b/charts/incubator/fireshare/templates/_secrets.tpl index b97c3b288ba..f180a8cf001 100644 --- a/charts/incubator/fireshare/templates/_secrets.tpl +++ b/charts/incubator/fireshare/templates/_secrets.tpl @@ -1,17 +1,13 @@ {{/* Define the secrets */}} {{- define "fireshare.secrets" -}} ---- +{{- $secretName := (printf "%s-fireshare-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }} -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - name: fireshare-secrets +{{- $secretKey := randAlphaNum 32 -}} + + {{- with lookup "v1" "Secret" .Release.Namespace $secretName -}} + {{- $secretKey = index .data "SECRET_KEY" | b64dec -}} + {{- end }} +enabled: true data: - {{- with (lookup "v1" "Secret" .Release.Namespace "fireshare-secrets") }} - SECRET_KEY: {{ index .data "SECRET_KEY" }} - {{- else }} - SECRET_KEY: {{ randAlphaNum 32 | b64enc }} - {{- end }} - + SECRET_KEY: {{ $secretKey }} {{- end -}} diff --git a/charts/incubator/fireshare/templates/common.yaml b/charts/incubator/fireshare/templates/common.yaml index b5635570fd1..09377747a2f 100644 --- a/charts/incubator/fireshare/templates/common.yaml +++ b/charts/incubator/fireshare/templates/common.yaml @@ -1,7 +1,10 @@ -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . -}} {{/* Render secrets for fireshare */}} -{{- include "fireshare.secrets" . }} +{{- $secrets := include "fireshare.secrets" . | fromYaml -}} +{{- if $secrets -}} + {{- $_ := set .Values.secret "fireshare-secrets" $secrets -}} +{{- end -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{- include "tc.v1.common.loader.apply" . -}} diff --git a/charts/incubator/fireshare/values.yaml b/charts/incubator/fireshare/values.yaml index fa7f901dc21..13cdf149bb9 100644 --- a/charts/incubator/fireshare/values.yaml +++ b/charts/incubator/fireshare/values.yaml @@ -1,32 +1,33 @@ image: pullPolicy: IfNotPresent - repository: tccr.io/truecharts/fireshare - tag: 1.2.8@sha256:9a8893666987d6a2a0ee18281ef55632630d3eee904886194372f9fe2961c068 - -podSecurityContext: - runAsGroup: 0 - runAsUser: 0 + repository: shaneisrael/fireshare + tag: 1.2.15@sha256:7b567c9c5b58b471700641a03bdb45d87fee1f18940e08d364c0b4d07a91b878 securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false + container: + readOnlyRootFilesystem: false + runAsUser: 0 + runAsGroup: 0 -secretEnv: - ADMIN_PASSWORD: "changeme" - -env: - SECRET_KEY: - secretKeyRef: - name: fireshare-secrets - key: SECRET_KEY - MINUTES_BETWEEN_VIDEO_SCANS: 5 +workload: + main: + podSpec: + containers: + main: + env: + SECRET_KEY: + secretKeyRef: + name: fireshare-secrets + key: SECRET_KEY + MINUTES_BETWEEN_VIDEO_SCANS: 5 + ADMIN_PASSWORD: "changeme" service: main: ports: main: port: 10287 - protocol: HTTP + protocol: http targetPort: 80 persistence: @@ -41,4 +42,5 @@ persistence: mountPath: /videos portal: - enabled: true + open: + enabled: true