any.software.webdav: added role
This commit is contained in:
parent
74cf571e05
commit
1fed7d327a
7 changed files with 195 additions and 0 deletions
5
roles/any.software.webdav/files/webdav.Caddyfile
Normal file
5
roles/any.software.webdav/files/webdav.Caddyfile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
webdav.roosens.me {
|
||||
reverse_proxy localhost:8018 {
|
||||
header_down +X-Robots-Tag "none"
|
||||
}
|
||||
}
|
||||
12
roles/any.software.webdav/files/webdav.data.backup.sh
Normal file
12
roles/any.software.webdav/files/webdav.data.backup.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
data_dir='/mnt/data1/webdav/data'
|
||||
snapshot_dir="${data_dir}.snapshot"
|
||||
|
||||
# Read-only snapshot for atomic backup
|
||||
btrfs subvolume snapshot -r "$data_dir" "$snapshot_dir" || exit $?
|
||||
|
||||
/usr/local/bin/restic backup "$snapshot_dir"
|
||||
|
||||
# Always remove snapshot subvolume, even if restic fails
|
||||
btrfs subvolume delete "$snapshot_dir"
|
||||
15
roles/any.software.webdav/files/webdav.service
Normal file
15
roles/any.software.webdav/files/webdav.service
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=WebDAV
|
||||
After=network.target network-online.target
|
||||
Requires=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=webdav
|
||||
Group=webdav
|
||||
ExecStart=/usr/local/bin/webdav --config /etc/webdav/config.toml
|
||||
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue