fix(gotify): BREAKING CHANGE - Rewrite app (#5997)

* fix(gotify) fix user and pass + gui rework.

* conf file

* gui

* fix

* lint

* fixy-fixy

* whops

* add dep

* hmm

* also tet

* env -.-

Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: Stavros kois <s.kois@outlook.com>
This commit is contained in:
Xstar97
2023-01-06 20:44:59 +02:00
committed by GitHub
co-authored by Stavros Kois Stavros kois
parent d9890d8797
commit 488e13c312
7 changed files with 314 additions and 133 deletions
+17 -17
View File
@@ -1,21 +1,5 @@
apiVersion: v2 apiVersion: v2
appVersion: "2.2.2" appVersion: "2.2.2"
version: 11.0.17
kubeVersion: ">=1.16.0-0"
name: gotify
description: a simple server for sending and receiving messages
type: application
home: https://truecharts.org/charts/stable/gotify
keywords:
- server
- gotify
- messages
icon: https://truecharts.org/img/hotlink-ok/chart-icons/gotify.png
sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/gotify
- https://gotify.net/
- https://github.com/gotify/server
- https://hub.docker.com/r/gotify/server
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.truecharts.org repository: https://library-charts.truecharts.org
@@ -24,12 +8,28 @@ dependencies:
name: postgresql name: postgresql
repository: https://charts.truecharts.org/ repository: https://charts.truecharts.org/
version: 11.0.17 version: 11.0.17
deprecated: false
description: A simple server for sending and receiving messages.
home: https://truecharts.org/charts/stable/gotify
icon: https://truecharts.org/img/hotlink-ok/chart-icons/gotify.png
keywords:
- gotify
- notifications
kubeVersion: ">=1.16.0-0"
maintainers: maintainers:
- email: info@truecharts.org - email: info@truecharts.org
name: TrueCharts name: TrueCharts
url: https://truecharts.org url: https://truecharts.org
name: gotify
sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/gotify
- https://gotify.net/
- https://github.com/gotify/server
- https://hub.docker.com/r/gotify/server
type: application
version: 12.0.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- media - notifications
truecharts.org/SCALE-support: "true" truecharts.org/SCALE-support: "true"
truecharts.org/grade: U truecharts.org/grade: U
+148 -64
View File
@@ -8,85 +8,169 @@ questions:
# Include{replicas} # Include{replicas}
# Include{replica1} # Include{replica1}
# Include{controllerExpertExtraArgs} # Include{controllerExpertExtraArgs}
- variable: secretEnv - variable: gotify
group: "App Configuration" group: App Configuration
label: "Image Secrets" label: Gotify Configuration
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: user - variable: user
label: "user" label: Username (First install only)
description: "Sets the user env var" description: Sets the default admin user.
schema: schema:
type: string type: string
default: "admin" default: ""
required: true
- variable: pass - variable: pass
label: "pass" label: Password (First install only)
description: "Sets the pass env var" description: Sets the default admin pass.
schema: schema:
type: string type: string
default: "changeme" default: ""
- variable: env required: true
group: "App Configuration" private: true
label: "Image Environment" - variable: registration
label: Registration
description: Enable / Disable user registration.
schema:
type: boolean
default: true
- variable: password_strength
label: Password Strength
description: The bcrypt password strength (higher = better but also slower).
schema:
type: int
default: 10
- variable: show_advanced
label: Show Advanced Options
description: Shows advanced options that should be changed only if you know what you are doing
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: response_headers
label: Response Headers
description: Response headers are added to every response
schema:
type: list
default: []
items:
- variable: response_header_entry
label: Response Header Entry
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: GOTIFY_SERVER_KEEPALIVEPERIODSECONDS - variable: key
label: "GOTIFY_SERVER_KEEPALIVEPERIODSECONDS" label: Header Key
description: "Sets the GOTIFY_SERVER_KEEPALIVEPERIODSECONDS env var"
schema:
type: int
default: 0
- variable: GOTIFY_SERVER_LISTENADDR
label: "GOTIFY_SERVER_LISTENADDR"
description: "Sets the GOTIFY_SERVER_LISTENADDR env var"
schema: schema:
type: string type: string
default: "" default: ""
- variable: GOTIFY_SERVER_SSL_ENABLED required: true
label: "GOTIFY_SERVER_SSL_ENABLED" - variable: value
description: "Sets the GOTIFY_SERVER_SSL_ENABLED env var" label: Header Value
schema:
type: string
default: ""
required: true
- variable: keep_alive_period_seconds
label: Keep Alive Period Seconds
description: Set the interval in which keepalive packets will be sent. 0 = use Go default (15s); -1 = disable keepalive; Only change this value if you know what you are doing.
schema:
type: int
required: true
default: 0
- variable: stream
label: Stream
schema:
additional_attrs: true
type: dict
attrs:
- variable: show_advanced
label: Show Advanced Options
description: Shows advanced options that should be changed only if you know what you are doing
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: GOTIFY_SERVER_RESPONSEHEADERS show_subquestions_if: true
label: "GOTIFY_SERVER_RESPONSEHEADERS" subquestions:
description: "Sets the GOTIFY_SERVER_RESPONSEHEADERS env var" - variable: ping_period_seconds
schema: label: Ping Period Seconds
type: string description: The interval in which websocket pings will be sent. Only change this value if you know what you are doing.
default: "X-Custom-Header: \"custom value\""
- variable: GOTIFY_SERVER_STREAM_PINGPERIODSECONDS
label: "GOTIFY_SERVER_STREAM_PINGPERIODSECONDS"
description: "Sets the GOTIFY_SERVER_STREAM_PINGPERIODSECONDS env var"
schema: schema:
type: int type: int
required: true
default: 45 default: 45
- variable: GOTIFY_PASSSTRENGTH - variable: allowed_origins
label: "GOTIFY_PASSSTRENGTH" label: Allowed Origins
description: "Sets the GOTIFY_PASSSTRENGTH env var" description: Allowed origins for websocket connections (Same Origin is always allowed, Default is Same Origin)
schema: schema:
type: int type: list
default: 10 default: []
- variable: GOTIFY_UPLOADEDIMAGESDIR items:
label: "GOTIFY_UPLOADEDIMAGESDIR" - variable: allowed_origin_entry
description: "Sets the GOTIFY_UPLOADEDIMAGESDIR env var" label: Allowed Origin Entry
schema: schema:
type: string type: string
default: "data/images" default: ""
- variable: GOTIFY_PLUGINSDIR required: true
label: "GOTIFY_PLUGINSDIR" - variable: cors
description: "Sets the GOTIFY_PLUGINSDIR env var" label: CORS
schema:
additional_attrs: true
type: dict
attrs:
- variable: show_advanced
label: Show Advanced Options
description: Shows advanced options that should be changed only if you know what you are doing
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: allowed_origins
label: Allowed Origins
schema:
type: list
default: []
items:
- variable: allowed_origin_entry
label: Allowed Origin Entry
schema: schema:
type: string type: string
default: "data/plugins" required: true
default: ""
- variable: allowed_methods
label: Allowed Methods
schema:
type: list
default: []
items:
- variable: allowed_method_entry
label: Allowed Method Entry
schema:
type: string
default: ""
required: true
- variable: allowed_headers
label: Allowed Headers
schema:
type: list
default: []
items:
- variable: allowed_header_entry
label: Allowed Header Entry
schema:
type: string
default: ""
required: true
# Include{containerConfig} # Include{containerConfig}
# Include{serviceRoot} # Include{serviceRoot}
- variable: main - variable: main
label: "Main Service" label: Main Service
description: "The Primary service on which the healthcheck runs, often the webUI" description: The Primary service on which the healthcheck runs, often the webUI
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -94,14 +178,14 @@ questions:
# Include{serviceSelectorLoadBalancer} # Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras} # Include{serviceSelectorExtras}
- variable: main - variable: main
label: "Main Service Port Configuration" label: Main Service Port Configuration
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: port - variable: port
label: "Port" label: Port
description: "This port exposes the container port on the service" description: This port exposes the container port on the service
schema: schema:
type: int type: int
default: 10084 default: 10084
@@ -112,8 +196,8 @@ questions:
# Include{serviceList} # Include{serviceList}
# Include{persistenceRoot} # Include{persistenceRoot}
- variable: data - variable: data
label: "App Data Storage" label: App Data Storage
description: "Stores the Application Data." description: Stores the Application Data.
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -122,7 +206,7 @@ questions:
# Include{persistenceList} # Include{persistenceList}
# Include{ingressRoot} # Include{ingressRoot}
- variable: main - variable: main
label: "Main Ingress" label: Main Ingress
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -134,41 +218,41 @@ questions:
# Include{security} # Include{security}
# Include{securityContextAdvancedRoot} # Include{securityContextAdvancedRoot}
- variable: privileged - variable: privileged
label: "Privileged mode" label: Privileged mode
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: readOnlyRootFilesystem - variable: readOnlyRootFilesystem
label: "ReadOnly Root Filesystem" label: ReadOnly Root Filesystem
schema: schema:
type: boolean type: boolean
default: true default: true
- variable: allowPrivilegeEscalation - variable: allowPrivilegeEscalation
label: "Allow Privilege Escalation" label: Allow Privilege Escalation
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: runAsNonRoot - variable: runAsNonRoot
label: "runAsNonRoot" label: runAsNonRoot
schema: schema:
type: boolean type: boolean
default: true default: true
# Include{podSecurityContextRoot} # Include{podSecurityContextRoot}
- variable: runAsUser - variable: runAsUser
label: "runAsUser" label: runAsUser
description: "The UserID of the user running the application" description: The UserID of the user running the application
schema: schema:
type: int type: int
default: 568 default: 568
- variable: runAsGroup - variable: runAsGroup
label: "runAsGroup" label: runAsGroup
description: "The groupID this App of the user running the application" description: The groupID this App of the user running the application
schema: schema:
type: int type: int
default: 568 default: 568
- variable: fsGroup - variable: fsGroup
label: "fsGroup" label: fsGroup
description: "The group that should own ALL storage." description: The group that should own ALL storage.
schema: schema:
type: int type: int
default: 568 default: 568
@@ -1,13 +0,0 @@
{{- define "gotify.configmap" }}
{{ $url := ( .Values.postgresql.url.plain | trimAll "\"" ) }}
{{ $password := ( .Values.postgresql.postgresqlPassword | trimAll "\"" ) }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gotifyenv
data:
GOTIFY_DATABASE_CONNECTION: "host={{ $url }} port=5432 user={{ .Values.postgresql.postgresqlUsername }} dbname={{ .Values.postgresql.postgresqlDatabase }} password={{ $password }} sslmode=disable"
GOTIFY_DATABASE_DIALECT: "postgres"
{{- end }}
@@ -0,0 +1,83 @@
{{/* Define the secret */}}
{{- define "gotify.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }}
{{- $secretEnvName := printf "%s-secret-env" (include "tc.common.names.fullname" .) }}
{{- $url := (.Values.postgresql.url.plain | trimAll "\"") }}
{{- $password := (.Values.postgresql.postgresqlPassword | trimAll "\"") }}
{{- $dbuser := .Values.postgresql.postgresqlUsername }}
{{- $dbname := .Values.postgresql.postgresqlDatabase }}
{{- $port := .Values.service.main.ports.main.port }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretEnvName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
stringData: {{/* Env takes precedence, and it;s defined in Dockerfile as 80 */}}
GOTIFY_SERVER_PORT: {{ $port | quote }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
stringData:
config.yml: |
server:
listenaddr: ""
keepaliveperiodseconds: {{ .Values.gotify.keep_alive_period_seconds }}
port: {{ $port }}
{{- with .Values.gotify.response_headers }}
responseheaders:
{{- range $item := . }}
{{ $item.key }}: {{ $item.value | quote }}
{{- end }}
{{- end }}
ssl:
enabled: false
stream:
pingperiodseconds: {{ .Values.gotify.stream.ping_period_seconds }}
{{- with .Values.gotify.stream.allowed_origins }}
allowedorigins:
{{- range $item := . }}
- {{ $item | quote }}
{{- end }}
{{- end }}
{{- if or .Values.gotify.cors.allowed_origins .Values.gotify.cors.allowed_methods .Values.gotify.cors.allowed_headers }}
cors:
{{- with .Values.gotify.cors.allowed_origins }}
alloworigins:
{{- range $item := . }}
- {{ $item | quote }}
{{- end }}
{{- end }}
{{- with .Values.gotify.cors.allowed_methods }}
allowmethods:
{{- range $item := . }}
- {{ $item | quote }}
{{- end }}
{{- end }}
{{- with .Values.gotify.cors.allowed_headers }}
allowheaders:
{{- range $item := . }}
- {{ $item | quote }}
{{- end }}
{{- end }}
{{- end }}
database:
dialect: postgres
connection: {{ printf "host=%s port=5432 user=%s dbname=%s password=%s sslmode=disable" $url $dbuser $dbname $password }}
uploadedimagesdir: {{ printf "%s/images" .Values.persistence.data.mountPath }}
{{- if .Values.gotify.plugins_enabled }}
pluginsdir: {{ printf "%s/plugins" .Values.persistence.data.mountPath }}
{{- end }}
defaultuser:
name: {{ .Values.gotify.user }}
pass: {{ .Values.gotify.pass }}
passstrength: {{ .Values.gotify.password_strength }}
registration: {{ .Values.gotify.registration }}
{{- end -}}
+3 -2
View File
@@ -1,7 +1,8 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }} {{- include "tc.common.loader.init" . }}
{{/* Render configmap for nextcloud */}} {{/* Render secret */}}
{{- include "gotify.configmap" . }} {{- include "gotify.secret" . }}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }} {{ include "tc.common.loader.apply" . }}
+50 -25
View File
@@ -3,46 +3,71 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: 2.2.2@sha256:740c2e6236b0d197f2c43b39714b802161fdfec17866dade32966ed4d2c9a7d1 tag: 2.2.2@sha256:740c2e6236b0d197f2c43b39714b802161fdfec17866dade32966ed4d2c9a7d1
secretEnv: gotify:
user: "admin" user: admin
pass: "admin" pass: admin
registration: false
env: password_strength: 10
GOTIFY_SERVER_PORT: 8080 # Advanced
GOTIFY_SERVER_KEEPALIVEPERIODSECONDS: 0 response_headers:
GOTIFY_SERVER_LISTENADDR: "" []
GOTIFY_SERVER_SSL_ENABLED: false # - key: X-Custom-Header
# lists are a little weird but do-able (: # value: "custom value"
# GOTIFY_SERVER_SSL_LETSENCRYPT_HOSTS: "- mydomain.tld\n- myotherdomain.tld" keep_alive_period_seconds: 0
GOTIFY_SERVER_RESPONSEHEADERS: 'X-Custom-Header: "custom value"' stream:
# GOTIFY_SERVER_CORS_ALLOWORIGINS: "- \".+.example.com\"\n- \"otherdomain.com\"" ping_period_seconds: 45
# GOTIFY_SERVER_CORS_ALLOWMETHODS: "- \"GET\"\n- \"POST\"" allowed_origins:
# GOTIFY_SERVER_CORS_ALLOWHEADERS: "- \"Authorization\"\n- \"content-type\"" []
# GOTIFY_SERVER_STREAM_ALLOWEDORIGINS: "- \".+.example.com\"\n- \"otherdomain.com\"" # - example.com
GOTIFY_SERVER_STREAM_PINGPERIODSECONDS: 45 # - domain.com
GOTIFY_PASSSTRENGTH: 10 cors:
GOTIFY_UPLOADEDIMAGESDIR: "data/images" allowed_origins:
GOTIFY_PLUGINSDIR: "data/plugins" []
# - ".+.example.com"
# - "otherdomain.com"
allowed_methods:
[]
# - GET
# - POST
allowed_headers:
[]
# - Authorization
# - content-type
envFrom: envFrom:
- configMapRef: - secretRef:
name: gotifyenv name: '{{ include "tc.common.names.fullname" . }}-secret-env'
probes:
liveness:
path: /health
readiness:
path: /health
startup:
path: /health
service: service:
main: main:
ports: ports:
main: main:
port: 10084 port: 10084
targetPort: 8080
persistence: persistence:
data: data:
enabled: true enabled: true
mountPath: "/app/data" mountPath: /app/data
config-file:
enabled: true
type: secret
readOnly: true
defaultMode: "0600"
objectName: '{{ include "tc.common.names.fullname" . }}-secret'
mountPath: /etc/gotify/config.yml
subPath: config.yml
postgresql: postgresql:
enabled: true enabled: true
existingSecret: "dbcreds" existingSecret: dbcreds
postgresqlUsername: gotify postgresqlUsername: gotify
postgresqlDatabase: gotify postgresqlDatabase: gotify
+1
View File
@@ -77,6 +77,7 @@ words:
- gibibyte - gibibyte
- gluster - gluster
- goauthentik - goauthentik
- Gotify
- Groupname - Groupname
- gunicorn - gunicorn
- healthcheck - healthcheck