spec.txt (view raw)
1honk spec
2
3-- references
4
5See security.txt for some notes on security.
6
7-- schema
8
9Some notes on the database schema. Mostly for development, but maybe useful
10for administration as well.
11
12The config table contains settings, some of which may not be editable via the
13normal interface.
14
15The welcome message on the first page is stored as servermsg.
16
17For development purposes, adding a config value (debug, 1) to the database
18will disable caching and hot reload templates. It's not meant to be
19harmful in production, just less efficient.
20
21We don't use null, only empty strings. This is easier to work with on the go
22side.
23
24The main table is honks. This stores both locally created honks and incoming
25ActivityPub notes converted to honks. It is important to differentiate the two
26cases so that we don't accidentally publish external honks in the public web
27view. (Previously this was accomplished via separate tables. That made some
28queries more difficult, but I think it's possible to workaround this. It would
29be considerably safer.) The honker column will be empty for local honks.
30
31The what column further refines the type of honk. If a reply, tonk. If
32deleted, zonk. If shared, bonk. In particular for the case of bonk, there
33aren't enough columns to store original honker and bonker. This seems to work
34out okay though.
35
36The honkers table is used to manage follows and followers. The flavor column
37describes what. 'sub' is a follow. We have subscribed to their newsletter.
38'dub' is a follower. They get dubbed whenever we honk. We also use this table
39to store public keys for anyone we interact with. This is regrettable.
40
41The xid column generally corresponds to ActivityPub id. For local honks, it
42will be a short string, not a complete URL.
43
44Such explanation would be less necessary were the tables not misused for
45multiple purposes. Will probably split them apart again soon.
46
47Note that some logical seeming joins won't work. The honker column of honks
48does not have a correspondng entry in the honkers table, since we frequently
49receive messages from people we don't follow. Should we track everybody whose
50identity crosses our path? This seems unnecessary. The honkers table is more
51like a mapping of active relationships, not a directory of all peoples.
52
53Some deduping of honks is performed. Known shortcoming: only the first bonk is
54recorded. Subsequent bonks, even by different actors, are ignored. Bonus
55shortcoming: we download such bonks every time.