dump
Some checks failed
Test / tests (push) Failing after 16m54s
/ OpenTofu (push) Successful in 17s

This commit is contained in:
plasmagoat 2025-11-18 20:00:39 +01:00
parent 6ba25b90a9
commit 0f49c6c37c
35 changed files with 747 additions and 120 deletions

View file

@ -1,6 +1,10 @@
{ config, pkgs, modulesPath, lib, ... }:
{
config,
pkgs,
modulesPath,
lib,
...
}: {
imports = [
../../templates/base.nix
./networking.nix

View file

@ -2,18 +2,20 @@
networking.hostName = "dns";
# networking.useHostResolvConf = false;
# networking.interfaces.eth0.useDHCP = true;
networking.interfaces.eth0.ipv4.addresses = [{
address = "192.168.1.53";
prefixLength = 24;
}];
networking.interfaces.eth0.ipv4.addresses = [
{
address = "192.168.1.53";
prefixLength = 24;
}
];
networking.defaultGateway = "192.168.1.1"; # your router
networking.nameservers = [ "8.8.8.8" ]; # fallback resolvers
networking.nameservers = ["8.8.8.8"]; # fallback resolvers
networking.firewall.allowedTCPPorts = [ 53 67 80 443 ];
networking.firewall.allowedUDPPorts = [ 53 67 ];
networking.firewall.allowedTCPPorts = [53 67 80 443];
networking.firewall.allowedUDPPorts = [53 67];
networking.hosts = {
"192.168.1.53" = [ "dns" "dns.lab" ];
"192.168.1.53" = ["dns" "dns.lab"];
};
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, runnerId, ... }:
{
config,
lib,
pkgs,
runnerId,
...
}: {
networking.hostName = "forgejo-runner-${runnerId}";
}

View file

@ -1,5 +1,8 @@
{ config, lib, ... }:
{
config,
lib,
...
}: {
sops.secrets."forgejo-runner-registration-token" = {
sopsFile = ../../secrets/forgejo/runner-secrets.yml;
mode = "0440";

View file

@ -1,6 +1,10 @@
{ config, pkgs, modulesPath, lib, ... }:
{
config,
pkgs,
modulesPath,
lib,
...
}: {
imports = [
../../templates/base.nix
../../secrets/shared-sops.nix

View file

@ -1,4 +1,8 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
networking.hostName = "forgejo";
}

View file

@ -1,5 +1,5 @@
{
networking.firewall.allowedTCPPorts = [ 3100 ];
networking.firewall.allowedTCPPorts = [3100];
services.loki = {
enable = true;

View file

@ -1,4 +1,8 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
networking.hostName = "monitor";
}

View file

@ -41,4 +41,11 @@
entryPoints = ["websecure"];
tls.certResolver = "letsencrypt";
};
caddy = {
rule = "PathPrefix(`/`)";
service = "caddy";
entryPoints = ["web"];
priority = 15;
};
}

View file

@ -9,4 +9,6 @@
proxmox.loadBalancer.serversTransport = "insecureTransport";
nas.loadBalancer.servers = [{url = "https://192.168.1.226:5001";}];
nas.loadBalancer.serversTransport = "insecureTransport";
caddy.loadBalancer.servers = [{url = "http://sandbox.lab:80";}];
}

View file

@ -1,13 +1,19 @@
{ config, lib, pkgs, ... }: {
{
config,
lib,
pkgs,
...
}: {
networking.hostName = "traefik";
networking.interfaces.eth0.ipv4.addresses = [{
address = "192.168.1.80";
prefixLength = 24;
}];
networking.interfaces.eth0.ipv4.addresses = [
{
address = "192.168.1.80";
prefixLength = 24;
}
];
networking.firewall.allowedTCPPorts = [ 80 443 8080 8082 ];
networking.firewall.allowedTCPPorts = [80 443 8080 8082];
networking.nameservers = [ "192.168.1.53" ];
networking.nameservers = ["192.168.1.53"];
networking.defaultGateway = "192.168.1.1";
}

View file

@ -50,14 +50,41 @@ in {
staticConfigOptions = staticConfig;
dynamicConfigOptions.http = {
routers = allRouters;
services = allServices;
middlewares = middlewares;
dynamicConfigOptions = {
# HTTP configuration (your existing setup)
http = {
routers = allRouters;
services = allServices;
middlewares = middlewares;
serversTransports = {
insecureTransport = {
insecureSkipVerify = true;
};
};
};
serversTransports = {
insecureTransport = {
insecureSkipVerify = true;
tcp = {
routers = {
caddy-fallback = {
rule = "HostSNI(`*`)"; # Matches any SNI
service = "caddy-tls";
entryPoints = ["websecure"];
priority = 1; # Lowest priority - only if no HTTP router matches
tls = {
passthrough = true;
};
};
};
services = {
caddy-tls = {
loadBalancer = {
servers = [
{
address = "sandbox.lab:443";
}
];
};
};
};
};
};