feat: opencloud test

This commit is contained in:
Nick 2025-07-07 13:35:12 -05:00
parent cd118791e5
commit 12e7183973
6 changed files with 103 additions and 7 deletions

View file

@ -41,6 +41,7 @@ in
"searx"
"syncthing"
"vaultwarden"
"opencloud"
]
)
++ (map

View file

@ -0,0 +1,56 @@
{ flake, ... }:
let
inherit (flake.config.machines.devices) ceres;
inherit (flake.config.services.instances) opencloud web;
service = opencloud;
localhost = web.localhost.address1;
host = service.domains.url0;
in
{
services = {
opencloud = {
enable = true;
url = "https://${host}:${service.ports.port0}";
port = service.ports.port0;
address = localhost;
stateDir = "/var/lib/${service.name}";
environment = {
OC_INSECURE = "false";
};
};
caddy = {
virtualHosts = {
"${host}" = {
extraConfig = ''
reverse_proxy ${localhost}:${toString service.ports.port0}
tls ${service.ssl.cert} ${service.ssl.key}
'';
};
};
};
};
fileSystems."/var/lib/${service.name}" = {
device = service.paths.path0;
fsType = "none";
options = [
"bind"
];
depends = [
ceres.storage0.mount
];
};
systemd.tmpfiles.rules = [
"Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
# "Z ${service.sops.path0} 755 ${service.name} ${service.name} -"
];
networking = {
firewall = {
allowedTCPPorts = [
service.ports.port0
];
};
};
}