fix(outline): fix secret (also a fix for custom app) (#8639)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ 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?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ 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._
This commit is contained in:
Stavros Kois
2023-05-01 18:29:23 +03:00
committed by GitHub
parent 75c3d7935b
commit c4d342a5ec
5 changed files with 59 additions and 65 deletions
+1 -1
View File
@@ -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
+39 -39
View File
@@ -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"
+1 -1
View File
@@ -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
+11 -12
View File
@@ -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 -}}
+7 -12
View File
@@ -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: