feat(vikunja): BREAKING CHANGE - allow custom yaml to some extent and use a config file to provide all available features (#6607)

* feat(vikunja): switch to configfile and restructure

* extent values

* more values

* remove extra's. all is exposed anyway

* pre-commit

* lint

* add service

* fix

* fix

* more quests

* add moer

* bump

* openID

* migration

* port

* whops

---------

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
Stavros Kois
2023-02-28 10:14:10 +02:00
committed by GitHub
parent 62af7f69b3
commit ca0cc83ecb
5 changed files with 1159 additions and 283 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ name: vikunja
sources: sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/vikunja - https://github.com/truecharts/charts/tree/master/charts/stable/vikunja
- https://vikunja.io/docs - https://vikunja.io/docs
version: 6.0.34 version: 7.0.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- productivity - productivity
File diff suppressed because it is too large Load Diff
+179 -10
View File
@@ -1,20 +1,189 @@
{{/* Define the secrets */}} {{/* Define the secrets */}}
{{- define "vikunja.secrets" -}} {{- define "vikunja.secrets" -}}
---
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) -}}
{{- $secretStorage := printf "%s-storage-secret" (include "tc.common.names.fullname" .) -}}
{{- $jwtSecret := randAlphaNum 32 -}}
{{- with lookup "v1" "Secret" .Release.Namespace $secretStorage -}}
{{- $jwtSecret = index .data "JWT_SECRET" | b64dec -}}
{{- end }}
---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
type: Opaque type: Opaque
metadata: metadata:
name: vikunja-secrets name: {{ $secretStorage }}
{{- $vikunjaprevious := lookup "v1" "Secret" .Release.Namespace "vikunja-secrets" }} labels:
{{- $jwt_secret := "" }} {{- include "tc.common.labels" . | nindent 4 }}
data: data:
{{- if $vikunjaprevious}} JWT_SECRET: {{ $jwtSecret | b64enc }}
VIKUNJA_SERVICE_JWT_SECRET: {{ index $vikunjaprevious.data "VIKUNJA_SERVICE_JWT_SECRET" }} ---
{{- else }} apiVersion: v1
{{- $jwt_secret := randAlphaNum 32 }} kind: Secret
VIKUNJA_SERVICE_JWT_SECRET: {{ $jwt_secret | b64enc }} type: Opaque
{{- end }} metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
stringData:
config.yml: |
database:
type: postgres
user: {{ .Values.postgresql.postgresqlUsername }}
password: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" }}
host: {{ printf "%v-%v" .Release.Name "postgres" }}
cache:
enabled: true
type: redis
redis:
enabled: true
host: {{ printf "%v-%v:%v" .Release.Name "redis" "6379" }}
password: {{ .Values.redis.redisPassword | trimAll "\""}}
db: 0
keyvalue:
type: redis
service:
interface: ":3456"
JWTSecret: {{ $jwtSecret }}
timezone: {{ .Values.TZ | quote }}
jwtttl: {{ .Values.vikunja.service.jwtttl | int }}
jwtttllong: {{ .Values.vikunja.service.jwtttllong | int }}
frontendurl: {{ .Values.vikunja.service.frontendurl | quote }}
maxitemsperpage: {{ .Values.vikunja.service.maxitemsperpage }}
enablecaldav: {{ .Values.vikunja.service.enablecaldav }}
motd: {{ .Values.vikunja.service.motd | quote }}
enablelinksharing: {{ .Values.vikunja.service.enablelinksharing }}
enableregistration: {{ .Values.vikunja.service.enableregistration }}
enabletaskattachments: {{ .Values.vikunja.service.enabletaskattachments }}
enabletaskcomments: {{ .Values.vikunja.service.enabletaskcomments }}
enabletotp: {{ .Values.vikunja.service.enabletotp }}
enableemailreminders: {{ .Values.vikunja.service.enableemailreminders }}
enableuserdeletion: {{ .Values.vikunja.service.enableuserdeletion }}
maxavatarsize: {{ .Values.vikunja.service.maxavatarsize }}
metrics:
enabled: {{ .Values.metrics.enabled }}
cors:
enabled: {{ .Values.vikunja.cors.enabled }}
{{- with .Values.vikunja.cors.origins }}
origins:
{{- range . }}
- {{ . | quote }}
{{- end }}
{{- else }}
origins: []
{{- end }}
maxage: {{ .Values.vikunja.cors.maxage }}
mailer:
enabled: {{ .Values.vikunja.mailer.enabled }}
host: {{ .Values.vikunja.mailer.host | quote }}
port: {{ .Values.vikunja.mailer.port }}
authtype: {{ .Values.vikunja.mailer.authtype | quote }}
username: {{ .Values.vikunja.mailer.username | quote }}
password: {{ .Values.vikunja.mailer.password | quote }}
skiptlsverify: {{ .Values.vikunja.mailer.skiptlsverify }}
fromemail: {{ .Values.vikunja.mailer.fromemail | quote }}
queuelength: {{ .Values.vikunja.mailer.queuelength }}
queuetimeout: {{ .Values.vikunja.mailer.queuetimeout }}
forcessl: {{ .Values.vikunja.mailer.forcessl }}
log:
enabled: {{ .Values.vikunja.log.enabled }}
path: {{ .Values.vikunja.log.path | quote }}
standard: {{ .Values.vikunja.log.standard | quote }}
level: {{ .Values.vikunja.log.level | quote }}
database: {{ .Values.vikunja.log.database | quote }}}
databaselevel: {{ .Values.vikunja.log.databaselevel | quote }}
http: {{ .Values.vikunja.log.http | quote }}
echo: {{ .Values.vikunja.log.echo | quote }}}
events: {{ .Values.vikunja.log.events | quote }}
eventslevel: {{ .Values.vikunja.log.eventslevel | quote }}
ratelimit:
enabled: {{ .Values.vikunja.ratelimit.enabled }}}
kind: {{ .Values.vikunja.ratelimit.kind | quote }}
period: {{ .Values.vikunja.ratelimit.period }}
limit: {{ .Values.vikunja.ratelimit.limit }}
store: redis
files:
maxsize: {{ .Values.vikunja.files.maxsize }}
avatar:
gravatarexpiration: {{ .Values.vikunja.avatar.gravatarexpiration }}
legal:
imprinturl: {{ .Values.vikunja.legal.imprinturl | quote }}
privacyurl: {{ .Values.vikunja.legal.privacyurl | quote }}
backgrounds:
enabled: {{ .Values.vikunja.backgrounds.enabled }}
providers:
upload:
enabled: {{ .Values.vikunja.backgrounds.providers.upload.enabled }}
unsplash:
enabled: {{ .Values.vikunja.backgrounds.providers.unsplash.enabled }}
accesstoken: {{ .Values.vikunja.backgrounds.providers.unsplash.accesstoken | quote }}
applicationid: {{ .Values.vikunja.backgrounds.providers.unsplash.applicationid | quote }}
migration:
todoist:
enable: {{ .Values.vikunja.migration.todoist.enable }}
clientid: {{ .Values.vikunja.migration.todoist.clientid | quote }}
clientsecret: {{ .Values.vikunja.migration.todoist.clientsecret | quote }}
redirecturl: {{ .Values.vikunja.migration.todoist.redirecturl | quote }}
trello:
enable: {{ .Values.vikunja.migration.trello.enable }}
key: {{ .Values.vikunja.migration.trello.key | quote }}
redirecturl: {{ .Values.vikunja.migration.trello.redirecturl | quote }}
microsofttodo:
enable: {{ .Values.vikunja.migration.microsofttodo.enable }}
clientid: {{ .Values.vikunja.migration.microsofttodo.clientid | quote }}
clientsecret: {{ .Values.vikunja.migration.microsofttodo.clientsecret | quote }}
redirecturl: {{ .Values.vikunja.migration.microsofttodo.redirecturl | quote }}
auth:
local:
enabled: {{ .Values.vikunja.auth.local.enabled }}
openid:
enabled: {{ .Values.vikunja.auth.openid.enabled }}
{{- with .Values.vikunja.auth.openid.redirecturl }}
redirecturl: {{ . | quote }}
{{- end }}
{{- with .Values.vikunja.auth.openid.providers }}
providers:
{{- range . }}
- name: {{ .name | quote }}
authurl: {{ .authurl | quote }}
{{- with .logouturl }}
logouturl: {{ . | quote }}
{{- end }}
clientid: {{ .clientid | quote }}
clientsecret: {{ .clientsecret | quote }}
{{- end }}
{{- end }}
defaultsettings:
avatar_provider: {{ .Values.vikunja.defaultsettings.avatar_provider | quote }}
avatar_file_id: {{ .Values.vikunja.defaultsettings.avatar_file_id }}
email_reminders_enabled: {{ .Values.vikunja.defaultsettings.email_reminders_enabled }}
discoverable_by_name: {{ .Values.vikunja.defaultsettings.discoverable_by_name }}
discoverable_by_email: {{ .Values.vikunja.defaultsettings.discoverable_by_email }}
overdue_tasks_reminders_enabled: {{ .Values.vikunja.defaultsettings.overdue_tasks_reminders_enabled }}
overdue_tasks_reminders_time: {{ .Values.vikunja.defaultsettings.overdue_tasks_reminders_time | quote }}
default_list_id: {{ .Values.vikunja.defaultsettings.default_list_id }}
week_start: {{ .Values.vikunja.defaultsettings.week_start }}
{{- with .Values.vikunja.defaultsettings.language }}
language: {{ . | quote }}
{{- end }}
{{- with .Values.vikunja.defaultsettings.timezone }}
timezone: {{ . | quote }}
{{- end }}
{{- end -}} {{- end -}}
+155 -72
View File
@@ -21,88 +21,139 @@ podSecurityContext:
runAsGroup: 0 runAsGroup: 0
configmap: configmap:
config: nginx-config:
enabled: true enabled: true
data: data:
nginx-config: |- nginx-config: |
server { server {
listen 8080; listen {{ .Values.service.main.ports.main.port }};
location / { location / {
proxy_pass http://localhost:80; proxy_pass http://localhost:80;
} }
location ~* ^/(api|dav|\.well-known)/ { location ~* ^/(api|dav|\.well-known)/ {
proxy_pass http://localhost:3456; proxy_pass http://localhost:3456;
client_max_body_size {{ .Values.env.VIKUNJA_FILES_MAXSIZE | upper | trimSuffix "B" }}; client_max_body_size {{ .Values.vikunja.files.maxsize | upper | trimSuffix "B" }};
} }
} }
env: vikunja:
VIKUNJA_REDIS_ENABLED: 1 service:
VIKUNJA_CACHE_ENABLED: 1 jwtttl: 259200
VIKUNJA_CACHE_TYPE: "redis" jwtttllong: 2592000
VIKUNJA_DATABASE_TYPE: "postgres" motd: Welcome to your new Vikunja instance
VIKUNJA_DATABASE_USER: "{{ .Values.postgresql.postgresqlUsername }}" frontendurl: http://localhost:10220
VIKUNJA_DATABASE_DATABASE: "{{ .Values.postgresql.postgresDatabase }}" maxitemsperpage: 50
VIKUNJA_SERVICE_TIMEZONE: "{{ .Values.TZ }}" enablecaldav: true
# User Defined enablelinksharing: true
VIKUNJA_SERVICE_FRONTENDURL: "http://localhost:8080" enableregistration: true
VIKUNJA_SERVICE_JWTTTL: 259200 enabletaskattachments: true
VIKUNJA_SERVICE_JWTTTLLONG: 2592000 enabletaskcomments: true
VIKUNJA_SERVICE_MAXITEMSPERPAGE: 50 enabletotp: true
VIKUNJA_FILES_MAXSIZE: "20MB" enableemailreminders: true
VIKUNJA_SERVICE_ENABLECALDAV: true enableuserdeletion: true
VIKUNJA_SERVICE_ENABLELINKSHARING: true maxavatarsize: 1024
VIKUNJA_SERVICE_ENABLEREGISTRATION: true cors:
VIKUNJA_SERVICE_ENABLETASKATTACHMENTS: true enabled: true
VIKUNJA_SERVICE_ENABLETASKCOMMENTS: true origins: []
VIKUNJA_SERVICE_ENABLETOTP: true maxage: 0
VIKUNJA_SERVICE_ENABLEEMAILREMINDERS: true ratelimit:
VIKUNJA_SERVICE_ENABLEUSERDELETION: true enabled: false
VIKUNJA_BACKGROUNDS_ENABLED: true kind: user
VIKUNJA_RATELIMIT_ENABLED: false period: 60
VIKUNJA_RATELIMIT_PERIOD: 60 limit: 100
VIKUNJA_RATELIMIT_LIMIT: 100 files:
# VIKUNJA_MAILER_HOST: "" maxsize: 20MB
# VIKUNJA_MAILER_PORT: 587 avatar:
# VIKUNJA_MAILER_USERNAME: "" gravatarexpiration: 3600
# VIKUNJA_MAILER_PASSWORD: "" legal:
# VIKUNJA_MAILER_FROMEMAIL: "" imprinturl: ""
# VIKUNJA_MAILER_SKIPTLSVERIFY: false privacyurl: ""
# VIKUNJA_MAILER_FORCESSL: false mailer:
# VIKUNJA_MAILER_QUEUELENGTH: 100 enabled: false
# VIKUNJA_MAILER_QUEUETIMEOUT: 30 host: ""
VIKUNJA_DATABASE_HOST: port: 587
secretKeyRef: authtype: plain
name: dbcreds username: ""
key: plainhost password: ""
VIKUNJA_DATABASE_PASSWORD: fromemail: ""
secretKeyRef: skiptlsverify: false
name: dbcreds forcessl: true
key: postgresql-password queuelength: 100
VIKUNJA_REDIS_HOST: queuetimeout: 30
secretKeyRef: log:
name: rediscreds enabled: true
key: plainporthost path: /app/vikunja/logs
VIKUNJA_REDIS_PASSWORD: standard: stdout
secretKeyRef: level: INFO
name: rediscreds database: "off"
key: redis-password databaselevel: WARNING
VIKUNJA_SERVICE_JWT_SECRET: http: stdout
secretKeyRef: echo: "off"
name: vikunja-secrets events: stdout
key: VIKUNJA_SERVICE_JWT_SECRET eventslevel: info
defaultsettings:
avatar_provider: initials
avatar_file_id: 0
email_reminders_enabled: false
discoverable_by_name: false
discoverable_by_email: false
overdue_tasks_reminders_enabled: true
overdue_tasks_reminders_time: "9:00"
default_list_id: 0
week_start: 0
language: ""
timezone: ""
backgrounds:
enabled: true
providers:
upload:
enabled: true
unsplash:
enabled: false
accesstoken: ""
applicationid: ""
auth:
local:
enabled: true
openid:
enabled: false
redirecturl: ""
providers:
[]
# - name: ""
# authurl: ""
# logouturl: ""
# clientid: ""
# clientsecret: ""
migration:
todoist:
enable: false
clientid: ""
clientsecret: ""
redirecturl: ""
trello:
enable: false
key: ""
redirecturl: ""
microsofttodo:
enable: false
clientid: ""
clientsecret: ""
redirecturl: ""
service: service:
main: main:
ports: ports:
main: main:
port: 10220 port: 10220
targetPort: 8080
additionalContainers: additionalContainers:
frontend: frontend:
name: frontend name: frontend
image: "{{ .Values.frontendImage.repository }}:{{ .Values.frontendImage.tag }}" image: "{{ .Values.frontendImage.repository }}:{{ .Values.frontendImage.tag }}"
ports:
- containerPort: 80
name: http
proxy: proxy:
name: proxy name: proxy
image: "{{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }}" image: "{{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }}"
@@ -110,33 +161,65 @@ additionalContainers:
- containerPort: 8080 - containerPort: 8080
name: main name: main
volumeMounts: volumeMounts:
- name: vikunja-config - name: vikunja-nginx
mountPath: "/etc/nginx/conf.d/default.conf" mountPath: /etc/nginx/conf.d/default.conf
subPath: nginx-config subPath: nginx-config
readOnly: true readOnly: true
persistence: persistence:
files: files:
enabled: true enabled: true
mountPath: "/app/vikunja/files" mountPath: /app/vikunja/files
vikunja-nginx:
enabled: true
noMount: true
mountPath: /etc/nginx/conf.d/default.conf
subPath: nginx-config
type: configMap
objectName: '{{ template "tc.common.names.fullname" . }}-nginx-config'
vikunja-config: vikunja-config:
enabled: "true" enabled: true
mountPath: "/etc/nginx/conf.d/default.conf" mountPath: /etc/vikunja
subPath: "nginx-config" subPath: config.yml
type: "custom" type: secret
volumeSpec: objectName: '{{ template "tc.common.names.fullname" . }}-secret'
configMap:
name: '{{ printf "%v-config" (include "tc.common.names.fullname" .) }}' metrics:
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
# @default -- See values.yaml
enabled: true
serviceMonitor:
interval: 1m
scrapeTimeout: 30s
labels: {}
# -- Enable and configure Prometheus Rules for the chart under this key.
# @default -- See values.yaml
prometheusRule:
enabled: false
labels: {}
# -- Configure additionial rules for the chart under this key.
# @default -- See prometheusrules.yaml
rules:
[]
# - alert: UnifiPollerAbsent
# annotations:
# description: Unifi Poller has disappeared from Prometheus service discovery.
# summary: Unifi Poller is down.
# expr: |
# absent(up{job=~".*unifi-poller.*"} == 1)
# for: 5m
# labels:
# severity: critical
postgresql: postgresql:
enabled: true enabled: true
existingSecret: "dbcreds" existingSecret: dbcreds
postgresqlUsername: vikunja postgresqlUsername: vikunja
postgresqlDatabase: vikunja postgresqlDatabase: vikunja
redis: redis:
enabled: true enabled: true
existingSecret: "rediscreds" existingSecret: rediscreds
portal: portal:
enabled: true enabled: true
+2
View File
@@ -274,6 +274,7 @@ words:
- themenamehere - themenamehere
- tlsoptions - tlsoptions
- tlsstores - tlsstores
- TOTP
- traefik - traefik
- traefikservices - traefikservices
- Traggo - Traggo
@@ -292,6 +293,7 @@ words:
- valheim - valheim
- vaultwarden - vaultwarden
- vdev - vdev
- vikunja
- vm's - vm's
- wakeup - wakeup
- watchyourlan - watchyourlan