elnudrop: nginx & proof of concept server outage handling

inky
Elnu 1 year ago
parent efa926d33f
commit 0efadb66eb

@ -5,8 +5,6 @@
# Command line utilities
wget
neofetch
pfetch
fortune
killall
htop
trash-cli # aliased to rm in .bashrc

@ -1,5 +1,4 @@
{ lib, user, ... }:
let keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQNlGt62dBMojVCX7EUIia+wfSDfLzV4YCPi8SZ2xrp elnu@elnu.com"
]; in
@ -9,6 +8,39 @@ let keys = [
# Remember to update for new instances
./networking.nix # generated at runtime by nixos-infect
];
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 443 ];
};
security.acme = {
acceptTerms = true;
defaults.email = "elnu@elnu.com";
};
services.nginx = {
enable = true;
virtualHosts = {
"default" = {
default = true;
serverName = null;
# https://stackoverflow.com/a/42802777
locations."/".return = "444";
};
"jichan.org" = {
extraConfig = ''
error_page 502 /502.html;
'';
locations = {
"/" = {
proxyPass = "http://127.0.0.1:8000";
proxyWebsockets = true;
};
"/502.html".root = "${./hosts/jichan.org}";
"/logo.svg".root = "${./hosts/jichan.org}";
"/missing.min.css".root = "${./hosts/jichan.org}";
};
};
};
};
services.do-agent.enable = true;
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = keys;

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="missing.min.css"> <!-- missing.css@1.0.9 -->
<style>:root { cursor: inherit } button { cursor: pointer }</style>
<title>jichan.org is offline</title>
</head>
<body>
<main>
<img src="logo.svg" alt="Logo" style="height: 4em; display: block; margin: 1em auto 1em auto">
<p class="<h3>">
<b>jichan.org</b> 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!
</p>
<p lang="ja" class="<h4>">
現在、<b>jichan.org</b>はメンテナンスのため、または停電のためオフラインとなっております。
しばらくお待ちください。ご迷惑をおかけして申し訳ございません!
</p>
<p class="text-align:center">Prolonged outage? <a href="https://discord.com/users/441283734214279178">Notify me on Discord.</a></p>
</main>
</body>
</html>

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="306.39175mm"
height="69.833031mm"
viewBox="0 0 306.39175 69.833031"
version="1.1"
id="svg5"
sodipodi:docname="logo.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
showguides="false"
inkscape:zoom="1.1951475"
inkscape:cx="579.00803"
inkscape:cy="132.20126"
inkscape:window-width="1920"
inkscape:window-height="1048"
inkscape:window-x="1920"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-11.936241,34.186479)">
<g
aria-label="jichan.org"
id="text843"
style="font-weight:bold;font-size:67.7333px;font-family:Arimo;-inkscape-font-specification:'Arimo Bold';letter-spacing:-4.23333px;fill:#ffffff;fill-opacity:0.75;stroke-width:0.264583">
<path
d="m 25.6861,-23.010484 q -3.047998,0 -4.809064,-1.4224 -1.693332,-1.490132 -1.693332,-4.199464 0,-2.438399 1.693332,-3.996265 1.761066,-1.557866 4.809064,-1.557866 3.047999,0 4.741331,1.490133 1.693333,1.422399 1.693333,4.063998 0,2.506132 -1.761066,4.063998 -1.693332,1.557866 -4.673598,1.557866 z m -9.618128,57.302371 -4.131731,-8.398929 q 4.605864,0 6.36693,-1.896533 1.761066,-1.828799 1.761066,-6.705596 v -33.189317 h 10.837328 v 35.763182 q 0,7.450663 -3.860799,10.905061 -3.793064,3.522132 -10.972794,3.522132 z"
style="fill:#d94455;fill-opacity:1"
id="path1545" />
<path
d="m 42.517825,-23.010484 q -3.047998,0 -4.809064,-1.4224 -1.693333,-1.490132 -1.693333,-4.199464 0,-2.438399 1.693333,-3.996265 1.761066,-1.557866 4.809064,-1.557866 3.047999,0 4.741331,1.490133 1.693332,1.422399 1.693332,4.063998 0,2.506132 -1.761065,4.063998 -1.693333,1.557866 -4.673598,1.557866 z m -5.418664,43.078378 v -35.966382 h 10.837328 v 35.966382 z"
style="fill:#d94455;fill-opacity:1"
id="path1547" />
<path
d="m 69.645028,20.745227 q -5.215464,0 -9.347196,-2.438399 -4.131731,-2.438399 -6.57013,-6.637863 -2.370665,-4.267198 -2.370665,-9.6181286 0,-5.3509307 2.370665,-9.5503952 2.438399,-4.2671982 6.57013,-6.7055962 4.131732,-2.438399 9.347196,-2.438399 4.809064,0 8.805329,1.693332 4.063998,1.693333 6.434663,4.741331 l -5.892797,7.0442633 q -1.354666,-1.6933324 -3.589865,-2.8447985 -2.167465,-1.2191994 -4.741331,-1.2191994 -3.860798,0 -6.299197,2.6415987 -2.370665,2.5738653 -2.370665,6.6378633 0,3.9285313 2.438399,6.57013 2.438399,2.6415986 6.231463,2.6415986 2.573866,0 4.605865,-1.015999 2.099732,-1.0159999 3.725331,-2.9125323 l 5.825064,7.1119963 q -2.302932,2.912532 -6.434664,4.605864 -4.063998,1.693333 -8.737595,1.693333 z"
style="fill:#d94455;fill-opacity:1"
id="path1549" />
<path
d="m 86.544497,20.067894 v -50.122641 h 10.634128 v 18.355724 q 1.896532,-2.235199 4.741335,-3.589865 2.91253,-1.354666 6.09599,-1.354666 6.096,0 9.27946,3.725331 3.18347,3.7253317 3.18347,10.9050614 V 20.067894 H 109.57382 V -1.1326287 q 0,-6.57013 -5.55413,-6.3669301 -2.8448,0 -4.741333,1.7610658 -1.896532,1.6933324 -1.896532,4.2671978 V 20.067894 Z"
style="fill:#d94455;fill-opacity:1"
id="path1551" />
<path
d="m 138.59755,20.677494 q -4.53813,0 -8.12799,-2.370666 -3.52214,-2.438399 -5.62187,-6.637863 -2.09973,-4.267198 -2.09973,-9.6181286 0,-5.4863973 2.09973,-9.6858618 2.09973,-4.1994646 5.6896,-6.5701296 3.6576,-2.438399 8.39893,-2.438399 3.52213,0 6.23146,1.422399 2.70933,1.422399 4.4704,3.657598 v -4.334931 h 10.76959 v 35.966382 h -10.97279 v -4.334931 q -1.8288,2.235199 -4.6736,3.589865 -2.77706,1.354666 -6.16373,1.354666 z m 2.98027,-9.143996 q 3.72533,0 5.96053,-2.5738651 2.2352,-2.5738654 2.2352,-6.9087965 0,-4.3349312 -2.2352,-6.9087965 -2.2352,-2.6415987 -5.96053,-2.6415987 -3.6576,0 -5.8928,2.6415987 -2.16747,2.5738653 -2.16747,6.9087965 0,4.3349311 2.16747,6.9087965 2.2352,2.5738651 5.8928,2.5738651 z"
style="fill:#d94455;fill-opacity:1"
id="path1553" />
<path
d="m 165.72476,20.067894 v -35.966382 h 10.29547 l 0.2032,4.334931 q 1.89653,-2.235199 4.80906,-3.657598 2.91253,-1.422399 6.16373,-1.422399 6.096,0 9.27946,3.725331 3.18347,3.7253317 3.18347,10.9050614 V 20.067894 H 188.75409 V -1.1326287 q 0,-6.57013 -5.55413,-6.3669301 -2.8448,0 -4.74134,1.7610658 -1.89653,1.6933324 -1.89653,4.2671978 V 20.067894 Z"
style="fill:#d94455;fill-opacity:1"
id="path1555" />
<path
d="m 208.36291,20.81296 q -2.77707,0 -4.33494,-1.557866 -1.49013,-1.557865 -1.49013,-4.470397 0,-2.709332 1.6256,-4.402665 1.6256,-1.6933323 4.19947,-1.6933323 2.77706,0 4.33493,1.6255993 1.55786,1.557866 1.55786,4.470398 0,2.641598 -1.6256,4.334931 -1.6256,1.693332 -4.26719,1.693332 z"
style="fill:#708090;fill-opacity:1"
id="path1557" />
<path
d="m 234.60955,20.745227 q -5.62186,0 -10.02453,-2.370665 -4.33493,-2.438399 -6.90879,-6.637864 -2.50614,-4.2671977 -2.50614,-9.6858616 0,-5.418664 2.50614,-9.6181285 2.57386,-4.1994649 6.90879,-6.6378629 4.40267,-2.438399 10.02453,-2.438399 5.55413,0 9.88906,2.438399 4.40267,2.438398 6.9088,6.6378629 2.57386,4.1994645 2.57386,9.6181285 0,5.4186639 -2.57386,9.6858616 -2.50613,4.199465 -6.9088,6.637864 -4.33493,2.370665 -9.88906,2.370665 z m 0,-9.347195 q 3.6576,0 6.02826,-2.641599 2.37067,-2.6415987 2.30294,-6.7055966 0.0677,-4.1317313 -2.30294,-6.7733299 -2.37066,-2.6415987 -6.02826,-2.6415987 -3.6576,0 -6.096,2.709332 -2.37066,2.6415986 -2.30293,6.7055966 -0.0677,4.0639979 2.30293,6.7055966 2.4384,2.641599 6.096,2.641599 z"
style="fill:#708090;fill-opacity:1"
id="path1559" />
<path
d="m 256.85999,20.067894 v -35.966382 h 10.29546 l 0.2032,5.486397 q 1.8288,-2.777065 4.60586,-4.470397 2.8448,-1.761066 6.02827,-1.761066 1.2192,0 2.2352,0.2032 1.08373,0.2032 1.96426,0.474133 l -2.98026,11.9887937 q -0.74507,-0.474133 -2.032,-0.7450662 -1.2192,-0.3386665 -2.57387,-0.3386665 -2.98026,0 -4.94453,1.9642656 -1.89653,1.9642657 -1.89653,5.1477308 V 20.067894 Z"
style="fill:#708090;fill-opacity:1"
id="path1561" />
<path
d="m 298.88853,35.646553 q -4.40266,0 -8.80533,-1.286933 -4.33493,-1.286933 -7.04426,-3.318932 l 3.79306,-7.586129 q 2.16747,1.490133 4.8768,2.302932 2.77707,0.880533 5.75733,0.880533 5.08,0 7.5184,-2.302932 2.4384,-2.235199 2.4384,-6.97653 V 15.46203 q -1.76107,1.896532 -4.60587,3.115731 -2.77706,1.2192 -5.8928,1.2192 -4.94453,0 -8.80532,-2.235199 -3.79307,-2.302932 -6.02827,-6.299197 -2.16746,-4.0639979 -2.16746,-9.3471952 0,-5.418664 2.16746,-9.5503952 2.16747,-4.1994646 5.96053,-6.5701296 3.79307,-2.438399 8.5344,-2.438399 3.52213,0 6.5024,1.354666 2.98026,1.286932 4.74133,3.251198 l 0.2032,-3.860798 h 10.29546 v 33.05385 q 0,8.805329 -5.21547,13.614393 -5.14773,4.876798 -14.22399,4.876798 z m 0.27093,-24.248521 q 3.92854,0 6.23147,-2.5061324 2.37066,-2.5738654 2.37066,-6.9087965 0,-4.3349312 -2.37066,-6.9087965 -2.30293,-2.5738654 -6.23147,-2.5738654 -3.86079,0 -6.16373,2.6415987 -2.30293,2.5738653 -2.30293,6.8410632 0,4.2671978 2.30293,6.8410632 2.30294,2.5738657 6.16373,2.5738657 z"
style="fill:#708090;fill-opacity:1"
id="path1563" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.8 KiB

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save