Skip to content

Commit

Permalink
add managing config.ini file as part of chart
Browse files Browse the repository at this point in the history
  • Loading branch information
perfectra1n committed Sep 18, 2024
1 parent 39f9cb4 commit 6cf9ce4
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
44 changes: 44 additions & 0 deletions charts/trilium/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{- define "trilium.configini" -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-config
labels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
data:
config.ini: |
[General]
# Instance name can be used to distinguish between different instances using backend api.getInstanceName()
instanceName=
# set to true to allow using Trilium without authentication (makes sense for server build only, desktop build doesn't need password)
noAuthentication=false
# set to true to disable backups (e.g. because of limited space on server)
noBackup=false
# Disable automatically generating desktop icon
# noDesktopIcon=true
[Network]
# host setting is relevant only for web deployments - set the host on which the server will listen
# host=0.0.0.0
# port setting is relevant only for web deployments, desktop builds run on a fixed port (changeable with TRILIUM_PORT environment variable)
port=8080
# true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).
https=false
# path to certificate (run "bash bin/generate-cert.sh" to generate self-signed certificate). Relevant only if https=true
certPath=
keyPath=
# setting to give trust to reverse proxies, a comma-separated list of trusted rev. proxy IPs can be specified (CIDR notation is permitted),
# alternatively 'true' will make use of the leftmost IP in X-Forwarded-For, ultimately an integer can be used to tell about the number of hops between
# Trilium (which is hop 0) and the first trusted rev. proxy.
# once set, expressjs will use the X-Forwarded-For header set by the rev. proxy to determinate the real IPs of clients.
# expressjs shortcuts are supported: loopback(127.0.0.1/8, ::1/128), linklocal(169.254.0.0/16, fe80::/10), uniquelocal(10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7)
trustedReverseProxy=true
{{ end }}

9 changes: 9 additions & 0 deletions charts/trilium/templates/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ persistence:
globalMounts:
- path: /home/node/trilium-data
readOnly: false
config:
enabled: true
type: configMap
name: {{ .Release.Name }}-config
mountPath: /home/node/trilium-data/config.ini
subPath: config.ini
readOnly: true


service:
main:
Expand All @@ -75,4 +83,5 @@ service:
# Merge with ALL the values in `values.yaml`
{{- $_ := mergeOverwrite .Values $ctx.Values -}}
{{- $_ = include "trilium.hardcodedValues" . | fromYaml | merge $ctx.Values -}}
{{- $_ = include "trilium.configini" . | fromYaml | merge $ctx.Values -}}
{{- include "bjw-s.common.loader.all" $ctx }}

0 comments on commit 6cf9ce4

Please sign in to comment.