Fix joplin configuration

This commit is contained in:
Wojciech Kozlowski 2022-11-20 18:09:44 +01:00
parent 63f5ca366a
commit 76c27d6731
4 changed files with 46 additions and 2 deletions

View File

@ -11,7 +11,7 @@
git: git:
gitea: "1" gitea: "1"
notes: notes:
joplin: "2" joplin: "2.9-beta"
tasks: tasks:
- import_tasks: tasks/services/c-deploy/00-hosts.yml - import_tasks: tasks/services/c-deploy/00-hosts.yml

View File

@ -20,6 +20,13 @@ server {
ssl_certificate_key /etc/letsencrypt/live/notes.wojciechkozlowski.eu/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/notes.wojciechkozlowski.eu/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/notes.wojciechkozlowski.eu/chain.pem; ssl_trusted_certificate /etc/letsencrypt/live/notes.wojciechkozlowski.eu/chain.pem;
# Values copied from
# https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html and adjusted to
# 16G.
client_max_body_size 16G;
client_body_timeout 3600s;
client_body_buffer_size 512k;
location / { location / {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;

View File

@ -0,0 +1,28 @@
[Unit]
Description=Podman container-notes-chown.service
Documentation=man:podman-generate-systemd(1)
After=pod-notes.service
Before=container-notes-joplin.service
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-notes-chown.pid %t/container-notes-chown.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-notes-chown.pid \
--cidfile %t/container-notes-chown.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-notes.pod-id \
--replace \
-v /var/lib/yggdrasil/data/pod-notes/data/_data:/data \
--user=0 \
--entrypoint="/bin/bash" \
--name=pod-notes-chown \
docker.io/joplin/server:{{ versions.notes.joplin }} \
-c "chown joplin:joplin /data"
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-notes-chown.ctr-id
Type=oneshot
[Install]
WantedBy=container-notes-joplin.service

View File

@ -4,7 +4,8 @@ Documentation=man:podman-generate-systemd(1)
Wants=network.target Wants=network.target
After=network-online.target After=network-online.target
BindsTo=pod-notes.service BindsTo=pod-notes.service
After=pod-notes.service Requires=container-notes-chown.service
After=pod-notes.service container-notes-chown.service
OnFailure=status-mail@%n.service OnFailure=status-mail@%n.service
[Service] [Service]
@ -31,6 +32,14 @@ ExecStart=/usr/bin/podman run \
-e POSTGRES_USER="{{ services[service_name].database_user }}" \ -e POSTGRES_USER="{{ services[service_name].database_user }}" \
-e POSTGRES_PORT="5432" \ -e POSTGRES_PORT="5432" \
-e POSTGRES_HOST="pod-database" \ -e POSTGRES_HOST="pod-database" \
-e MAILER_ENABLED="true" \
-e MAILER_HOST="{{ services[service_name].smtp_host }}" \
-e MAILER_PORT=465 \
-e MAILER_SECURITY="tls" \
-e MAILER_AUTH_USER="{{ services[service_name].smtp_name }}" \
-e MAILER_AUTH_PASSWORD="{{ services[service_name].smtp_password }}" \
-e MAILER_NOREPLY_NAME="notes" \
-e MAILER_NOREPLY_EMAIL="notes@{{ services[service_name].domain }}" \
-e STORAGE_DRIVER="Type=Filesystem; Path=/data" \ -e STORAGE_DRIVER="Type=Filesystem; Path=/data" \
--name=pod-notes-joplin \ --name=pod-notes-joplin \
docker.io/joplin/server:{{ versions.notes.joplin }} docker.io/joplin/server:{{ versions.notes.joplin }}