weilite/webdav: init
This commit is contained in:
parent
ea3e518de3
commit
a7b3579f55
5 changed files with 65 additions and 14 deletions
47
machines/weilite/services/webdav.nix
Normal file
47
machines/weilite/services/webdav.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
|
||||
sops.secrets = {
|
||||
"webdav/photosync/password" = { };
|
||||
};
|
||||
|
||||
sops.templates."webdav.env" = {
|
||||
content = ''
|
||||
PHOTOSYNC_PASSWORD=${config.sops.placeholder."webdav/photosync/password"}
|
||||
'';
|
||||
};
|
||||
|
||||
services.webdav = {
|
||||
enable = true;
|
||||
settings = {
|
||||
address = "127.0.0.1";
|
||||
port = "16065";
|
||||
permissions = "CRUD";
|
||||
behindProxy = true;
|
||||
users = [
|
||||
{
|
||||
username = "photosync";
|
||||
password = "{env}PHOTOSYNC_PASSWORD";
|
||||
}
|
||||
];
|
||||
};
|
||||
group = "privimg";
|
||||
environmentFile = config.sops.templates."webdav.env".path;
|
||||
};
|
||||
|
||||
systemd.services.webdav.serviceConfig = {
|
||||
BindPaths = [
|
||||
"/mnt/photos/xin/originals:%t/webdav/photosync"
|
||||
];
|
||||
RuntimeDirectory = "webdav";
|
||||
WorkingDirectory = "%t/webdav";
|
||||
};
|
||||
|
||||
users.users."${config.services.webdav.user}".extraGroups = [
|
||||
"privimg"
|
||||
];
|
||||
|
||||
services.caddy.virtualHosts."https://weilite.coho-tet.ts.net:6065".extraConfig = ''
|
||||
reverse_proxy 127.0.0.1:16065
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue