From c4d342a5ecc53c38eafb86e03121b91adb53c4cf Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Mon, 1 May 2023 18:29:23 +0300 Subject: [PATCH] fix(outline): fix secret (also a fix for custom app) (#8639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes #7756 ⚒️ Fixes #8643 **⚙️ 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._ --- charts/stable/custom-app/Chart.yaml | 2 +- charts/stable/custom-app/questions.yaml | 78 ++++++++++---------- charts/stable/outline/Chart.yaml | 2 +- charts/stable/outline/templates/_secrets.tpl | 23 +++--- charts/stable/outline/values.yaml | 19 ++--- 5 files changed, 59 insertions(+), 65 deletions(-) diff --git a/charts/stable/custom-app/Chart.yaml b/charts/stable/custom-app/Chart.yaml index 4605daebdc2..ffe91948fc6 100644 --- a/charts/stable/custom-app/Chart.yaml +++ b/charts/stable/custom-app/Chart.yaml @@ -19,7 +19,7 @@ name: custom-app sources: - https://github.com/truecharts/charts/tree/master/charts/stable/custom-app type: application -version: 8.0.0 +version: 8.0.1 annotations: truecharts.org/catagories: | - custom diff --git a/charts/stable/custom-app/questions.yaml b/charts/stable/custom-app/questions.yaml index f03ede30bea..0dae3346be1 100644 --- a/charts/stable/custom-app/questions.yaml +++ b/charts/stable/custom-app/questions.yaml @@ -75,14 +75,14 @@ questions: description: "Probe Type" schema: type: string - default: "TCP" + default: "tcp" enum: - - value: "TCP" - description: "TCP" - - value: "HTTP" - description: "HTTP" - - value: "HTTPS" - description: "HTTPS" + - value: "tcp" + description: "tcp" + - value: "http" + description: "http" + - value: "https" + description: "https" - variable: path label: "Probe Path" description: "Probe Path" @@ -109,14 +109,14 @@ questions: description: "Probe Type" schema: type: string - default: "TCP" + default: "tcp" enum: - - value: "TCP" - description: "TCP" - - value: "HTTP" - description: "HTTP" - - value: "HTTPS" - description: "HTTPS" + - value: "tcp" + description: "tcp" + - value: "http" + description: "http" + - value: "https" + description: "https" - variable: path label: "Probe Path" description: "Probe Path" @@ -143,14 +143,14 @@ questions: description: "Probe Type" schema: type: string - default: "TCP" + default: "tcp" enum: - - value: "TCP" - description: "TCP" - - value: "HTTP" - description: "HTTP" - - value: "HTTPS" - description: "HTTPS" + - value: "tcp" + description: "tcp" + - value: "http" + description: "http" + - value: "https" + description: "https" - variable: path label: "Probe Path" description: "Probe Path" @@ -183,16 +183,16 @@ questions: label: "Port Type" schema: type: string - default: "HTTP" + default: "http" enum: - - value: HTTP - description: "HTTP" - - value: "HTTPS" - description: "HTTPS" - - value: TCP - description: "TCP" - - value: "UDP" - description: "UDP" + - value: http + description: "http" + - value: "https" + description: "https" + - value: tcp + description: "tcp" + - value: "udp" + description: "udp" - variable: targetPort label: "Target Port" description: "This port exposes the container port on the service" @@ -232,16 +232,16 @@ questions: label: "Port Type" schema: type: string - default: "TCP" + default: "tcp" enum: - - value: HTTP - description: "HTTP" - - value: "HTTPS" - description: "HTTPS" - - value: TCP - description: "TCP" - - value: "UDP" - description: "UDP" + - value: http + description: "http" + - value: "https" + description: "https" + - value: tcp + description: "tcp" + - value: "udp" + description: "udp" - variable: targetPort label: "Target Port" description: "This port exposes the container port on the service" diff --git a/charts/stable/outline/Chart.yaml b/charts/stable/outline/Chart.yaml index d44498db83c..47d39b5dbb6 100644 --- a/charts/stable/outline/Chart.yaml +++ b/charts/stable/outline/Chart.yaml @@ -25,7 +25,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/outline - https://github.com/outline/outline type: application -version: 7.0.9 +version: 7.0.10 annotations: truecharts.org/catagories: | - productivity diff --git a/charts/stable/outline/templates/_secrets.tpl b/charts/stable/outline/templates/_secrets.tpl index eb4c043b2fb..2f8a26860ab 100644 --- a/charts/stable/outline/templates/_secrets.tpl +++ b/charts/stable/outline/templates/_secrets.tpl @@ -1,18 +1,17 @@ {{/* Define the secrets */}} {{- define "outline.secrets" -}} {{- $secretName := (printf "%s-outline-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }} -{{- $outlineprevious := lookup "v1" "Secret" .Release.Namespace $secretName }} + +{{/* Outline wants a HEX 32 char string */}} +{{- $secret_key := (printf "%x" (randAlphaNum 32)) }} +{{- $utils_secret := (printf "%x" (randAlphaNum 32)) }} +{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) }} + {{- $secret_key = index .data "SECRET_KEY" | b64dec }} + {{- $utils_secret = index .data "UTILS_SECRET" | b64dec }} +{{- end }} enabled: true data: - {{- if $outlineprevious }} - SECRET_KEY: {{ index $outlineprevious.data "SECRET_KEY" | b64dec }} - UTILS_SECRET: {{ index $outlineprevious.data "UTILS_SECRET"| b64dec }} - {{- else }} - {{- $secret_key := randAlphaNum 32 }} - {{- $utils_secret := randAlphaNum 32 }} - {{/* Outline wants a HEX 32 char string */}} - SECRET_KEY: {{ (printf "%x" $secret_key) }} - UTILS_SECRET: {{ (printf "%x" $utils_secret) }} - {{- end }} - + SECRET_KEY: {{ $secret_key }} + UTILS_SECRET: {{ $utils_secret }} + REDIS_CUSTOM_URL: {{ .Values.redis.creds.url | trimAll "\"" }} {{- end -}} diff --git a/charts/stable/outline/values.yaml b/charts/stable/outline/values.yaml index dae60a702e9..1fca0c014b4 100644 --- a/charts/stable/outline/values.yaml +++ b/charts/stable/outline/values.yaml @@ -1,7 +1,7 @@ image: repository: tccr.io/truecharts/outline pullPolicy: IfNotPresent - tag: 0.66.3@sha256:14ffd3c6ab1600700a2c5645d78e94a18b0b2b8313ac9e863c2feba800384a34 + tag: 0.69.0@sha256:94a476351c27c309faca804e4e804b68271b871fab6d245bf94282697633accb service: main: ports: @@ -10,13 +10,11 @@ service: # Enabled redis redis: enabled: true - - redisUsername: outline + redisUsername: default # Enabled postgres cnpg: main: enabled: true - user: outline database: outline @@ -44,9 +42,8 @@ workload: key: std REDIS_URL: secretKeyRef: - expandObjectName: false - name: '{{ printf "%s-%s" .Release.Name "rediscreds" }}' - key: url + name: secrets + key: REDIS_CUSTOM_URL SECRET_KEY: secretKeyRef: name: secrets @@ -56,11 +53,9 @@ workload: name: secrets key: UTILS_SECRET command: - [ - "sh", - "-c", - "yarn sequelize db:migrate --env=production-ssl-disabled", - ] + - sh + - -c + - yarn sequelize db:migrate --env=production-ssl-disabled containers: main: probes: