Comment blocks now stay within three lines and explain only the non-obvious. Long histories, include examples, and commented-out code are gone. No task, key, or value changed; the only data change is comment text inside the generated unit files.
45 lines
1.9 KiB
YAML
45 lines
1.9 KiB
YAML
---
|
|
# Duplicated from caddy/vars/default.yml on purpose, so keep them in sync.
|
|
# podman_user comes from the connection user, so the play needs gather_facts.
|
|
podman_user: "{{ ansible_facts['user_id'] }}"
|
|
podman_data_dir: "{{ ansible_facts['user_dir'] }}/podman-data"
|
|
quadlet_dir: "{{ ansible_facts['user_dir'] }}/.config/containers/systemd"
|
|
|
|
host: notes.tanshu.com
|
|
|
|
container_name: trilium
|
|
unit_name: "{{ container_name }}.service"
|
|
|
|
# This is the TriliumNext image, not the retired zadam/trilium. Its document.db carries migrations the old image cannot run.
|
|
# `latest` has floated well beyond monoco's version, so pin a digest or tag if the runtime should not move.
|
|
image: docker.io/triliumnext/notes:latest
|
|
|
|
# caddy/roles/register pins the Podman network to <network_name>_net, so the Quadlet file is trilium.network.
|
|
network_name: "{{ container_name }}"
|
|
|
|
# The image's data directory and the whole of this service's state, all in one tree.
|
|
data_dir: "{{ podman_data_dir }}/{{ container_name }}"
|
|
container_data_dir: /home/node/trilium-data
|
|
|
|
# The app creates these at 0700 on monoco. Creating them here makes a fresh host and a migrated one look the same.
|
|
# log/ is regenerable, tmp/ is scratch, and backup/ holds the app's own zipped backups worth keeping.
|
|
log_dir: "{{ data_dir }}/log"
|
|
tmp_dir: "{{ data_dir }}/tmp"
|
|
backup_dir: "{{ data_dir }}/backup"
|
|
|
|
# The port from config.ini. Caddy proxies to it, and nothing is published on the host.
|
|
container_port: 8080
|
|
|
|
# The image ships no health check, so the unit defines one from the endpoint the app advertises.
|
|
# `curl` is in the image; `wget` is not.
|
|
health_cmd: "curl -fsS -o /dev/null http://127.0.0.1:{{ container_port }}/api/health-check"
|
|
|
|
caddy_name: caddy
|
|
caddyfile_path: "{{ podman_data_dir }}/{{ caddy_name }}/conf/Caddyfile"
|
|
|
|
# Caddy handles the WebSocket upgrade the live editor needs and imposes no request body limit.
|
|
snippet_block: |
|
|
{{ host }} {
|
|
reverse_proxy {{ container_name }}:{{ container_port }}
|
|
}
|