carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1# Continuous off-box replication of the fleet's SQLite files under /data to S3
2# via litestream (WAL shipping; the fleet is single-writer-per-DB by design,
3# which is exactly litestream's model). /etc/litestream.yml is GENERATED by
4# `carlos ops litestream` — never hand-edit it; re-run the verb after adding or
5# removing an instance. Hibernating routes are excluded from the config (their
6# DBs are replicated by the activator's per-host lease — two replicators on one
7# DB was Eleven's lesson). Credentials live in /data/litestream.env (0600).
8# Ported from titogo's deploy/systemd/titogo-litestream.service.
9[Unit]
10Description=carlos litestream (replicate /data SQLite files to S3)
11Documentation=https://litestream.io
12After=network-online.target data-instances.mount
13Wants=network-online.target
14
15[Service]
16ExecStart=/usr/local/bin/litestream replicate -config /etc/litestream.yml
17EnvironmentFile=/data/litestream.env
18User=carlos
19Group=carlos
20CapabilityBoundingSet=
21NoNewPrivileges=yes
22ProtectSystem=strict
23# litestream checkpoints the databases it replicates, so it needs /data rw.
24ReadWritePaths=/data
25ProtectHome=yes
26PrivateTmp=yes
27PrivateDevices=yes
28RestrictAddressFamilies=AF_INET AF_INET6
29MemoryDenyWriteExecute=yes
30MemoryMax=256M
31CPUWeight=50
32Restart=always
33RestartSec=2
34
35[Install]
36WantedBy=multi-user.target
37