Static ActivityPub. Damned WebFinger

WebFinger is not a part of ActivityPub W3C standard, and I hope will never be. But it is required if you want to connect any instance of plume you have to support it. This is terrible.

The worst thing about WebFinger, is that it is IMPOSSIBLE to implement it as a static file. Even if you have only two users and they are not about to change, you HAVE TO create a script to parse parameters of /.well-known/webfinger or do some SSI trick, though information never changes. This is bad. This is VERY BAD.

So I beg you: never ever use WebFinger. Or at leas do not do it mandatory thing to connect communicate with you.

So to play around with plume, I have to have WebFinger. It makes me sad, but there is no other way.

So RFC 7033 says that I should have a script at /.well-known/webfinger that receives userID as a parameter and then returns a JSON with info concerning that user. You can also add some options to the parameter, to specify what kind of info you want to get.

Plume uses WebFinger to get ActivePub actor's URL that is associated with this UserID. Why I can't just use Actors URL in Plume is beyond my understanding. But Plume require WebFinger so I have to deal with it.

Since I will have only one user in my Static example I will try to make my life more easy. I will nevertheless do it static, I will put some json in /.well-known/webfinger URL, since I would use only one user, it would be the only answer that I need, so all parameters of /.well-known/webfinger will be ignored for good.

So I will put this text online

{
   "subject":"acct:nataraj@ssl.nataraj.su",
   "aliases":[
      "https://ssl.nataraj.su/users/nataraj.ap"
   ],

  "links":[
    {
         "rel":"self",
         "href":"https://ssl.nataraj.su/users/nataraj.ap",
         "template":null,
         "type":"application/activity+json"
     }
  ]
}

so it will be opened as /.well-known/webfinger

and set application/jrd+json; Content-type header for it. In nginx it will be something like this:

        location /.well-known/ {
                default_type application/jrd+json;
                root   /srv/www/nataraj.su/ssl;
                index  index.html index.htm;
        }

Here nataraj@ssl.nataraj.su is my WebFinger UserID, and https://ssl.nataraj.su/users/nataraj.ap is an URL to ActivityPub actor JSON that we will create later. It is our real identifier in ActivityPub distributed/ network.

Now WebFinger should work. It will lead you nowhere now, but if you try to go to https://fediverse.blog/@/nataraj@ssl.nataraj.su url (replace ssl.nataraj.su here and above with your own domain name) you will hopefully find in your web logs that somebody tried to reach /users/nataraj.ap and get 404. If you find this line, then you static WebFinger works well. If not then something does not work as it should.