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 = {
|
|
|
|
# serve base domain pub.solar for mastodon.pub.solar
|
|
|
|
# https://masto.host/mastodon-usernames-different-from-the-domain-used-for-installation/
|
|
|
|
"/.well-known/host-meta" = {
|
|
|
|
extraConfig = ''
|
|
|
|
return 301 https://mastodon.pub.solar$request_uri;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# Tailscale OIDC webfinger requirement plus Mastodon webfinger redirect
|
|
|
|
"/.well-known/webfinger" = {
|
|
|
|
# Redirect requests that match /.well-known/webfinger?resource=* to Mastodon
|
|
|
|
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-10-28 15:50:37 +00:00
|
|
|
return 302 https://cloud.pub.solar/s/2tRCP9aZFCiWxQy;
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|