Compare commits

..

No commits in common. "5e171d9c06b56630424cc96424ac1eeb7b6654e9" and "ac96bb47e98bbe5dfd650ceeeae46741bf16e86b" have entirely different histories.

5 changed files with 85 additions and 89 deletions

View file

@ -91,5 +91,35 @@ in
} }
]; ];
}; };
nginx.virtualHosts."m.uku.moe".locations =
let
server = {
"m.server" = "m.uku.moe:443";
};
client = {
"m.homeserver"."base_url" = "https://m.uku.moe";
};
in
{
"=/.well-known/matrix/server" = {
return = "200 '${builtins.toJSON server}'";
};
"=/.well-known/matrix/client" = {
return = "200 '${builtins.toJSON client}'";
};
"/" = {
proxyPass = "http://localhost:8008";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 600;
client_max_body_size 100M;
'';
};
};
}; };
} }

View file

@ -20,6 +20,8 @@ in
{ {
imports = [ secrets.generate ]; imports = [ secrets.generate ];
cfTunnels."git.uku3lig.net" = "http://localhost:3000";
services = { services = {
forgejo = { forgejo = {
enable = true; enable = true;
@ -40,11 +42,9 @@ in
server = { server = {
ROOT_URL = "https://git.uku3lig.net"; ROOT_URL = "https://git.uku3lig.net";
HTTP_ADDR = "0.0.0.0";
HTTP_PORT = 3000;
START_SSH_SERVER = true; START_SSH_SERVER = true;
BUILTIN_SSH_SERVER_USER = "git"; BUILTIN_SSH_SERVER_USER = "git";
SSH_DOMAIN = "git.uku3lig.net"; SSH_DOMAIN = "ssh.uku.moe";
SSH_LISTEN_PORT = 2222; SSH_LISTEN_PORT = 2222;
}; };
@ -120,7 +120,7 @@ in
name = "forgejo-ssh"; name = "forgejo-ssh";
type = "tcp"; type = "tcp";
localIp = "127.0.0.1"; localIp = "127.0.0.1";
localPort = config.services.forgejo.settings.server.SSH_LISTEN_PORT; localPort = 2222;
remotePort = 22; remotePort = 22;
} }
]; ];

View file

@ -1,7 +1,12 @@
{ config, _utils, ... }:
let
frp = _utils.mkFrpPassthrough "immich" config.services.immich.port;
in
{ {
imports = [ frp ];
services.immich = { services.immich = {
enable = true; enable = true;
host = "0.0.0.0";
settings = null; settings = null;
mediaLocation = "/data/immich"; mediaLocation = "/data/immich";

View file

@ -16,6 +16,7 @@
]; ];
services = { services = {
nginx.enable = true;
openssh = { openssh = {
ports = [ 4269 ]; ports = [ 4269 ];
openFirewall = true; openFirewall = true;

View file

@ -1,92 +1,52 @@
{ {
services.nginx = { services.nginx.virtualHosts = {
enable = true; # default server
virtualHosts = { "vps.uku3lig.net" = {
# default server default = true;
"vps.uku3lig.net" = { addSSL = true;
default = true; enableACME = true;
addSSL = true; locations."/".return = "404";
enableACME = true; };
locations."/".return = "404";
# immich
"im.uku.moe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:2283";
proxyWebsockets = true;
}; };
# immich extraConfig = ''
"im.uku.moe" = { client_max_body_size 5000M;
forceSSL = true; proxy_read_timeout 600s;
enableACME = true; proxy_send_timeout 600s;
locations."/" = { send_timeout 600s;
proxyPass = "http://etna:2283"; '';
proxyWebsockets = true; };
};
extraConfig = '' # dendrite
client_max_body_size 5000M; "m.uku.moe" = {
proxy_read_timeout 600s; forceSSL = true;
proxy_send_timeout 600s; enableACME = true;
send_timeout 600s; locations."/" = {
''; proxyPass = "http://etna:80";
}; recommendedProxySettings = true;
# dendrite
"m.uku.moe" = {
forceSSL = true;
enableACME = true;
locations =
let
server = {
"m.server" = "m.uku.moe:443";
};
client = {
"m.homeserver"."base_url" = "https://m.uku.moe";
};
in
{
"=/.well-known/matrix/server" = {
return = "200 '${builtins.toJSON server}'";
};
"=/.well-known/matrix/client" = {
return = "200 '${builtins.toJSON client}'";
};
"/" = {
proxyPass = "http://etna:8008";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 600;
client_max_body_size 100M;
'';
};
};
};
"zipline.uku3lig.net" = {
serverAliases = [ "v.uku.moe" ];
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://etna:3001";
recommendedProxySettings = true;
};
extraConfig = ''
client_max_body_size 1000M;
'';
};
"git.uku3lig.net" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://etna:3000";
recommendedProxySettings = true;
};
}; };
}; };
};
# we depend on etna, which makes nginx fail if it's started before tailscale "zipline.uku3lig.net" = {
systemd.services.nginx.after = [ "tailscaled.service" ]; serverAliases = [ "v.uku.moe" ];
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://etna:3001";
recommendedProxySettings = true;
};
extraConfig = ''
client_max_body_size 1000M;
'';
};
};
} }