mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-06 21:17:14 -06:00
test: setting up opencloud and microvms
This commit is contained in:
parent
97aebfbb59
commit
9ab5ebd35f
8 changed files with 81 additions and 122 deletions
|
|
@ -1,11 +1,42 @@
|
|||
{ flake, config, ... }:
|
||||
let
|
||||
importList =
|
||||
let
|
||||
content = builtins.readDir ./.;
|
||||
dirContent = builtins.filter (n: content.${n} == "directory") (builtins.attrNames content);
|
||||
in
|
||||
map (name: ./. + "/${name}") dirContent;
|
||||
inherit (flake.config.services) instances;
|
||||
inherit (flake.config.machines.devices) eris;
|
||||
opencloud = instances.opencloud0;
|
||||
dns = instances.web.dns.provider0;
|
||||
opencloudHost = opencloud.domains.url0;
|
||||
dnsPath = "dns/${dns}";
|
||||
service = instances.caddy;
|
||||
in
|
||||
{
|
||||
imports = importList;
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"${opencloud.domains.url0}" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy ${opencloud.interface.ip}:${toString opencloud.ports.port0} {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
|
||||
redir /.well-known/carddav /remote.php/dav/ 301
|
||||
redir /.well-known/caldav /remote.php/dav/ 301
|
||||
|
||||
tls ${opencloud.ssl.cert} ${opencloud.ssl.key}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
security.acme.certs."${opencloudHost}" = {
|
||||
dnsProvider = dns;
|
||||
environmentFile = config.sops.secrets.${dnsPath}.path;
|
||||
group = "caddy";
|
||||
};
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
service.ports.port0 # 80
|
||||
service.ports.port1 # 443
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue