fix(anonaddy) fix secret and app key **BREAKING CHANGES** (#12189)
**Description** A breaking change due to the secrets need to be larger due the issue Uncaught RuntimeException: Unsupported cipher or incorrect key length. ⚒️ Fixes # <!--(issue)--> **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [X] 🪛 Bugfix - [X] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [X] 🔃 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:** - [X] ⚖️ My code follows the style guidelines of this project - [X] 👀 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 - [X] ⬆️ 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:
@@ -26,7 +26,7 @@ name: anonaddy
|
||||
sources:
|
||||
- https://github.com/truecharts/charts/tree/master/charts/stable/anonaddy
|
||||
- https://github.com/anonaddy/docker
|
||||
version: 14.0.0
|
||||
version: 15.0.0
|
||||
annotations:
|
||||
truecharts.org/catagories: |
|
||||
- email
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{{/*
|
||||
This template generates a random password and ensures it persists across updates/edits to the chart
|
||||
*/}}
|
||||
{{- define "anonaddy.appkey" -}}
|
||||
enabled: true
|
||||
{{- $keyprevious := lookup "v1" "Secret" .Release.Namespace "appkey" }}
|
||||
{{- $appkey := "" }}
|
||||
{{- $secret := "" }}
|
||||
data:
|
||||
{{- if $keyprevious }}
|
||||
{{- $appkey = ( index $keyprevious.data "appkey" ) }}
|
||||
{{- $secret = ( index $keyprevious.data "secret" ) }}
|
||||
appkey: {{ ( index $keyprevious.data "appkey" ) }}
|
||||
secret: {{ ( index $keyprevious.data "secret" ) }}
|
||||
{{- else }}
|
||||
{{- $appkey = randAlphaNum 32 }}
|
||||
{{- $secret = randAlphaNum 32 }}
|
||||
appkey: {{ $appkey | b64enc }}
|
||||
secret: {{ $secret | b64enc }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
16
charts/stable/anonaddy/templates/_secrets.tpl
Normal file
16
charts/stable/anonaddy/templates/_secrets.tpl
Normal file
@@ -0,0 +1,16 @@
|
||||
{{/* Define the secrets */}}
|
||||
{{- define "anonaddy.secrets" -}}
|
||||
{{- $secretName := (printf "%s-anonaddy-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }}
|
||||
|
||||
{{- $appKey := randAlphaNum 64 -}}
|
||||
{{- $secretKey := randAlphaNum 64 -}}
|
||||
|
||||
{{- with lookup "v1" "Secret" .Release.Namespace $secretName -}}
|
||||
{{- $authKey = index .data "APP_KEY" | b64dec -}}
|
||||
{{- $secretKey = index .data "ANONADDY_SECRET" | b64dec -}}
|
||||
{{- end }}
|
||||
enabled: true
|
||||
data:
|
||||
APP_KEY: {{ $appKey }}
|
||||
ANONADDY_SECRET: {{ $secretKey }}
|
||||
{{- end -}}
|
||||
@@ -1,11 +1,11 @@
|
||||
{{/* Make sure all variables are set properly */}}
|
||||
{{- include "tc.v1.common.loader.init" . }}
|
||||
{{- include "tc.v1.common.loader.init" . -}}
|
||||
|
||||
{{/* Render appkey for anonaddy */}}
|
||||
{{- $secret := include "anonaddy.appkey" . | fromYaml -}}
|
||||
{{- if $secret -}}
|
||||
{{- $_ := set .Values.secret "appkey" $secret -}}
|
||||
{{/* Render secrets for anonaddy */}}
|
||||
{{- $secrets := include "anonaddy.secrets" . | fromYaml -}}
|
||||
{{- if $secrets -}}
|
||||
{{- $_ := set .Values.secret "anonaddy-secrets" $secrets -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Render the templates */}}
|
||||
{{ include "tc.v1.common.loader.apply" . }}
|
||||
{{- include "tc.v1.common.loader.apply" . -}}
|
||||
|
||||
@@ -65,22 +65,18 @@ workload:
|
||||
key: redis-password
|
||||
APP_KEY:
|
||||
secretKeyRef:
|
||||
name: appkey
|
||||
key: appkey
|
||||
name: anonaddy-secrets
|
||||
key: APP_KEY
|
||||
ANONADDY_SECRET:
|
||||
secretKeyRef:
|
||||
name: appkey
|
||||
key: secret
|
||||
name: anonaddy-secrets
|
||||
key: ANONADDY_SECRET
|
||||
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
mountPath: /config
|
||||
|
||||
portal:
|
||||
open:
|
||||
enabled: true
|
||||
|
||||
redis:
|
||||
enabled: true
|
||||
|
||||
@@ -88,3 +84,7 @@ mariadb:
|
||||
enabled: true
|
||||
mariadbUsername: anonaddy
|
||||
mariadbDatabase: anonaddy
|
||||
|
||||
portal:
|
||||
open:
|
||||
enabled: true
|
||||
|
||||
Reference in New Issue
Block a user