2019-04-12 01:02:17 +02:00
|
|
|
honk spec
|
|
|
|
|
|
|
|
-- references
|
|
|
|
|
|
|
|
See security.txt for some notes on security.
|
|
|
|
|
2019-04-12 18:32:07 +02:00
|
|
|
See ping.txt for a proposed Ping extension to ActivityPub.
|
|
|
|
|
2019-04-15 17:14:30 +02:00
|
|
|
-- retries
|
|
|
|
|
|
|
|
If a message can't be delivered, we backoff and retry.
|
|
|
|
|
|
|
|
1 - five minutes later in case the servce restarted
|
|
|
|
2 - one hour later in case the server rebooted
|
|
|
|
3 - 12 more hours later in case the server was upgraded
|
|
|
|
4 - 24 more hours later in case there was a catastrophe
|
|
|
|
5 - it's dead.
|
|
|
|
|
|
|
|
A random drift of up to 10% is added to each delay to avoid swarming.
|
|
|
|
|
2019-04-23 22:32:37 +02:00
|
|
|
-- federating
|
|
|
|
|
|
|
|
Messages are transformed for federation and display. Some transformations
|
2019-04-29 19:42:38 +02:00
|
|
|
occur send side and some occur receive side because it's more exciting that
|
2019-04-23 22:32:37 +02:00
|
|
|
way. @mentions and *markdown* are converted to HTML before transmission.
|
|
|
|
Message :emoji: are converted to inline images after receiving.
|
|
|
|
|
2019-04-29 19:42:38 +02:00
|
|
|
Up to four parents of a reply will be fetched.
|
|
|
|
|
|
|
|
Attachments for received messages are rescaled before saving.
|
|
|
|
|
2019-04-12 01:02:17 +02:00
|
|
|
-- schema
|
2019-04-11 01:00:59 +02:00
|
|
|
|
2019-04-11 16:10:27 +02:00
|
|
|
Some notes on the database schema. Mostly for development, but maybe useful
|
|
|
|
for administration as well.
|
|
|
|
|
|
|
|
The config table contains settings, some of which may not be editable via the
|
|
|
|
normal interface.
|
|
|
|
|
2019-04-29 19:42:38 +02:00
|
|
|
For development purposes, adding a config value ('debug', 1) to the database
|
|
|
|
will disable caching and hot reload the templates. It's not meant to be
|
2019-04-11 16:10:27 +02:00
|
|
|
harmful in production, just less efficient.
|
2019-04-11 01:00:59 +02:00
|
|
|
|
|
|
|
We don't use null, only empty strings. This is easier to work with on the go
|
|
|
|
side.
|
|
|
|
|
|
|
|
The main table is honks. This stores both locally created honks and incoming
|
|
|
|
ActivityPub notes converted to honks. It is important to differentiate the two
|
|
|
|
cases so that we don't accidentally publish external honks in the public web
|
|
|
|
view. (Previously this was accomplished via separate tables. That made some
|
|
|
|
queries more difficult, but I think it's possible to workaround this. It would
|
|
|
|
be considerably safer.) The honker column will be empty for local honks.
|
|
|
|
|
|
|
|
The what column further refines the type of honk. If a reply, tonk. If
|
|
|
|
deleted, zonk. If shared, bonk. In particular for the case of bonk, there
|
|
|
|
aren't enough columns to store original honker and bonker. This seems to work
|
|
|
|
out okay though.
|
|
|
|
|
2019-04-29 19:42:38 +02:00
|
|
|
Attachments are physically saved as files, and logically joined to honks via
|
|
|
|
the donks table. Emus are saved as donks as well.
|
|
|
|
|
2019-04-11 01:00:59 +02:00
|
|
|
The honkers table is used to manage follows and followers. The flavor column
|
|
|
|
describes what. 'sub' is a follow. We have subscribed to their newsletter.
|
2019-04-20 04:58:49 +02:00
|
|
|
'dub' is a follower. They get dubbed whenever we honk.
|
|
|
|
|
|
|
|
The xonkers table stores info about external accounts that we may interact
|
2019-04-29 19:42:38 +02:00
|
|
|
with. Their keys, their inboxes, etc. Not user visible.
|
2019-04-20 04:58:49 +02:00
|
|
|
|
|
|
|
The zonkers table stores things we do not wish to see, per the wherefore
|
|
|
|
column. zonkers are bad people, zurls are bad hosts, zonvoys are bad threads.
|
2019-04-11 01:00:59 +02:00
|
|
|
|
|
|
|
The xid column generally corresponds to ActivityPub id. For local honks, it
|
|
|
|
will be a short string, not a complete URL.
|
|
|
|
|
|
|
|
Note that some logical seeming joins won't work. The honker column of honks
|
2019-04-15 23:52:39 +02:00
|
|
|
does not have a corresponding entry in the honkers table, since we frequently
|
2019-04-11 01:00:59 +02:00
|
|
|
receive messages from people we don't follow. Should we track everybody whose
|
|
|
|
identity crosses our path? This seems unnecessary. The honkers table is more
|
|
|
|
like a mapping of active relationships, not a directory of all peoples.
|
|
|
|
|
2019-04-15 17:14:30 +02:00
|
|
|
Some deduping of honks is performed. This may not be perfect.
|