Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add managing config.ini file as part of chart #6

Merged
merged 9 commits into from
Sep 18, 2024
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ __snapshot__/
_site/output1.yaml

output*

*.tgz
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/trilium/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
42 changes: 42 additions & 0 deletions charts/trilium/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

12 changes: 12 additions & 0 deletions charts/trilium/templates/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions charts/trilium/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down