2023-10-28 14:26:02 +00:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
{
|
2023-10-28 15:50:37 +00:00
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"d '/srv/www/pub.solar' 0750 hakkonaut hakkonaut - -"
|
|
|
|
];
|
|
|
|
|
2023-10-28 14:26:02 +00:00
|
|
|
services.nginx.virtualHosts = {
|
2023-10-28 15:50:37 +00:00
|
|
|
"www.pub.solar" = {
|
|
|
|
enableACME = true;
|
|
|
|
addSSL = true;
|
|
|
|
locations."/" = {
|
|
|
|
extraConfig = ''
|
|
|
|
return 301 https://pub.solar$request_uri;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2023-10-28 14:26:02 +00:00
|
|
|
|
|
|
|
"pub.solar" = {
|
|
|
|
default = true;
|
|
|
|
enableACME = true;
|
2023-10-28 15:50:37 +00:00
|
|
|
forceSSL = true;
|
2023-10-28 14:26:02 +00:00
|
|
|
|
|
|
|
locations = {
|
2024-01-27 19:29:30 +00:00
|
|
|
# serve base domain pub.solar for mastodon.pub.solar
|
|
|
|
# https://masto.host/mastodon-usernames-different-from-the-domain-used-for-installation/
|
2023-10-28 14:26:02 +00:00
|
|
|
"/.well-known/host-meta" = {
|
|
|
|
extraConfig = ''
|
|
|
|
return 301 https://mastodon.pub.solar$request_uri;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-01-27 19:29:30 +00:00
|
|
|
# Tailscale OIDC webfinger requirement plus Mastodon webfinger redirect
|
2023-10-28 14:26:02 +00:00
|
|
|
"/.well-known/webfinger" = {
|
2024-01-27 19:29:30 +00:00
|
|
|
# Redirect requests that match /.well-known/webfinger?resource=* to Mastodon
|
2023-10-28 14:26:02 +00:00
|
|
|
extraConfig = ''
|
2023-10-28 15:50:37 +00:00
|
|
|
if ($arg_resource) {
|
2023-10-28 14:26:02 +00:00
|
|
|
return 301 https://mastodon.pub.solar$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
add_header Content-Type text/plain;
|
|
|
|
return 200 '{\n "subject": "acct:admins@pub.solar",\n "links": [\n {\n "rel": "http://openid.net/specs/connect/1.0/issuer",\n "href": "https://auth.pub.solar/realms/pub.solar"\n }\n ]\n}';
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
"/satzung" = {
|
|
|
|
extraConfig = ''
|
2023-11-15 18:48:36 +00:00
|
|
|
return 302 https://cloud.pub.solar/s/iaKqiW25QJpHPYs;
|
2023-10-28 14:26:02 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
"/" = {
|
|
|
|
root = "/srv/www/pub.solar";
|
|
|
|
index = "index.html";
|
2023-10-28 15:50:37 +00:00
|
|
|
tryFiles = "$uri $uri/ =404";
|
2023-10-28 14:26:02 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|