2024-08-26 18:35:57 -04:00
|
|
|
{config, ...}: let
|
|
|
|
ip = "192.168.0.103";
|
|
|
|
domain = "raffauflabs.com";
|
|
|
|
in {
|
|
|
|
networking = {
|
|
|
|
firewall.allowedTCPPorts = [80 443];
|
|
|
|
};
|
|
|
|
|
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
2024-08-26 19:17:27 -04:00
|
|
|
defaults.email = "alyraffauf@gmail.com";
|
2024-08-26 18:35:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
ddclient = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
domains = [
|
|
|
|
"bt.${domain}"
|
|
|
|
"git.${domain}"
|
|
|
|
"music.${domain}"
|
|
|
|
"plex.${domain}"
|
|
|
|
"podcasts.${domain}"
|
|
|
|
domain
|
|
|
|
];
|
|
|
|
|
|
|
|
interval = "10min";
|
|
|
|
passwordFile = config.age.secrets.cloudflare.path;
|
|
|
|
protocol = "cloudflare";
|
|
|
|
ssl = true;
|
|
|
|
use = "web, web=dynamicdns.park-your-domain.com/getip, web-skip='Current IP Address: '";
|
|
|
|
username = "token";
|
|
|
|
zone = domain;
|
|
|
|
};
|
|
|
|
|
|
|
|
fail2ban = {
|
|
|
|
enable = true;
|
|
|
|
bantime = "1h";
|
|
|
|
};
|
|
|
|
|
|
|
|
k3s = {
|
|
|
|
enable = true;
|
|
|
|
clusterInit = true;
|
|
|
|
role = "server";
|
|
|
|
tokenFile = config.age.secrets.k3s.path;
|
|
|
|
};
|
|
|
|
|
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
|
|
|
|
virtualHosts = {
|
|
|
|
"bt.${domain}" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
locations."/" = {
|
2024-08-26 19:58:13 -04:00
|
|
|
proxyPass = "http://${ip}:${toString 9091}";
|
2024-08-26 18:35:57 -04:00
|
|
|
proxyWebsockets = true;
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_buffering off;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"git.${domain}" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://${ip}:${toString 3000}";
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
client_max_body_size 512M;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"music.${domain}" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
locations."/" = {
|
2024-08-26 19:58:13 -04:00
|
|
|
proxyPass = "http://${ip}:${toString 4533}";
|
2024-08-26 18:35:57 -04:00
|
|
|
proxyWebsockets = true;
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_buffering off;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"plex.${domain}" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
locations."/" = {
|
2024-08-26 19:58:13 -04:00
|
|
|
proxyPass = "http://${ip}:${toString 32400}";
|
2024-08-26 18:35:57 -04:00
|
|
|
proxyWebsockets = true;
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_buffering off;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"podcasts.${domain}" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
locations."/" = {
|
2024-08-26 19:58:13 -04:00
|
|
|
proxyPass = "http://${ip}:${toString 13378}";
|
2024-08-26 18:35:57 -04:00
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
client_max_body_size 500M;
|
|
|
|
proxy_buffering off;
|
|
|
|
proxy_redirect http:// https://;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|