Skip to content

Commit 4a0d411

Browse files
authored
Merge pull request #27 from small-hack/add-app-key-setting
add APP_KEY generation and parameter
2 parents 2996d0b + 6fd112d commit 4a0d411

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

charts/pixelfed/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.11.1
18+
version: 0.12.0
1919

2020
# This is the version number of the application being deployed.
2121
# renovate:image=ghcr.io/mattlqx/docker-pixelfed

charts/pixelfed/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pixelfed
22

3-
![Version: 0.11.1](https://img.shields.io/badge/Version-0.11.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.12.4-nginx](https://img.shields.io/badge/AppVersion-v0.12.4--nginx-informational?style=flat-square)
3+
![Version: 0.12.0](https://img.shields.io/badge/Version-0.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.12.4-nginx](https://img.shields.io/badge/AppVersion-v0.12.4--nginx-informational?style=flat-square)
44

55
A Helm chart for deploying Pixelfed on Kubernetes
66

@@ -80,6 +80,9 @@ A Helm chart for deploying Pixelfed on Kubernetes
8080
| pixelfed.admin_domain | string | `""` | domain of admin interface |
8181
| pixelfed.app.domain | string | `""` | The domain of your server, without https:// |
8282
| pixelfed.app.env | string | `"production"` | The app environment, keep it set to "production" |
83+
| pixelfed.app.existingSecret | string | `""` | use an existing Kuberentes Secret to store the app key If set, ignores pixelfed.app.key |
84+
| pixelfed.app.existingSecretKey | string | `""` | key in pixelfed.app.existingSecret to use for the app key |
85+
| pixelfed.app.key | string | `""` | This key is used by the Illuminate encrypter service and should be set to a random, 32 character string, otherwise these encrypted strings will not be safe. If you don't generate one, we'll generate one for you however it will change everytime you upgrade the helm chart, so it should only be used for testing. In production, please set this, or pixelfed.app.existingSecret |
8386
| pixelfed.app.locale | string | `"en"` | change this to the language code of your pixelfed instance |
8487
| pixelfed.app.name | string | `"Pixelfed"` | The name of your server/instance |
8588
| pixelfed.app.url | string | `"https://localhost"` | change this to the domain of your pixelfed instance |

charts/pixelfed/templates/deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ spec:
6767
{{- toYaml . | nindent 12 }}
6868
{{- end }}
6969

70+
# pixelfed app key
71+
- name: APP_KEY
72+
valueFrom:
73+
secretKeyRef:
74+
{{- if and .Values.pixelfed.app.existingSecret .Values.pixelfed.app.existingSecretKey }}
75+
name: {{ .Values.pixelfed.app.existingSecret }}
76+
key: {{ .Values.pixelfed.app.existingSecretKey }}
77+
{{- else }}
78+
name: {{ include "pixelfed.fullname" . }}-app-key
79+
key: key
80+
{{- end }}
81+
7082
# valkey AKA redis
7183
{{- if and .Values.externalValkey.enabled .Values.externalValkey.existingSecretKeys.host }}
7284
- name: REDIS_HOST
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if not .Values.pixelfed.app.existingSecret }}
2+
---
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: {{ include "pixelfed.fullname" . }}-app-key
7+
data:
8+
{{ if .Values.pixelfed.app.key }}
9+
key: {{ .Values.pixelfed.app.key | b64enc }}
10+
{{- else }}
11+
key: {{ randAlphaNum 32 | b64enc }}
12+
{{- end }}
13+
{{- end }}

charts/pixelfed/values.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@ podLabels: {}
5454

5555
# -- securityContext for the whole pod
5656
podSecurityContext: {}
57-
# fsGroup: 2000
57+
# runAsUser: 33
58+
# runAsGroup: 33
59+
# fsGroup: 33
5860

5961
# -- securityContext for the pixelfed container
6062
securityContext: {}
63+
# runAsUser: 33
64+
# runAsNonRoot: true
65+
# readOnlyRootFilesystem: true
6166
# capabilities:
6267
# drop:
6368
# - ALL
64-
# readOnlyRootFilesystem: true
65-
# runAsNonRoot: true
66-
# runAsUser: 1000
6769

6870
# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
6971
service:
@@ -305,6 +307,17 @@ pixelfed:
305307

306308
# app specific settings
307309
app:
310+
# -- This key is used by the Illuminate encrypter service and should
311+
# be set to a random, 32 character string, otherwise these encrypted strings
312+
# will not be safe. If you don't generate one, we'll generate one for you
313+
# however it will change everytime you upgrade the helm chart, so it should
314+
# only be used for testing. In production, please set this, or pixelfed.app.existingSecret
315+
key: ""
316+
# -- use an existing Kuberentes Secret to store the app key
317+
# If set, ignores pixelfed.app.key
318+
existingSecret: ""
319+
# -- key in pixelfed.app.existingSecret to use for the app key
320+
existingSecretKey: ""
308321
# -- The name of your server/instance
309322
name: "Pixelfed"
310323
# -- The app environment, keep it set to "production"

0 commit comments

Comments
 (0)