Exploring ActivityPubhttps://fediverse.blog/~/ExploringActivityPub/atom.xml2019-02-14T20:00:27.742206+00:00<![CDATA[Static ActivityPub. Damned WebFinger]]>https://fediverse.blog/~/ExploringActivityPub/static-activity-pub-damned-web-finger/2019-02-14T20:00:27.742206+00:00natarajhttps://fediverse.blog/@/nataraj/2019-02-14T20:00:27.742206+00:00<![CDATA[<p>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 <a href="https://joinplu.me/" rel="noopener noreferrer">plume</a> you <b>have to</b> support it. This is terrible.</p>
<p>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.</p>
<p>So I beg you: never ever use WebFinger. Or at leas do not do it mandatory thing to connect communicate with you.</p>
<p>So to play around with plume, I have to have WebFinger. It makes me sad, but there is no other way.</p>
<p>So <a href="https://tools.ietf.org/html/rfc7033" rel="noopener noreferrer">RFC 7033</a> 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.</p>
<p>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.</p>
<p>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.</p>
<p>So I will put this text online</p>
<pre><code>{
"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"
}
]
}
</code></pre>
<p>so it will be opened as /.well-known/webfinger</p>
<p>and set application/jrd+json; Content-type header for it. In nginx it will be something like this:</p>
<pre><code> location /.well-known/ {
default_type application/jrd+json;
root /srv/www/nataraj.su/ssl;
index index.html index.htm;
}
</code></pre>
<p>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.</p>
<p>Now WebFinger should work. It will lead you nowhere now, but if you try to go to https://fediverse.blog/<a href="//fediverse.blog/@//" rel="noopener noreferrer">@</a>/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. </p>
]]>