snac.5 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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
  8. The
  9. .Nm
  10. daemon processes messages from other servers in the Fediverse
  11. using the ActivityPub protocol.
  12. .Pp
  13. This manual describes the allowed formatting of note messages
  14. and the disk storage layout of
  15. .Nm
  16. server and user data. For the operation manual, see
  17. .Xr snac 1 .
  18. For the administration manual, see
  19. .Xr snac 8 .
  20. .Ss Message Formatting
  21. Message notes respect the entered new line breaks rigurously.
  22. A 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
  29. Text `between backticks` is formatted as code.
  30. .Bd -literal
  31. ```
  32. /* text between lines with only three backticks is preformatted */
  33. int main(int argc, char *argv[])
  34. {
  35. return 0;
  36. }
  37. ```
  38. .Ed
  39. .It links
  40. Standalone URLs.
  41. .It quoted text
  42. Lines starting with >.
  43. .It User Mentions
  44. Strings in the format @user@host are requested using the Webfinger
  45. protocol and converted to links and mentions if something reasonable
  46. is found.
  47. .It Emoticons / Smileys
  48. The following traditional ASCII emoticons or special strings are
  49. converted to related emojis:
  50. .Bd -literal
  51. :-) :-D X-D ;-) B-) :-( :-*
  52. :-/ 8-o %-) :_( :-| :facepalm: :shrug:
  53. :eyeroll: :beer: :beers: :munch:
  54. .Ed
  55. .El
  56. .Pp
  57. HTML tags are left untouched. This is probably a bad idea that may
  58. change in future versions.
  59. .Pp
  60. .Ss Disk Layout
  61. This section documents version 1 of the disk storage layout. It's still
  62. subject to change.
  63. .Pp
  64. The base directory contains the following files and folders:
  65. .Bl -tag -width tenletters
  66. .It Pa server.json
  67. Server configuration.
  68. .It Pa user/
  69. Directory holding user subdirectories.
  70. .It Pa archive/
  71. If this directory exists, all input and output messages are logged inside it,
  72. including HTTP headers. Only useful for debugging. May grow to enormous sizes.
  73. .El
  74. .Pp
  75. Each user directory is a subdirectory of
  76. .Pa BASEDIR/user/ ,
  77. has the user id as name and contains the following subdirectories and files:
  78. .Bl -tag -width tenletters
  79. .It Pa user.json
  80. User configuration file.
  81. .It Pa key.json
  82. SHA-1 secret/public key PEM data.
  83. .It Pa actors/
  84. This subdirectory stores cached 'Person' ActivityPub messages as JSON files. Each
  85. file name is an MD5 hash of the actor URL.
  86. .It Pa timeline/
  87. This subdirectory stores the user's timeline. Everytime a valid message arrives,
  88. it's stored in this directory as a JSON object. The file name spec is: a Unix
  89. timestamp followed by a hyphen followed by an MD5 of the message Id. Additionally,
  90. metadata for each message parent and children is stored under the '_snac' field;
  91. parent messages with new children are renamed with an updated timestamp so that
  92. the more recently updated thread is shown at the top. This directory is presented
  93. in the web interface in reverse file name order up to a maximum, hardcoded limit.
  94. These files are purged when they are considered old (this time can be changed by
  95. tweaking the server configuration).
  96. .It Pa local/
  97. This subdirectory stores all activities generated by this user as hardlinks to
  98. their analogue entries in the
  99. .Pa timeline/
  100. subdirectory. These files are never deleted.
  101. .It Pa followers/
  102. This subdirectory stores the 'Follow' ActivityPub message from each
  103. Fediverse user that is following this user as a JSON file. Each file name is
  104. an MD5 hash of the actor that is a follower of this user.
  105. .It Pa following/
  106. This subdirectory stores the 'Follow' (not yet confirmed) or the 'Accept'
  107. (confirmed) ActivityPub message for each actor that is being followed. Each file
  108. name is an MD5 hash of the actor.
  109. .It Pa muted/
  110. This directory contains files which names are MD5 hashes of muted actors. The
  111. content is a line containing the actor URL.
  112. Messages from these actors will be ignored on input and not shown in any timeline.
  113. .It Pa queue/
  114. This directory contains the output queue of messages generated by the user as
  115. JSON files. File names contain timestamps that indicate when the message will
  116. be sent. Messages not accepted by their respective servers will be re-enqueued
  117. for later retransmission until a maximum number of retries is reached,
  118. then discarded.
  119. .It Pa static/
  120. Files in this directory are served as-is when requested from the
  121. .Pa https://HOST/s/...
  122. URL path. A special file named
  123. .Pa style.css
  124. can contain user-specific CSS code to be inserted into the HTML of the
  125. web interface.
  126. .It Pa history/
  127. This directory contains generated HTML files. They may be snapshots of the
  128. local timeline in previous months or other cached data.
  129. .It Pa archive/
  130. This directory is no longer used in version 2.x and later. It can be deleted.
  131. .Nm
  132. is run with a debug level >= 1.
  133. .El
  134. .Sh SEE ALSO
  135. .Xr snac 1 ,
  136. .Xr snac 8
  137. .Sh AUTHORS
  138. .An grunfink
  139. .Sh LICENSE
  140. See the LICENSE file for details.