diff --git a/hosts/desktop.nix b/hosts/desktop.nix index 25233e0..de98c63 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -59,7 +59,9 @@ in networking.extraHosts = '' 192.168.0.26 elnuhub + 192.168.0.26 elnuhub.local 24.199.72.8 elnudrop + 24.199.72.8 elnudrop.local ${tailscale.hosts} ''; diff --git a/hosts/elnudrop/README.md b/hosts/elnudrop/README.md new file mode 100644 index 0000000..b6c2aa4 --- /dev/null +++ b/hosts/elnudrop/README.md @@ -0,0 +1,5 @@ +Remote rebuild: + +```SH +ga -A . && nixos-rebuild switch --flake .#elnudrop --target-host root@elnudrop +``` \ No newline at end of file diff --git a/hosts/elnudrop/default.nix b/hosts/elnudrop/default.nix index d29a299..116aede 100644 --- a/hosts/elnudrop/default.nix +++ b/hosts/elnudrop/default.nix @@ -11,6 +11,7 @@ ./modules/tailscale.nix ./hosts/jichan.org + ./hosts/tegakituesday.com ]; networking.firewall = { diff --git a/hosts/elnudrop/hosts/jichan.org/502/502.html b/hosts/elnudrop/hosts/jichan.org/502/502.html index c1e085e..4858a48 100644 --- a/hosts/elnudrop/hosts/jichan.org/502/502.html +++ b/hosts/elnudrop/hosts/jichan.org/502/502.html @@ -3,13 +3,13 @@ - + jichan.org is offline
- Logo + Logo

jichan.org is currently offline for maintenance or due to an electrical outage. Thank you for your patience and please check back soon. Sorry for the inconvenience! diff --git a/hosts/elnudrop/hosts/jichan.org/default.nix b/hosts/elnudrop/hosts/jichan.org/default.nix index 9cdf1b9..9c16b7a 100644 --- a/hosts/elnudrop/hosts/jichan.org/default.nix +++ b/hosts/elnudrop/hosts/jichan.org/default.nix @@ -1,18 +1,39 @@ -{ - services.nginx.virtualHosts."jichan.org" = { +with import ../../../../modules/tailscale/default.nix; +let host = "jichan.org"; in { + services.nginx.virtualHosts."www.${host}" = { + forceSSL = true; + enableACME = true; + globalRedirect = host; + }; + services.nginx.virtualHosts."${host}" = { forceSSL = true; enableACME = true; extraConfig = '' error_page 502 /502.html; ''; locations = { - "/" = { - proxyPass = with import ../../../../modules/tailscale/default.nix; "http://${elnuhub}:3334"; - proxyWebsockets = true; - }; + "/".proxyPass = "http://${elnuhub}:3334"; "/502.html".root = "${./502}"; "/logo.svg".root = "${./502}"; - "/missing.min.css".root = "${./502}"; + "/missing.min.css".root = "${../shared/502}"; + + # Formerly tatoeba.elnu.com + # https://git.elnu.com/ElnuDev/tatoeba-api + "/api/tatoeba/" = { + proxyPass = "http://${elnuhub}:3001"; + extraConfig = '' + rewrite ^/api/tatoeba/(.*) /$1 break; + ''; + }; + + # Formerly images.elnu.com + # https://git.elnu.com/ElnuDev/image-api + "/api/images/" = { + proxyPass = "http://${elnuhub}:3002"; + extraConfig = '' + rewrite ^/api/images/(.*) /$1 break; + ''; + }; }; }; } \ No newline at end of file diff --git a/hosts/elnudrop/hosts/jichan.org/502/missing.min.css b/hosts/elnudrop/hosts/shared/502/missing.min.css similarity index 100% rename from hosts/elnudrop/hosts/jichan.org/502/missing.min.css rename to hosts/elnudrop/hosts/shared/502/missing.min.css diff --git a/hosts/elnudrop/hosts/shared/README.md b/hosts/elnudrop/hosts/shared/README.md new file mode 100644 index 0000000..2ec0504 --- /dev/null +++ b/hosts/elnudrop/hosts/shared/README.md @@ -0,0 +1 @@ +[missing.css@1.0.9](https://missing.style/) \ No newline at end of file diff --git a/hosts/elnudrop/hosts/tegakituesday.com/502/502.html b/hosts/elnudrop/hosts/tegakituesday.com/502/502.html new file mode 100644 index 0000000..fc16162 --- /dev/null +++ b/hosts/elnudrop/hosts/tegakituesday.com/502/502.html @@ -0,0 +1,24 @@ + + + + + + + + Tegaki Tuesday is offline + + +

+ 字ちゃん +

+ Tegaki Tuesday is currently offline for maintenance or due to an electrical outage. + Thank you for your patience and please check back soon. Sorry for the inconvenience! +

+

+ 現在、手書きの火曜日はメンテナンスのため、または停電のためオフラインとなっております。 + しばらくお待ちください。ご迷惑をおかけして申し訳ございません! +

+

Prolonged outage? Notify me on Discord.

+
+ + \ No newline at end of file diff --git a/hosts/elnudrop/hosts/tegakituesday.com/502/mascot.png b/hosts/elnudrop/hosts/tegakituesday.com/502/mascot.png new file mode 100644 index 0000000..d0c6ca0 Binary files /dev/null and b/hosts/elnudrop/hosts/tegakituesday.com/502/mascot.png differ diff --git a/hosts/elnudrop/hosts/tegakituesday.com/default.nix b/hosts/elnudrop/hosts/tegakituesday.com/default.nix new file mode 100644 index 0000000..91e5c7a --- /dev/null +++ b/hosts/elnudrop/hosts/tegakituesday.com/default.nix @@ -0,0 +1,21 @@ +with import ../../../../modules/tailscale/default.nix; +let host = "tegakituesday.com"; in { + services.nginx.virtualHosts."www.${host}" = { + forceSSL = true; + enableACME = true; + globalRedirect = host; + }; + services.nginx.virtualHosts."${host}" = { + forceSSL = true; + enableACME = true; + extraConfig = '' + error_page 502 /502.html; + ''; + locations = { + "/".proxyPass = "http://${elnuhub}:3335"; + "/502.html".root = "${./502}"; + "/mascot.png".root = "${./502}"; + "/missing.min.css".root = "${../shared/502}"; + }; + }; +} \ No newline at end of file diff --git a/modules/tailscale/default.nix b/modules/tailscale/default.nix index 870cf93..a7ffce8 100644 --- a/modules/tailscale/default.nix +++ b/modules/tailscale/default.nix @@ -3,6 +3,8 @@ rec { elnudrop = "100.64.0.2"; elnuhub = "100.64.0.3"; hosts = '' - elnu ${elnu} + ${elnu} elnu.elnu.com + ${elnudrop} elnudrop.elnu.com + ${elnuhub} elnuhub.elnu.com ''; } \ No newline at end of file