diff --git a/.gitignore b/.gitignore index 6475961..eda2450 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ __snapshot__/ _site/output1.yaml output* + +*.tgz \ No newline at end of file diff --git a/README.md b/README.md index 2050300..01a9e61 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,27 @@ controllers: type: daemonset ``` +## Modifying the `config.ini` + +Trilium also has a `config.ini` that allows you to [modify some values](https://github.com/TriliumNext/Notes/blob/7ca4cddc5868f4a80b8804ad93a35bf4bc8cc812/config-sample.ini). The values you set within them are mostly self-explanatory, but if you need to change any of the values, modify the following section within the `values.yaml` to the value you want them to be. + +```yaml +configini: + general: + instanceName: "" + # Disable authentication to Trilium? (if you're running it on a private network, or have authentication handled by another component) + noAuthentication: false + # Disable backups of the database? + noBackup: false + network: + host: "0.0.0.0" + port: 8080 + https: false + certPath: "" + keyPath: "" + trustedReverseProxy: true +``` + ## Development To use Helm in order to create the individual Kubernetes manifests needed to deploy it "by hand", you can use the following commands: diff --git a/charts/trilium/Chart.yaml b/charts/trilium/Chart.yaml index 6ad5279..5111298 100644 --- a/charts/trilium/Chart.yaml +++ b/charts/trilium/Chart.yaml @@ -8,7 +8,7 @@ description: |- Build your personal knowledge base with Trilium Notes. A hierarchical note taking application with focus on building large personal knowledge bases. annotations: category: Notes -version: 1.1.1 +version: 1.2.0 appVersion: 0.90.4 kubeVersion: ">= 1.19" dependencies: diff --git a/charts/trilium/templates/config.yaml b/charts/trilium/templates/config.yaml new file mode 100644 index 0000000..50c345c --- /dev/null +++ b/charts/trilium/templates/config.yaml @@ -0,0 +1,42 @@ +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={{ .Values.configini.general.instanceName }} + + # set to true to allow using Trilium without authentication (makes sense for server build only, desktop build doesn't need password) + noAuthentication={{ .Values.configini.general.noAuthentication }} + + # set to true to disable backups (e.g. because of limited space on server) + noBackup={{ .Values.configini.general.noBackup }} + + # 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={{ .Values.configini.network.host }} + # port setting is relevant only for web deployments, desktop builds run on a fixed port (changeable with TRILIUM_PORT environment variable) + port={{ .Values.configini.network.port }} + # true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure). + https={{ .Values.configini.network.https }} + # path to certificate (run "bash bin/generate-cert.sh" to generate self-signed certificate). Relevant only if https=true + certPath={{ .Values.configini.network.certPath }} + keyPath={{ .Values.configini.network.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={{ .Values.configini.network.trustedReverseProxy }} + diff --git a/charts/trilium/templates/release.yaml b/charts/trilium/templates/release.yaml index cdd186c..8cd462f 100644 --- a/charts/trilium/templates/release.yaml +++ b/charts/trilium/templates/release.yaml @@ -55,6 +55,18 @@ persistence: globalMounts: - path: /home/node/trilium-data readOnly: false + config: + enabled: true + type: configMap + name: {{ .Release.Name }}-config + readOnly: true + advancedMounts: + main: + trilium: + - path: /home/node/trilium-data/config.ini + subPath: config.ini + + service: main: diff --git a/charts/trilium/values.yaml b/charts/trilium/values.yaml index 3c8f630..48a5578 100644 --- a/charts/trilium/values.yaml +++ b/charts/trilium/values.yaml @@ -19,6 +19,22 @@ persistence: enabled: true type: persistentVolumeClaim existingClaim: + +# This is used to modify the config.ini of the Trilium instance +configini: + general: + instanceName: "" + # Disable authentication to Trilium? (if you're running it on a private network, or have authentication handled by another component) + noAuthentication: false + # Disable backups of the database? + noBackup: false + network: + host: "0.0.0.0" + port: 8080 + https: false + certPath: "" + keyPath: "" + trustedReverseProxy: true #ingress: # main: # enabled: true