yep, more dotfiles

hide server services behind tailnet

wiro.world 6b2455ff 02af7e7e

verified
+1
.ignore
···
+
*.age
+1 -1
hosts/weird-row-server/authelia.nix
···
authelia-metrics-port = 9004;
headscale-hostname = "headscale.wiro.world";
-
grafana-hostname = "console.wiro.world";
+
grafana-hostname = "console.net.wiro.world";
miniflux-hostname = "news.wiro.world";
in
{
+8 -2
hosts/weird-row-server/default.nix
···
jails = { };
};
+
age.secrets.caddy-env.file = secrets/caddy-env.age;
services.caddy = {
enable = true;
package = pkgs.caddy.withPlugins {
-
doInstallCheck = false;
plugins = [
+
"github.com/caddy-dns/hetzner/v2@v2.0.0-preview-1"
"github.com/tailscale/caddy-tailscale@v0.0.0-20251016213337-01d084e119cb"
-
"github.com/caddy-dns/hetzner@v2.0.0-preview-1"
];
hash = "sha256-muKwDYs5Jp4ib/psZxpp1Kyfsqz6wPz/lpHFGtx67uY=";
};
+
environmentFile = config.age.secrets.caddy-env.path;
+
globalConfig = ''
tailscale {
+
# this caddy instance already proxies headscale but needs to access headscale to start
+
# control_url https://headscale.wiro.world
+
control_url http://localhost:3006
+
ephemeral
}
'';
+1 -1
hosts/weird-row-server/goatcounter.nix
···
services.caddy = {
virtualHosts.${goatcounter-hostname}.extraConfig = ''
-
reverse_proxy http://localhost:${toString goatcounter-port}
+
reverse_proxy http://localhost:${toString config.services.goatcounter.port}
'';
};
};
+3 -2
hosts/weird-row-server/grafana.nix
···
let
grafana-port = 3002;
-
grafana-hostname = "console.wiro.world";
+
grafana-hostname = "console.net.wiro.world";
prometheus-port = 9001;
prometheus-node-exporter-port = 9002;
···
globalConfig = ''
metrics { per_host }
'';
-
virtualHosts.${grafana-hostname}.extraConfig = ''
+
virtualHosts."http://${grafana-hostname}".extraConfig = ''
+
bind tailscale/console
reverse_proxy http://localhost:${toString grafana-port}
'';
};
+4 -3
hosts/weird-row-server/lldap.nix
···
let
lldap-port = 3007;
-
lldap-hostname = "ldap.wiro.world";
+
lldap-hostname = "ldap.net.wiro.world";
in
{
config = {
···
};
services.caddy = {
-
virtualHosts.${lldap-hostname}.extraConfig = ''
-
reverse_proxy http://localhost:${toString lldap-port}
+
virtualHosts."http://${lldap-hostname}".extraConfig = ''
+
bind tailscale/ldap
+
reverse_proxy http://localhost:${toString config.services.lldap.settings.http_port}
'';
};
};
+2 -2
hosts/weird-row-server/pds.nix
···
virtualHosts.${pds-hostname} = {
serverAliases = [ "*.${pds-hostname}" ];
extraConfig = ''
-
tls { on_demand }
-
reverse_proxy http://localhost:${toString pds-port}
+
tls { on_demand }
+
reverse_proxy http://localhost:${toString config.services.bluesky-pds.settings.PDS_HOSTNAME}
'';
};
};
hosts/weird-row-server/secrets/caddy-env.age

This is a binary file and will not be displayed.

+1
hosts/weird-row-server/secrets/default.nix
···
# Defines `HYPIXEL_API_KEY`, `PROFILE_UUID`
"hypixel-bank-tracker-main.age".publicKeys = deploy;
"hypixel-bank-tracker-banana.age".publicKeys = deploy;
+
"caddy-env.age".publicKeys = deploy;
}
+4 -3
hosts/weird-row-server/thelounge.nix
···
let
thelounge-port = 3005;
-
thelounge-hostname = "lounge.wiro.world";
+
thelounge-hostname = "irc-lounge.net.wiro.world";
in
{
config = {
···
};
services.caddy = {
-
virtualHosts.${thelounge-hostname}.extraConfig = ''
-
reverse_proxy http://localhost:${toString thelounge-port}
+
virtualHosts."http://${thelounge-hostname}".extraConfig = ''
+
bind tailscale/irc-lounge
+
reverse_proxy http://localhost:${toString config.services.thelounge.port}
'';
};
};
+1 -1
hosts/weird-row-server/vaultwarden.nix
···
services.caddy = {
virtualHosts.${vaultwarden-hostname}.extraConfig = ''
-
reverse_proxy http://localhost:${toString vaultwarden-port}
+
reverse_proxy http://localhost:${toString config.services.vaultwarden.config.ROCKET_PORT}
'';
};
};
+3 -7
hosts/weird-row-server/warrior.nix
···
let
warrior-port = 3015;
-
warrior-hostname = "warrior.wiro.world";
-
-
authelia-port = 3008;
+
warrior-hostname = "warrior.net.wiro.world";
in
{
config = {
···
};
services.caddy = {
-
virtualHosts.${warrior-hostname}.extraConfig = ''
-
forward_auth localhost:${toString authelia-port} {
-
uri /api/authz/forward-auth
-
}
+
virtualHosts."http://${warrior-hostname}".extraConfig = ''
+
bind tailscale/warrior
reverse_proxy http://localhost:${toString warrior-port}
'';
};