Compare commits

...

7 commits

Author SHA1 Message Date
sid
53ff79e55c Merge pull request 'use public domain for internal services via intra subdomain' (#14) from develop into master
Some checks failed
Deploy configs / deploy-configs (push) Failing after 33s
Reviewed-on: #14
2026-04-03 15:57:36 +02:00
sid
e74970f142 vaultwarden: disable local nginx
All checks were successful
Build hosts / build-hosts (pull_request) Successful in 16s
Flake check / flake-check (pull_request) Successful in 16s
2026-04-03 15:56:27 +02:00
sid
5f408cc956 intranet uses hetzner instead of webroot 2026-04-03 15:49:39 +02:00
sid
f26b7b12dc intranet: add reverse proxies to sid
Some checks failed
Build hosts / build-hosts (pull_request) Failing after 3s
Flake check / flake-check (pull_request) Failing after 3s
2026-04-03 15:42:45 +02:00
sid
245d853b05 add hetzner-dns for intranet challenges
Some checks failed
Build hosts / build-hosts (pull_request) Failing after 3s
Flake check / flake-check (pull_request) Failing after 3s
2026-04-03 15:36:07 +02:00
sid
4c166e1c47 vaultwarden: enable ssl
Some checks failed
Build hosts / build-hosts (pull_request) Failing after 3s
Flake check / flake-check (pull_request) Failing after 3s
2026-04-03 15:18:18 +02:00
sid
de754b0033 use public domain for internal services via intra subdomain 2026-04-03 15:16:28 +02:00
5 changed files with 58 additions and 52 deletions

View file

@ -1,17 +1,15 @@
rec {
domain = "sid.ovh";
intranet = "intra." + domain;
hosts = {
sid = {
ip = "100.64.0.6";
domain = "sid.tail";
};
rx4 = {
ip = "100.64.0.10";
domain = "rx4.tail";
};
vde = {
ip = "100.64.0.1";
domain = "vde.tail";
};
};
services = {
@ -27,7 +25,7 @@ rec {
port = 8085;
};
netdata = {
fqdn = "netdata.sid.tail";
fqdn = "netdata." + intranet;
port = 19999;
};
open-webui-oci = {
@ -43,11 +41,11 @@ rec {
port = 1200;
};
vaultwarden = {
fqdn = "pw.rx4.tail";
fqdn = "pw." + intranet;
port = 8222;
};
webdav = {
fqdn = "dav.rx4.tail";
fqdn = "dav." + intranet;
port = 8080;
};
};

View file

@ -1,14 +1,12 @@
{
constants,
config,
lib,
...
}:
let
inherit (constants) domain;
inherit (constants.services.vaultwarden) fqdn port;
inherit (lib) mkForce;
in
{
services.vaultwarden = {
@ -17,7 +15,7 @@ in
dbBackend = "postgresql";
configurePostgres = true;
configureNginx = true;
configureNginx = false;
domain = fqdn;
environmentFile = [ config.sops.templates."vaultwarden/env-file".path ];
@ -38,8 +36,6 @@ in
};
};
services.nginx.virtualHosts."${fqdn}".forceSSL = mkForce false; # let Tailnet handle SSL
sops =
let
owner = config.users.users.vaultwarden.name;

View file

@ -32,6 +32,7 @@ mailserver:
vaultwarden: ENC[AES256_GCM,data:nSiiyurI0pNGlJiHpgu5jUQIq688IbPKlJCvx4jrFN9TwIY+kfVOaO4KWKkavBYfMZqMuEBr7EAdRULS,iv:OpgfXl1uYLgjOGDTkXFj/wPFUoE6uK89gtXLsB2x6gE=,tag:knJkNQnRCNcc/2nKBYdVCw==,type:str]
radicale:
sid: ENC[AES256_GCM,data:/OgIrXnGttIymGw98feiUjKPOIlrgRIC0TNCdBnuJOiA0RzbF0b9SMVzwEZiTEmS82g2lSvxQkE4kZjeOgOC0RLvCyZAmtWojq+g1pN0qhEkhwH0Qtu9wNnSYHuRqh2E5nWzHNGl/eF6zQ==,iv:5XtlyXjpB+XrVvJ7IoM7Gu63xA8vYrcJjUjLPmOMAIU=,tag:SAuYl/wzxnINyVWn9nI5yA==,type:str]
hetzner-dns-api-key: ENC[AES256_GCM,data:KQooOZjQMtCSVqMI8yKVEk0xebTEuNs5WsxTDC9kcXdGZIgq8ZIEk5ku94EV95i0ad9y5Zx0ozt7aWcNHiMMfQ==,iv:jssQ7PejT5awmeMowdSIEFKDfLW7PWvsd++lh9/MlXs=,tag:UoNRz9neDzDxDjmGmBNPjA==,type:str]
sops:
age:
- recipient: age19yeqvv28fgrtk6jsh3xyaf0lch86kna6rcz4dwe962yyyyevu30sx474xy
@ -52,7 +53,7 @@ sops:
RzhnczA0S1pxcXZncGpWVHNYQW96L28K+ytH3PPyg4+wibpAQhp02RiSfZ83EDRB
UJ8UV1d+51D0e2A1sI95r2AzDj4jfwUnI+LYDPC/qEpsu5LFLGVyeg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2026-04-03T11:37:47Z"
mac: ENC[AES256_GCM,data:5f4/mIJzzvKhZjES4WA0Ds2g642FDS03oSmH4dUi0pnF01aQD75eZ0HI3vcdks6kY+b5xyH5BJ283cgrnIiG2oPjYsIt8ULFnXZql31QQJArirYC35qf5lIiN4gC0ObzC5nSTR4rzrqpWtmf2vrvxDXWftK+JdwPyPjk/4IAu50=,iv:tfHDum7KB+nYQnxfukm+w/BotWW+Itmn11yy6O4V6oE=,tag:0/sFkH9Z2ZP2wzVfJEYFqA==,type:str]
lastmodified: "2026-04-03T13:35:11Z"
mac: ENC[AES256_GCM,data:fUOfIHeXjpDe57Q5sTYFlAefk1JpX2uvwmgpr9Mvl7pH47NBJUnQjC2NH5e89gc08H91ZYD8T4xE2e/E0zBb4rnW6geVpTPfV7NTj/HPOpRZCj/4ikMv/u6cFDODSThTRRRm4rBhFv2jpNR9Ez50OxOxbOGXILEAaQ1yytyVQKs=,iv:5F85fPxdab1KKHN978stzLhFTOH811+qwFZ0mP13Dx0=,tag:euM1ecdQX1d5L9ViZZknQw==,type:str]
unencrypted_suffix: _unencrypted
version: 3.12.1

View file

@ -1,6 +1,5 @@
{
inputs,
constants,
...
}:
@ -10,33 +9,6 @@
inputs.synix.nixosModules.headscale
];
services.resolved.enable = false;
networking.resolvconf.enable = false;
networking.nameservers = [ constants.hosts.sid.ip ];
services.coredns = {
enable = true;
config = with constants; ''
.:53 {
bind ${hosts.sid.ip}
hosts {
${hosts.sid.ip} sid.tail
${hosts.sid.ip} netdata.sid.tail
${hosts.rx4.ip} rx4.tail
${hosts.rx4.ip} dav.rx4.tail
${hosts.rx4.ip} pw.rx4.tail
${hosts.vde.ip} vde.tail
fallthrough
}
forward . 1.1.1.1
cache
log
errors
}
'';
};
services.headplane = {
enable = true;
reverseProxy = {
@ -54,16 +26,7 @@
};
settings = {
dns = {
magic_dns = true;
base_domain = "tail";
search_domains = [ "tail" ];
override_local_dns = true;
nameservers = {
global = [ "1.1.1.1" ];
split = {
"tail" = [ constants.hosts.sid.ip ];
};
};
magic_dns = true; # NOTE: should coredns handle everything?
};
};
};

View file

@ -1,6 +1,7 @@
{
inputs,
constants,
config,
lib,
...
}:
@ -15,6 +16,43 @@ in
inputs.synix.nixosModules.nginx
];
services.resolved.enable = false;
networking.resolvconf.enable = false;
networking.nameservers = [ constants.hosts.sid.ip ];
services.coredns = {
enable = true;
config = with constants; ''
.:53 {
bind ${hosts.sid.ip}
hosts {
${hosts.rx4.ip} ${services.vaultwarden.fqdn}
${hosts.rx4.ip} ${services.webdav.fqdn}
${hosts.rx4.ip} rx4.tail
${hosts.sid.ip} ${services.netdata.fqdn}
${hosts.sid.ip} sid.tail
${hosts.vde.ip} vde.tail
fallthrough
}
forward . 1.1.1.1
cache
log
errors
}
'';
};
security.acme = {
certs."${constants.intranet}" = {
domain = "*.${constants.intranet}";
webroot = null;
dnsProvider = "hetzner";
credentialsFile = config.sops.secrets.hetzner-dns-api-key.path;
};
};
sops.secrets.hetzner-dns-api-key = { };
services.nginx = {
enable = true;
openFirewall = true;
@ -35,7 +73,7 @@ in
port = constants.services.miniflux.port;
};
virtualHosts."${constants.services.netdata.fqdn}" = mkVirtualHost {
ssl = false;
inherit ssl;
port = constants.services.netdata.port;
};
virtualHosts."${constants.services.open-webui-oci.fqdn}" = mkVirtualHost {
@ -55,6 +93,16 @@ in
address = constants.hosts.rx4.ip;
port = constants.services.rsshub-oci.port;
};
virtualHosts."${constants.services.vaultwarden.fqdn}" = mkVirtualHost {
inherit ssl;
address = constants.hosts.rx4.ip;
port = constants.services.vaultwarden.port;
};
virtualHosts."${constants.services.webdav.fqdn}" = mkVirtualHost {
inherit ssl;
address = constants.hosts.rx4.ip;
port = constants.services.webdav.port;
};
# FIXME
# virtualHosts."print.sid.ovh" = {
# enableACME = true;