big sync, add static-sites

This commit is contained in:
41666 2024-06-02 17:58:45 -04:00
parent 1b144d2e4a
commit c8c8aaec36
9 changed files with 211 additions and 132 deletions

View file

@ -35,6 +35,7 @@ in rec {
pdr.servers."${tsHost "porcelain-doll-repair" 3000}" = {};
se.servers."${tsHost "sapphic-engineer" 4000}" = {};
git.servers."${tsHost "git" 3000}" = {};
staticsites.servers."${tsHost "static-sites" 80}" = {};
};
proxyCachePath."pdr" = {
@ -64,22 +65,13 @@ in rec {
forceSSL = lib.mkDefault true;
enableACME = true;
};
static = { src ? null, url ? null, rev ? null, aliases ? [] }: {
serverAliases = aliases;
root = if src != null then src else builtins.fetchGit { inherit url rev; };
} // defaultConfig;
placeholder = {
locations."=/" = {
root = pkgs.writeText "placeholder.html" "empty space -- this site is non-functional";
extraConfig = ''
default_type text/plain;
'';
staticSite = {
locations."/" = {
proxyPass = "http://staticsites";
};
} // defaultConfig;
mekanoesh = static { src = flakePackage "noe-sh"; };
ps2live = upstream: {
locations."/" = {
proxyPass = "http://ps2l_${upstream}";
@ -87,13 +79,11 @@ in rec {
};
} // defaultConfig;
in rec {
"mekanoe.com" = mekanoesh;
"noe.sh" = mekanoesh;
"foxxolay.com" = static {
url = "https://github.com/foxxolay/foxxolay.com.git";
rev = "d7b00d742d9f209c0be569aa95abfa32c42cc1c3";
} // { forceSSL = false; };
"mekanoe.com" = staticSite;
"noe.sh" = staticSite;
"foxxolay.com" = staticSite;
"kitsu.love" = staticSite;
"doll.repair" = staticSite;
"git.sapphic.engineer" = {
locations."/" = {
@ -102,16 +92,10 @@ in rec {
};
} // defaultConfig // { forceSSL = false; };
"kitsu.love" = static {
url = "https://codeberg.org/Vivieraaa/kitsu-site.git";
rev = "f669f68f1bf89c8f161627e994c9c865811964e8";
};
"agg.ps2.live" = ps2live "aggpop";
"saerro.ps2.live" = ps2live "saerro";
"metagame.ps2.live" = ps2live "metagame";
"doll.repair" = static { src = flakePackage "doll-repair"; } // { forceSSL = false; };
"porcelain.doll.repair" = {
# serverAliases = ["p.doll.repair"]; # Media Proxy
locations."/" = {

View file

@ -1 +1 @@
10.100.1.43
10.100.1.44

View file

@ -2,7 +2,6 @@
imports = [
../../templates/proxmox-lxc.nix
../../server.nix
../../features/dns-cache.nix
../../features/podman.nix
];
@ -14,25 +13,36 @@
allowedTCPPorts = [ 53 80 ];
allowedUDPPorts = [ 53 ];
};
services.resolved = {
enable = false;
};
networking.nameservers = [
"2606:4700:4700::1111#one.one.one.one"
"2606:4700:4700::1001#one.one.one.one"
"1.1.1.1#one.one.one.one"
"1.0.0.1#one.one.one.one"
];
# virtualisation.oci-containers.containers = {
# pihole = {
# image = "registry.docker.io/pihole/pihole";
# ports = [
# "53:53/tcp"
# "53:53/udp"
# "80:80/tcp"
# ];
# volumes = [
# "etc-pihole:/etc/pihole"
# "etc-dnsmasq.d:/etc/dnsmasq.d"
# ];
# environment = {
# TZ = config.time.timeZone;
# VIRTUAL_HOST = "pihole.hoki-porgy.ts.net";
# PROXY_LOCATION = "pihole.hoki-porgy.ts.net";
# # FTLCONF_LOCAL_IPV4 = config.networking.interfaces.tailscale0.ipv4.addresses[0].address;
# };
# };
# };
virtualisation.oci-containers.containers = {
pihole = {
image = "registry-1.docker.io/pihole/pihole";
ports = [
"53:53/tcp"
"53:53/udp"
"80:80/tcp"
];
volumes = [
"etc-pihole:/etc/pihole"
"etc-dnsmasq.d:/etc/dnsmasq.d"
];
environment = {
TZ = config.time.timeZone;
VIRTUAL_HOST = "pihole.hoki-porgy.ts.net";
PROXY_LOCATION = "pihole.hoki-porgy.ts.net";
# FTLCONF_LOCAL_IPV4 = config.networking.interfaces.tailscale0.ipv4.addresses[0].address;
};
};
};
}

View file

@ -0,0 +1 @@
10.100.1.45

View file

@ -0,0 +1,61 @@
{ lib, pkgs, config, inputs, ... }: let
flakePackage = flake: inputs.${flake}.packages.${pkgs.system}.default;
in rec {
imports = [
../../templates/proxmox-lxc.nix
../../server.nix
../../features/dns-cache.nix
../../features/nginx.nix
../../features/telemetry/nginx.nix
];
networking.hostName = "static-sites";
system.stateVersion = "24.05";
nixpkgs.hostPlatform = "x86_64-linux";
networking.firewall.allowedTCPPorts = [ 80 ];
networking.firewall.allowedUDPPorts = [ 80 ];
services.nginx = {
recommendedBrotliSettings = true;
recommendedGzipSettings = true;
recommendedZstdSettings = true;
virtualHosts = let
defaultConfig = {
listen = [
{ addr = "0.0.0.0"; port = 80; }
{ addr = "[::]"; port = 80; }
];
};
static = { src ? null, url ? null, rev ? null, aliases ? [] }: {
serverAliases = aliases;
root = if src != null then src else builtins.fetchGit { inherit url rev; };
} // defaultConfig;
placeholder = {
locations."=/" = {
root = pkgs.writeText "placeholder.html" "empty space -- this site is non-functional";
extraConfig = ''
default_type text/plain;
'';
};
} // defaultConfig;
in rec {
"noe.sh" = static { src = flakePackage "noe-sh"; aliases = [ "mekanoe.com" ] };
# "3d.noe.sh" = static { src = flakePackage "3d-noe-sh"; aliases = [ "art.mekanoe.com" ]; };
"doll.repair" = static { src = flakePackage "doll-repair"; };
"foxxolay.com" = static {
url = "https://github.com/foxxolay/foxxolay.com.git";
rev = "d7b00d742d9f209c0be569aa95abfa32c42cc1c3";
};
"kitsu.love" = static {
url = "https://codeberg.org/Vivieraaa/kitsu-site.git";
rev = "f669f68f1bf89c8f161627e994c9c865811964e8";
};
};
};
}