fix(access): gensokyo

This commit is contained in:
arcnmx 2024-01-24 08:09:05 -08:00
parent fdfd6260c1
commit 228e2cf788
6 changed files with 17 additions and 6 deletions

View file

@ -7,7 +7,6 @@
inherit (lib.modules) mkDefault; inherit (lib.modules) mkDefault;
in { in {
services.nginx.virtualHosts.${config.networking.domain} = { services.nginx.virtualHosts.${config.networking.domain} = {
default = mkDefault true;
locations."/" = { locations."/" = {
root = pkgs.gensokyoZone; root = pkgs.gensokyoZone;
}; };

View file

@ -4,7 +4,7 @@
... ...
}: let }: let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.modules) mkIf mkOptionDefault; inherit (lib.modules) mkIf mkDefault mkOptionDefault;
cfg = config.services.plex; cfg = config.services.plex;
access = config.services.nginx.access.plex; access = config.services.nginx.access.plex;
in { in {
@ -53,11 +53,13 @@ in {
in { in {
${access.domain} = { ${access.domain} = {
locations."/" = location; locations."/" = location;
kTLS = mkDefault true;
inherit extraConfig; inherit extraConfig;
}; };
${access.localDomain} = { ${access.localDomain} = {
local.enable = true; local.enable = true;
locations."/" = location; locations."/" = location;
kTLS = mkDefault true;
inherit extraConfig; inherit extraConfig;
}; };
}; };

View file

@ -24,6 +24,10 @@ in {
type = str; type = str;
default = "z2m.local.${config.networking.domain}"; default = "z2m.local.${config.networking.domain}";
}; };
tailDomain = mkOption {
type = str;
default = "z2m.tail.${config.networking.domain}";
};
port = mkOption { port = mkOption {
type = port; type = port;
}; };
@ -42,10 +46,7 @@ in {
locations."/" = location; locations."/" = location;
}; };
${access.localDomain} = { ${access.localDomain} = {
local.enable = true; serverAliases = mkIf config.services.tailscale.enable [ access.tailDomain ];
locations."/" = location;
};
"z2m.tail.${config.networking.domain}" = mkIf config.services.tailscale.enable {
local.enable = true; local.enable = true;
locations."/" = location; locations."/" = location;
}; };

View file

@ -29,5 +29,12 @@ with lib; {
#proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict"; #proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";
''; '';
clientMaxBodySize = "512m"; clientMaxBodySize = "512m";
virtualHosts.fallback = {
serverName = null;
default = mkDefault true;
locations."/".extraConfig = mkDefault ''
return 404;
'';
};
}; };
} }

View file

@ -41,6 +41,7 @@ in {
credentialsFile = config.sops.secrets.cloudflared-tunnel-hakurei.path; credentialsFile = config.sops.secrets.cloudflared-tunnel-hakurei.path;
ingress = { ingress = {
"prox.${config.networking.domain}".service = "http://localhost"; "prox.${config.networking.domain}".service = "http://localhost";
${config.networking.domain}.service = "http://localhost";
}; };
}; };
}; };

View file

@ -10,6 +10,7 @@ module "hakurei" {
account_id = var.cloudflare_account_id account_id = var.cloudflare_account_id
zone_id = cloudflare_zone.gensokyo-zone_zone.id zone_id = cloudflare_zone.gensokyo-zone_zone.id
subdomains = [ subdomains = [
"@",
"prox", "prox",
] ]
} }