36 points · by Timja · 4y ago · 61 comments
I don't really understand the difference between ActivityPub and Mastodon yet.
If I write my own ActivityPub software (server code with web frontend), can I interact with Mastodon users just as if I also were a Mastodon user? Or would I have to implement some Mastodon specific protocols?
I don't know the fediverse protocol yet, but I would hope I can get away with just two files like this:
receive.php
<?php
if (!isset(servers_i_talk_to[$_SERVER['REMOTE_ADDR']]) die();
$data = $_POST['msg']
$file = 'log/' + time().'-'.mt_rand();
file_put_contents($file, $data);
send.php <?php
$data=$_POST['data'];
for ($servers_i_talk_to as $server) {
$url = "https://$server/receive.php";
$msg = ['msg'=>$data];
$opts = [
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($msg)
]
];
$context = stream_context_create($opts);
file_get_contents($url, false, $context);
}
Where receive.php is openly accessible and send.php is protected by a password.The endpoints are surely called differently than receive.php and send.php. But this is how I would hope ActivityPub works in principle.
Of course, this would be very bare. To read, I would have to read the raw log of ActivityPub messages and to post, I would have to manualy put together an ActivityPub message.
But I would be in the Fediverse and could add more convenience functionality later.
In order to federate an object you must:
- send requests with proper 'HTTP Signatures' (many AP nodes have strict enforcement here)
- which requires you to have an actor with an attached signing pubkey
- so you have to host the LD-JSON actor descriptor on another endpoint
- actors MUST have an attached inbox & outbox, your receive endpoint will need to sit at your actor's inbox (on POST). both of these are OrderedCollections of Activities
- and in order to be properly interoperable you will probably need to maintain follow relations & write an endpoint which can ACK/NAK follows, etc etc
If admin of serverA decides to add serverB to the servers_i_talk_to array, they also ask serverB to give them a public key and from then on serverA only accepts messages from serverB if they are signed with the corresponding private key?
Is that so that serverB can change its IP without interrupting the communication with serverA?
- GoToSocial: https://docs.gotosocial.org/
- Pleroma: https://pleroma.social/
GoToSocial: 6849 files plus dependencies
Pleroma: 2289 files plus dependencies
I might miss my target of 2 files. But I will surely not get the filecount go up to these extremes :)Theoretically you should be able to follow anyone from pixelfed on Mastodon and vice versa because both support ActivityPub. I haven't tried doing that myself.
Are likes not federated through the Fediverse? If someone on mastodon.social likes a post on pixelfed.social, will that increase the like count on pixelfed.social?
That's a pretty faithful clone of instagram then…
Musk per his own statements wants to increase free speech… why is that bad?
Regardless, Gab and Truth.social both use mastodon. So it’ll improve their platforms the more people switch (and improve mastsdon). Technically the nodes can interconnect; though I believe that’s not happening today
This is kind of the nature of the beast. If the problem is that the remote instance allows things that you find intolerable, then you have to ban the remote instance from federating with you. Speech may be free, but actions have consequences.
I don't "like" speech that lies, hates, tries to manipulate, tries to shock, or is just incoherent.
So, do I have a belief in "free speech" ?
BTW, the USA's First Amendment just prevents the govt from stopping religion or the press etc. It's doesn't mean anyone has to listen to anyone. It doesn't mean some platform such as Facebook or a newspaper is required to propagate your speech.
If I'm wrong I believe someone will correct me pretty fast but that's my current understanding.
If the popular solutions are too complex, maybe you want to take a look at https://microblog.pub, a relatively small and simple AP implementation designed for single-user instances.
That page also links to https://blog.joinmastodon.org/2018/06/how-to-implement-a-bas..., which is a demo of hardcoding one part of the spec from scratch.
So yes you can certainly interact with Mastodon users and you will need to.
https://www.r-bloggers.com/2022/10/getting-acquainted-with-m... the largest Mastodon instance has less than a million users. Twitter has, what, 450 million?
I read some websites about "host your own server" and some were talking explicitly about Mastodon and some were like "let's do selfhostes microblogging with this AP server"
And I asked myself, if I could use AP servers to follow people and let them follow me when they're on a public Mastodon instance.
(And therefore I’m a little bit ashamed that I have hard time avoiding Mastodon and Twitter. Soooo much new stuff, all the time – not super high quality, though…)