You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
[Unit]
|
|
Description=Matrix Homeserver - Database Restore
|
|
Documentation=https://matrix-construct.github.io/tuwunel/maintenance.html
|
|
After=local-fs.target var-lib-virtiofs-data.mount matrix-tools-build.service
|
|
Requires=var-lib-virtiofs-data.mount
|
|
Wants=matrix-tools-build.service
|
|
Before=matrix-homeserver.service
|
|
|
|
# Only run if the homeserver has been configured
|
|
ConditionPathExists=/etc/quadlets/matrix/tuwunel.env
|
|
|
|
# Only restore when no RocksDB database exists yet
|
|
ConditionPathExists=!/var/lib/quadlets/matrix/tuwunel/db/CURRENT
|
|
# And there is at least one backup archive available to restore from
|
|
ConditionPathExistsGlob=/var/lib/virtiofs/data/matrix/tuwunel/backup/*.tar.gz
|
|
|
|
PartOf=matrix.target
|
|
|
|
[Container]
|
|
ContainerName=matrix-restore-job
|
|
Image=localhost/matrix-tools:latest
|
|
|
|
# No need for root privileges
|
|
User=10031
|
|
Group=10000
|
|
|
|
# Restore script
|
|
Entrypoint=/usr/local/bin/restore.sh
|
|
Volume=/etc/quadlets/matrix/restore.sh:/usr/local/bin/restore.sh:z,ro
|
|
|
|
# Latest backup archive from virtiofs (read-only)
|
|
Environment=BACKUP_SOURCE=/backup
|
|
Volume=/var/lib/virtiofs/data/matrix/tuwunel/backup:/backup:z,ro
|
|
|
|
# Database destination
|
|
Environment=DB_DEST=/var/lib/tuwunel/db
|
|
Volume=/var/lib/quadlets/matrix/tuwunel/db:/var/lib/tuwunel/db:z
|
|
|
|
[Service]
|
|
Restart=no
|
|
TimeoutStartSec=infinity
|
|
Type=oneshot
|
|
|