From 1c880e17e01a3de16516278a3898828a59b1ddbd Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Wed, 1 Apr 2026 11:08:09 -0600 Subject: [PATCH] Cleanup --- modules/proxy.nix | 171 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 142 insertions(+), 29 deletions(-) diff --git a/modules/proxy.nix b/modules/proxy.nix index f50011f..380a267 100644 --- a/modules/proxy.nix +++ b/modules/proxy.nix @@ -12,6 +12,7 @@ let livekitDomain = "livekit.${atriDotDad}"; upstream = "lloyd.tadpole-pain.ts.net"; + streamPorts = [ 69 420 @@ -38,10 +39,146 @@ let ]; }; - mkProxy = port: config_preset: '' - import ${config_preset} - reverse_proxy http://${upstream}:${toString port} - ''; + mkProxyBlock = + { + host, + port, + preset, + }: + '' + ${host} { + import ${preset} + reverse_proxy http://${upstream}:${toString port} + } + ''; + + proxyServices = [ + # atri.dad hosts + { + host = "abs.${atriDotDad}"; + port = 30067; + preset = "strict_config"; + } + { + host = "analytics.${atriDotDad}"; + port = 30060; + preset = "relaxed_config"; + } + { + host = "ascently.${atriDotDad}"; + port = 8838; + preset = "strict_config"; + } + { + host = "chat.${atriDotDad}"; + port = 30246; + preset = "relaxed_config"; + } + { + host = "chef.${atriDotDad}"; + port = 30111; + preset = "strict_config"; + } + { + host = "democlimb.${atriDotDad}"; + port = 8008; + preset = "strict_config"; + } + { + host = "gist.${atriDotDad}"; + port = 1227; + preset = "relaxed_config"; + } + { + host = "git.${atriDotDad}"; + port = 30010; + preset = "relaxed_config"; + } + { + host = "links.${atriDotDad}"; + port = 30243; + preset = "strict_config"; + } + { + host = "memos.${atriDotDad}"; + port = 30311; + preset = "strict_config"; + } + { + host = "music.${atriDotDad}"; + port = 30043; + preset = "relaxed_config"; + } + { + host = "openclimb.${atriDotDad}"; + port = 1337; + preset = "strict_config"; + } + { + host = "photos.${atriDotDad}"; + port = 30041; + preset = "strict_config"; + } + { + host = "posts.${atriDotDad}"; + port = 8181; + preset = "relaxed_config"; + } + { + host = "s3.${atriDotDad}"; + port = 30188; + preset = "strict_config"; + } + { + host = "search.${atriDotDad}"; + port = 30053; + preset = "relaxed_config"; + } + { + host = "todo.${atriDotDad}"; + port = 30107; + preset = "relaxed_config"; + } + { + host = "tv.${atriDotDad}"; + port = 30013; + preset = "strict_config"; + } + { + host = "vault.${atriDotDad}"; + port = 30032; + preset = "strict_config"; + } + { + host = "vids.${atriDotDad}"; + port = 31008; + preset = "relaxed_config"; + } + { + host = "vpn.${atriDotDad}"; + port = 30058; + preset = "strict_config"; + } + + # Other hosts + { + host = "ripkyle.org"; + port = 4321; + preset = "relaxed_config"; + } + { + host = atashDotDev; + port = 6969; + preset = "relaxed_config"; + } + { + host = "chronus.${atashDotDev}"; + port = 7337; + preset = "strict_config"; + } + ]; + + proxyBlocks = lib.concatMapStringsSep "\n" mkProxyBlock proxyServices; mkSocatService = port: proto: @@ -130,31 +267,7 @@ in } } - abs.${atriDotDad} { ${mkProxy 30067 "strict_config"} } - analytics.${atriDotDad} { ${mkProxy 30060 "relaxed_config"} } - ascently.${atriDotDad} { ${mkProxy 8838 "strict_config"} } - chat.${atriDotDad} { ${mkProxy 30246 "relaxed_config"} } - chef.${atriDotDad} { ${mkProxy 30111 "strict_config"} } - democlimb.${atriDotDad} { ${mkProxy 8008 "strict_config"} } - gist.${atriDotDad} { ${mkProxy 1227 "relaxed_config"} } - git.${atriDotDad} { ${mkProxy 30010 "relaxed_config"} } - links.${atriDotDad} { ${mkProxy 30243 "strict_config"} } - memos.${atriDotDad} { ${mkProxy 30311 "strict_config"} } - music.${atriDotDad} { ${mkProxy 30043 "relaxed_config"} } - openclimb.${atriDotDad} { ${mkProxy 1337 "strict_config"} } - photos.${atriDotDad} { ${mkProxy 30041 "strict_config"} } - posts.${atriDotDad} { ${mkProxy 8181 "relaxed_config"} } - s3.${atriDotDad} { ${mkProxy 30188 "strict_config"} } - search.${atriDotDad} { ${mkProxy 30053 "relaxed_config"} } - todo.${atriDotDad} { ${mkProxy 30107 "relaxed_config"} } - tv.${atriDotDad} { ${mkProxy 30013 "strict_config"} } - vault.${atriDotDad} { ${mkProxy 30032 "strict_config"} } - vids.${atriDotDad} { ${mkProxy 31008 "relaxed_config"} } - vpn.${atriDotDad} { ${mkProxy 30058 "strict_config"} } - - ripkyle.org { ${mkProxy 4321 "relaxed_config"} } - ${atashDotDev} { ${mkProxy 6969 "relaxed_config"} } - chronus.${atashDotDev} { ${mkProxy 7337 "strict_config"} } + ${proxyBlocks} ${matrixDomain} { import relaxed_config