summaryrefslogtreecommitdiff
path: root/doc/snac.5
diff options
context:
space:
mode:
Diffstat (limited to 'doc/snac.5')
-rw-r--r--doc/snac.5131
1 files changed, 131 insertions, 0 deletions
diff --git a/doc/snac.5 b/doc/snac.5
new file mode 100644
index 0000000..a5311e4
--- /dev/null
+++ b/doc/snac.5
@@ -0,0 +1,131 @@
1.Dd $Mdocdate$
2.Dt SNAC 5
3.Os
4.Sh NAME
5.Nm snac
6.Nd message formatting and file format documentation
7.Sh DESCRIPTION
8The
9.Nm
10daemon processes messages from other servers in the Fediverse
11using the ActivityPub protocol.
12.Pp
13This manual describes the allowed formatting of note messages
14and the disk storage layout of
15.Nm
16server and user data. For the operation manual, see
17.Xr snac 1 .
18For the administration manual, see
19.Xr snac 8 .
20.Ss Message Formatting
21Message notes respect the entered new line breaks rigurously.
22A special subset of Markdown is allowed, including:
23.Bl -tag -width tenletters
24.It bold
25**text between two pairs of asterisks**
26.It italic
27*text between a pair of asterisks*
28.It code
29Text `between backticks` is formatted as code.
30.Bd -literal
31```
32/* text between lines with only three backticks is preformatted */
33int main(int argc, char *argv[])
34{
35 return 0;
36}
37
38```
39.Ed
40.It links
41Standalone URLs.
42.It quoted text
43Lines starting with >.
44.It User Mentions
45Strings in the format @user@host are requested using the Webfinger
46protocol and converted to links and mentions if something reasonable
47is found.
48.El
49.Pp
50HTML tags are left untouched. This is probably a bad idea that may
51change in future versions.
52.Pp
53.Ss Disk Layout
54This section documents version 1 of the disk storage layout. It's still
55subject to change.
56.Pp
57The base directory contains the following files and folders:
58.Bl -tag -width tenletters
59.It Pa server.json
60Server configuration.
61.It Pa user/
62Directory holding user subdirectories.
63.El
64.Pp
65Each user directory is a subdirectory of
66.Pa BASEDIR/user/ ,
67has the user id as name and contains the following subdirectories and files:
68.Bl -tag -width tenletters
69.It Pa user.json
70User configuration file.
71.It Pa key.json
72SHA-1 secret/public key PEM data.
73.It Pa actors/
74This subdirectory stores cached 'Person' ActivityPub messages as JSON files. Each
75file name is an MD5 hash of the actor URL.
76.It Pa timeline/
77This subdirectory stores the user's timeline. Everytime a valid message arrives,
78it's stored in this directory as a JSON object. The file name spec is: a Unix
79timestamp followed by a hyphen followed by an MD5 of the message Id. Additionally,
80metadata for each message parent and children is stored under the '_snac' field;
81parent messages with new children are renamed with an updated timestamp so that
82the more recently updated thread is shown at the top. This directory is presented
83in the web interface in reverse file name order up to a maximum, hardcoded limit.
84These files are purged when they are considered old (this time can be changed by
85tweaking the server configuration).
86.It Pa local/
87This subdirectory stores all activities generated by this user as hardlinks to
88their analogue entries in the
89.Pa timeline/
90subdirectory. These files are never deleted.
91.It Pa followers/
92This subdirectory stores the 'Follow' ActivityPub message from each
93Fediverse user that is following this user as a JSON file. Each file name is
94an MD5 hash of the actor that is a follower of this user.
95.It Pa following/
96This subdirectory stores the 'Follow' (not yet confirmed) or the 'Accept'
97(confirmed) ActivityPub message for each actor that is being followed. Each file
98name is an MD5 hash of the actor.
99.It Pa muted/
100This directory contains files which names are MD5 hashes of muted actors. The
101content is a line containing the actor URL.
102Messages from these actors will be ignored on input and not shown in any timeline.
103.It Pa queue/
104This directory contains the output queue of messages generated by the user as
105JSON files. File names contain timestamps that indicate when the message will
106be sent. Messages not accepted by their respective servers will be re-enqueued
107for later retransmission until a maximum number of retries is reached,
108then discarded.
109.It Pa static/
110Files in this directory are served as-is when requested from the
111.Pa https://HOST/s/...
112URL path. A special file named
113.Pa style.css
114can contain user-specific CSS code to be inserted into the HTML of the
115web interface.
116.It Pa history/
117This directory contains generated HTML files. They may be snapshots of the
118local timeline in previous months or other cached data.
119.It Pa archive/
120This directory stores all input/output traffic of ActivityPub messages. There
121is a different file for each day. This information is only stored if
122.Nm
123is run with a debug level >= 1.
124.El
125.Sh SEE ALSO
126.Xr snac 1 ,
127.Xr snac 8
128.Sh AUTHORS
129.An grunfink
130.Sh LICENSE
131See the LICENSE file for details.