Use the same Cloudflare tunnel ID for all services
This commit is contained in:
parent
f0d272038f
commit
ec5daa9a52
4 changed files with 12 additions and 28 deletions
hosts/nixedo
|
@ -2,17 +2,13 @@
|
||||||
homelab = {
|
homelab = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
cloudflared.tunnelId = "e1514105-327f-4984-974e-e2fbaca76466";
|
||||||
|
|
||||||
domain = "oliverdavies.uk";
|
domain = "oliverdavies.uk";
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
audiobookshelf.enable = true;
|
audiobookshelf.enable = true;
|
||||||
|
forgejo.enable = true;
|
||||||
forgejo = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
cloudflared.tunnelId = "e1514105-327f-4984-974e-e2fbaca76466";
|
|
||||||
};
|
|
||||||
|
|
||||||
gitea-actions-runner.enable = true;
|
gitea-actions-runner.enable = true;
|
||||||
home-assistant.enable = true;
|
home-assistant.enable = true;
|
||||||
homepage-dashboard.enable = true;
|
homepage-dashboard.enable = true;
|
||||||
|
@ -21,12 +17,7 @@
|
||||||
paperless.enable = true;
|
paperless.enable = true;
|
||||||
tubearchivist.enable = true;
|
tubearchivist.enable = true;
|
||||||
uptime-kuma.enable = true;
|
uptime-kuma.enable = true;
|
||||||
|
vaultwarden.enable = true;
|
||||||
vaultwarden = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
cloudflared.tunnelId = "41feb37d-a0f5-4c21-80c8-36ab63ec3b17";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,11 @@ with lib;
|
||||||
options.homelab = {
|
options.homelab = {
|
||||||
enable = mkEnableOption "Enable homelab services and configuration";
|
enable = mkEnableOption "Enable homelab services and configuration";
|
||||||
|
|
||||||
|
cloudflared.tunnelId = mkOption {
|
||||||
|
example = "00000000-0000-0000-0000-000000000000";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
|
||||||
domain = mkOption {
|
domain = mkOption {
|
||||||
description = "The base domain to use for this homelab.";
|
description = "The base domain to use for this homelab.";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
|
@ -16,11 +16,6 @@ in
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudflared.tunnelId = mkOption {
|
|
||||||
example = "00000000-0000-0000-0000-000000000000";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
homepage.name = mkOption {
|
homepage.name = mkOption {
|
||||||
default = "Forgejo";
|
default = "Forgejo";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -58,7 +53,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudflared.tunnels.${cfg.cloudflared.tunnelId}.ingress = {
|
cloudflared.tunnels.${homelab.cloudflared.tunnelId}.ingress = {
|
||||||
${cfg.url} = "http://localhost:${toString config.services.${service}.settings.server.HTTP_PORT}";
|
${cfg.url} = "http://localhost:${toString config.services.${service}.settings.server.HTTP_PORT}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,11 +21,6 @@ in
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudflared.tunnelId = mkOption {
|
|
||||||
example = "00000000-0000-0000-0000-000000000000";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
homepage.name = mkOption {
|
homepage.name = mkOption {
|
||||||
default = "Vaultwarden";
|
default = "Vaultwarden";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -60,10 +55,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudflared.tunnels.${cfg.cloudflared.tunnelId} = {
|
cloudflared.tunnels.${homelab.cloudflared.tunnelId}.ingress = {
|
||||||
credentialsFile = config.age.secrets.cloudflared.path;
|
"${cfg.url}" = "http://${config.services.${service}.config.ROCKET_ADDRESS}:${
|
||||||
default = "http_status:404";
|
|
||||||
ingress."${cfg.url}".service = "http://${config.services.${service}.config.ROCKET_ADDRESS}:${
|
|
||||||
toString config.services.${service}.config.ROCKET_PORT
|
toString config.services.${service}.config.ROCKET_PORT
|
||||||
}";
|
}";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue