Regenerated documentation, but still no new tests.

This commit is contained in:
Simon Brooke 2022-12-31 09:10:25 +00:00
parent c18a0a5b8e
commit 1cd7f1fc1a
24 changed files with 143 additions and 70 deletions

7
doc/Desiderata.md Normal file
View file

@ -0,0 +1,7 @@
# Desiderata
*Social media features which users want which [Mastodon](https://en.wikipedia.org/wiki/Mastodon_(social_network)) does not provide, or provides poorly.*
1. User-specified inbox-ordering algorithms;
2. Outbox search, by user (i.e. 'find all the times I interacted with x');
3. Outbox search, full text (i.e. 'find the post where I wrote x');

View file

@ -0,0 +1,5 @@
# Per-User Database
*This is a design thought, not a design decision.*
Obviously, the way to give each user control of their social media is for each user to have effectively their own server, and that thought is behind my ideas about driving more functionality down to the client. Allowing an architecture of intermittent links helps with this - the same client will not always appear on the same ip address and thus cannot use conventional SSL certificates for authentication, so we need a workaround for that.

View file

@ -52,4 +52,3 @@ The Tombstone object is a means of acknowledging that the requested object did o
If we're pushing entire objects which may include media attachments to the inboxes of many recipients who may never choose to read them, that feels like a lot of wasted bandwidth. However, if we're pushing only ids or links of posts which are not public, that feels like a major security headache in verifying that the requestors are indeed verified recipients. If we're pushing entire objects which may include media attachments to the inboxes of many recipients who may never choose to read them, that feels like a lot of wasted bandwidth. However, if we're pushing only ids or links of posts which are not public, that feels like a major security headache in verifying that the requestors are indeed verified recipients.
Again, the fact that Mastodon is able to show me '[user] edited a post' items in my notifications seems to imply that updates of the complete edited object are being pushed out to all recipients' inboxes, and again that seems expensive. Again, the fact that Mastodon is able to show me '[user] edited a post' items in my notifications seems to imply that updates of the complete edited object are being pushed out to all recipients' inboxes, and again that seems expensive.

View file

@ -0,0 +1,9 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>Desiderata</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 current"><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 "><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="#desiderata" name="desiderata"></a>Desiderata</h1>
<p><em>Social media features which users want which [Mastodon](<a href="https://en.wikipedia.org/wiki/Mastodon_(social_network)">https://en.wikipedia.org/wiki/Mastodon_(social_network)</a>) does not provide, or provides poorly.</em></p>
<ol>
<li>User-specified inbox-ordering algorithms;</li>
<li>Outbox search, by user (i.e. find all the times I interacted with x);</li>
<li>Outbox search, full text (i.e. find the post where I wrote x);</li>
</ol></div></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -7,15 +7,14 @@
:output-path "docs/codox" :output-path "docs/codox"
:source-uri "https://github.com/simon-brooke/dog-and-duck/blob/master/{filepath}#L{line}"} :source-uri "https://github.com/simon-brooke/dog-and-duck/blob/master/{filepath}#L{line}"}
:description "A playground for hacking ActivityPub stuff." :description "A playground for hacking ActivityPub stuff."
:dependencies [[org.clojure/clojure "1.11.1"] :dependencies [[clj-activitypub/activitypub "0.49"]
[com.taoensso/timbre "6.0.4"]
[mvxcvi/clj-pgp "1.1.0"]
[org.bouncycastle/bcpkix-jdk18on "1.72"]
[org.clojure/clojure "1.11.1"]
[org.clojure/data.json "2.4.0"] [org.clojure/data.json "2.4.0"]
[org.clojure/math.numeric-tower "0.0.5"] [org.clojure/math.numeric-tower "0.0.5"]
[org.clojure/spec.alpha "0.3.218"] [org.clojure/spec.alpha "0.3.218"]]
[mvxcvi/clj-pgp "1.1.0"]
[org.bouncycastle/bcpkix-jdk18on "1.72"] ;; required by clj-activitypub
[clj-http "3.12.3"] ;; required by clj-activitypub
[cheshire "5.11.0"] ;; if this is not present, clj-http/client errors with 'json-enabled?'
[com.taoensso/timbre "6.0.4"]]
:license {:name "GPL-2.0-or-later" :license {:name "GPL-2.0-or-later"
:url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"} :url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"}
:plugins [[lein-cloverage "1.2.2"] :plugins [[lein-cloverage "1.2.2"]

View file

@ -0,0 +1,11 @@
{
"folders": [
{
"path": "../.."
},
{
"path": "../../../clj-activitypub"
}
],
"settings": {}
}

View file

@ -302,11 +302,12 @@
(defn activity-faults (defn activity-faults
[x] [x]
(concat-non-empty (persistent-object-faults x) (concat-non-empty
(activity-type-faults x) (persistent-object-faults x)
(list (activity-type-faults x)
(when-not (list
(has-activity-type? x) (when-not
(make-fault-object :must :not-activity-type)) (has-activity-type? x)
(when-not (string? (:summary x)) (make-fault-object :should :no-summary))))) (make-fault-object :must :not-activity-type))
(when-not (string? (:summary x)) (make-fault-object :should :no-summary)))))

View file

@ -0,0 +1,2 @@
(ns dog-and-duck.quack.picky.required-properties)

View file

@ -2,8 +2,11 @@
"Scratchpad where I try to understand how to do this stuff." "Scratchpad where I try to understand how to do this stuff."
(:require [clj-activitypub.core :as activitypub] (:require [clj-activitypub.core :as activitypub]
[clj-activitypub.webfinger :as webfinger] [clj-activitypub.webfinger :as webfinger]
[clj-activitypub.net :as activitypub-net]
[clj-pgp.generate :as pgp-gen] [clj-pgp.generate :as pgp-gen]
[clojure.walk :refer [keywordize-keys]])) [clojure.walk :refer [keywordize-keys]]
[clojure.pprint :refer [pprint]]
[clojure.data.json :as json]))
;;; Copyright (C) Simon Brooke, 2022 ;;; Copyright (C) Simon Brooke, 2022
@ -24,23 +27,29 @@
;;; Use any ActivityPub account handle you like - for example, your own ;;; Use any ActivityPub account handle you like - for example, your own
(def account-handle "@simon_brooke@mastodon.scot") (def account-handle "@simon_brooke@mastodon.scot")
(def handle (activitypub/parse-account account-handle)) ;;(def handle (activitypub/parse-account account-handle))
(webfinger/fetch-user-id "mastodon.scot" "simon_brooke") ;;(webfinger/fetch-user-id "mastodon.scot" "simon_brooke")
(apply webfinger/fetch-user-id (map handle [:domain :username])) ;;(apply webfinger/fetch-user-id (map handle [:domain :username]))
;;; Retrieve the account details from its home server ;;; Retrieve the account details from its home server
;;; (`keywordize-keys` is not necessary here but produces a more idiomatic clojure ;;; (`keywordize-keys` is not necessary here but produces a more idiomatic clojure
;;; data structure) ;;; data structure)
(def account (def account
"Fetch my account to mess with" (-> account-handle
(let [handle (activitypub/parse-account account-handle)] (webfinger/parse-handle)
(keywordize-keys (webfinger/fetch-user-id!)
(activitypub/fetch-user (activitypub-net/fetch-user!)
(apply webfinger/fetch-user-id (map handle [:domain :username])))))) (select-keys [:name :preferredUsername :inbox :summary])))
;;; examine what you got back! ;; ;;; examine what you got back!
(:inbox account) (:inbox account)
(-> account
:inbox
slurp
json/read-str
pprint) ;; => 80
;; (def rsa (pgp-gen/rsa-keypair-generator 2048)) ;; (def rsa (pgp-gen/rsa-keypair-generator 2048))
;; (def kp (pgp-gen/generate-keypair rsa :rsa-general)) ;; (def kp (pgp-gen/generate-keypair rsa :rsa-general))