DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

ref: 581ef98c3d8c0d9c186775c7766f1000757cbd6a nix-arta/systems/hosts/auth/webfinger.nix -rw-r--r-- 717 bytes
581ef98cJonni Liljamo feat: add alderaan 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{...}: {
  networking.firewall.allowedTCPPorts = [80];

  services.nginx = {
    enable = true;
    virtualHosts."liljamo.com" = {
      default = true;
      locations."/.well-known/webfinger" = {
        # https://www.authelia.com/integration/openid-connect/tailscale/
        extraConfig = ''
          set $jlres '{"subject": "acct:jonni@liljamo.com", "links": [{"rel": "http://openid.net/specs/connect/1.0/issuer", "href": "https://auth.liljamo.com"}]}';
          if ($request_uri ~ 'resource=acct:jonni@liljamo.com') {
            return 200 $jlres;
          }
          if ($request_uri ~ 'resource=acct%3Ajonni%40liljamo.com') {
            return 200 $jlres;
          }
        '';
      };
    };
  };
}