dog-and-duck/docs/codox/intro.html

63 lines
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>Introduction</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Dog-and-duck</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="Desiderata.html"><div class="inner"><span>Desiderata</span></div></a></li><li class="depth-1 "><a href="Using_ActivityPub.html"><div class="inner"><span>Using ActivityPub</span></div></a></li><li class="depth-1 "><a href="Validation_Faults.html"><div class="inner"><span>Validation Faults in ActivityPub documents</span></div></a></li><li class="depth-1 current"><a href="intro.html"><div class="inner"><span>Introduction</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>dog-and-duck</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>quack</span></div></div></li><li class="depth-3"><a href="dog-and-duck.quack.picky.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>picky</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.constants.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>constants</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.control-variables.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>control-variables</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.fault-messages.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fault-messages</span></div></a></li><li class="depth-4 branch"><a href="dog-and-duck.quack.picky.required-properties.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>required-properties</span></div></a></li><li class="depth-4"><a href="dog-and-duck.quack.picky.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-3"><a href="dog-and-duck.quack.quack.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>quack</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -238px;"><span class="top" style="height: 247px;"></span><span class="bottom"></span></span><span>scratch</span></div></div></li><li class="depth-3 branch"><a href="dog-and-duck.scratch.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-3 branch"><a href="dog-and-duck.scratch.parser.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>parser</span></div></a></li><li class="depth-3"><a href="dog-and-duck.scratch.scratch.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scratch</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>utils</span></div></div></li><li class="depth-3"><a href="dog-and-duck.utils.process.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>process</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#introduction" name="introduction"></a>Introduction</h1>
<h2><a href="#the-old-dog-and-duck" name="the-old-dog-and-duck"></a>The Old Dog and Duck</h2>
<p>A Clojure library designed to implement the ActivityPub protocol, obviously.</p>
<p><img src="../images/dog-and-duck-beverley.jpg" alt="The Dog and Duck, Derby" /></p>
<p>The Old Dog and Duck is clearly a pub, and its a pub related to an activity; to whit, hunting ducks with dogs. Yes, of course one could also hunt dogs with ducks, but in practice that doesnt work so well. The point isnt whether or not I approve of hunting ducks with dogs (or vice versa); to be clear, I dont. The point is that its a pub related to an activity, and is therefore an <a href="https://www.w3.org/TR/activitypub/">ActivityPub</a>.</p>
<p>Are we clear?</p>
<p>Good.</p>
<p>Let us proceed.</p>
<p><strong>The Old Dog and Duck</strong> is intended to be a set of libraries to enable people to build stuff which interacts with ActivityPub. It isnt intended to be a replacement for, or clone of, Mastodon. I do think I might implement my own ActivityPub server on top of The Old Dog and Duck, that specifically might allow for user-pluggable feed-sorting algorithms and with my own user interface/user experience take, but that project is not (yet, at any rate) this project.</p>
<h2><a href="#status" name="status"></a>Status</h2>
<p>This is a long way pre-alpha. Everything will change. Feel free to play, but do so at your own risk. Contributions welcome.</p>
<h2><a href="#architecture" name="architecture"></a>Architecture</h2>
<p>There are a number of separate concerns required to implement ActivityPub. They include</p>
<ol>
<li>Parsing ActivityStreams messages received from peers and from clients;</li>
<li>Persisting ActivityStreams objects;</li>
<li>Delivering ActivityStreams objects to peers;</li>
<li>Delivering ActivityStreams objects to clients.</li>
</ol>
<h2><a href="#some-motivations" name="some-motivations"></a>Some motivations</h2>
<h3><a href="#empowering-users" name="empowering-users"></a>Empowering users</h3>
<p>The <a href="https://www.w3.org/TR/activitypub/#Overview">ActivityPub spec</a> starts by saying:</p>
<blockquote>
<p>ActivityPub provides two layers:</p>
<ol>
<li>A server to server federation protocol (so decentralized websites can share information)</li>
<li>A client to server protocol (so users, including real-world users, bots, and other automated processes, can communicate with ActivityPub using their accounts on servers, from a phone or desktop or web application or whatever).</li>
</ol>
</blockquote>
<p>Im interested in driving much more functionality down to the the client, for example feed ordering and presentation. This would allow users, for example, to choose their own (or roll their own) feed-ordering algorithms.</p>
<p>My proposal would be to deliver exactly the same ActivityStreams format to my client as to other servers. There may be a valid reason for not doing this, but if there is I will discover it in due course.</p>
<h3><a href="#enhanced-resiliency" name="enhanced-resiliency"></a>Enhanced resiliency</h3>
<p>The <a href="https://www.w3.org/TR/activitystreams-core/">ActivityStreams</a> spec seems predicated on always up communication between at least servers, which is perhaps why there is a two tier network of servers and clients. It also depends on HTTPS certificates to identify servers, which implies its vulnerable to disruption by a hostile actor with the ability to revoke certificates.</p>
<p>My own history with social media dates back to Usenet over UUCP, a system designed explicitly for intermittent low bandwidth connections; such a system is immensely resilient in the face of disruption to infrastructure.</p>
<p>Social media is useful to concerted popular action in periods of disruption, whether in the case of civil ememrgency such as earthquakes, wild fires and floods, in the case of wars, or in the case of intrusive surveillance by authoritarian governments. But to be useful in such situations it needs to be resilient, and one of the things it needs to be resilient to is parts of the network being intermittently available, or requiring rerouting.</p>
<p>In this Im influenced by and hope to try to implement ideas from <a href="https://blog.locut.us/about/">Ian Clarke</a>s <a href="https://en.wikipedia.org/wiki/Freenet">Freenet</a> and <a href="http://tahrirproject.org/">Tahrir</a> projects, especially <a href="https://en.wikipedia.org/wiki/Web_of_trust">webs of trust</a>.</p>
<p>To be clear, it is important for The Old Dog and Duck to be able to interact with other existing vanilla ActivityStreams implementations, but I hope to experiment with enhanced communication between Dog and Duck servers to provide more FreeNet-like resiliency.</p>
<h2><a href="#proposed-dog-and-duck-libraries" name="proposed-dog-and-duck-libraries"></a>Proposed dog-and-duck libraries</h2>
<p><strong>NOTE THAT</strong> at the present stage all the proposed libraries are in one package, namely this package, but that it is proposed that in future they will form separate libraries in separate packages.</p>
<h3><a href="#bar" name="bar"></a>Bar</h3>
<p>Where conversations happen. Handle interactions with clients.</p>
<h3><a href="#cellar" name="cellar"></a>Cellar</h3>
<p>Where things are stored. Persistance for ActivityStreams objects; I may at least initially simply copy the Mastodon postgres schema, but equally I may not.</p>
<h3><a href="#pantry" name="pantry"></a>Pantry</h3>
<p>Where deliveries are ordered and arrive; and from where deliveries onwards are despatched. Handle interactions with peers.</p>
<h3><a href="#quack" name="quack"></a>Quack</h3>
<p>Duck-typing for ActivityStreams objects.</p>
<p>As of version 0.1.0, this is substantially the only part that is yet at all useful, and it is still a long way from finished or robust.</p>
<h3><a href="#scratch" name="scratch"></a>Scratch</h3>
<p>What the dog does when bored. Essentially, a place where I can learn how to make this stuff work, but perhaps eventually an ActivityPub server in its own right.</p>
<h2><a href="#usage" name="usage"></a>Usage</h2>
<p>At present, only the duck-typing functions work. To play with them, use</p>
<pre><code class="clojure">(require '[dog-and-duck.quack.quack :as q])
</code></pre>
<h2><a href="#testing" name="testing"></a>Testing</h2>
<p>Prior to testing, you should clone <a href="https://github.com/w3c-social/activitystreams-test-documents">activitystreams-test-documents</a> into the <code>resources</code> directory. You can then test with</p>
<pre><code class="bash">lein test
</code></pre>
<h2><a href="#license" name="license"></a>License</h2>
<p>Copyright © Simon Brooke, 2022.</p>
<p>This program and the accompanying materials are made available under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.</p></div></div></div></body></html>