snac.5 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 / Silly Symbols
  48. The following traditional ASCII emoticons or special strings are
  49. converted to related emojis:
  50. .Bd -literal
  51. :-) :-D X-D ;-) B-) :-( :-* <3 :-/ 8-o
  52. %-) :_( :-| :facepalm: :shrug: :eyeroll:
  53. :beer: :beers: :munch: :thumb:
  54. .Ed
  55. .El
  56. .Pp
  57. HTML tags are not filtered on input.
  58. .Pp
  59. .Ss Accepted HTML
  60. All HTML tags in entries are neutered except the following ones:
  61. .Bd -literal
  62. a p br blockquote ul li
  63. span i b pre code em strong
  64. .Ed
  65. .Pp
  66. .Ss Disk Layout
  67. This section documents version 1 of the disk storage layout. It's still
  68. subject to change.
  69. .Pp
  70. The base directory contains the following files and folders:
  71. .Bl -tag -width tenletters
  72. .It Pa server.json
  73. Server configuration.
  74. .It Pa user/
  75. Directory holding user subdirectories.
  76. .It Pa archive/
  77. If this directory exists, all input and output messages are logged inside it,
  78. including HTTP headers. Only useful for debugging. May grow to enormous sizes.
  79. .El
  80. .Pp
  81. Each user directory is a subdirectory of
  82. .Pa BASEDIR/user/ ,
  83. has the user id as name and contains the following subdirectories and files:
  84. .Bl -tag -width tenletters
  85. .It Pa user.json
  86. User configuration file.
  87. .It Pa key.json
  88. SHA-1 secret/public key PEM data.
  89. .It Pa actors/
  90. This subdirectory stores cached 'Person' ActivityPub messages as JSON files. Each
  91. file name is an MD5 hash of the actor URL.
  92. .It Pa timeline/
  93. This subdirectory stores the user's timeline. Everytime a valid message arrives,
  94. it's stored in this directory as a JSON object. The file name spec is: a Unix
  95. timestamp followed by a hyphen followed by an MD5 of the message Id. Additionally,
  96. metadata for each message parent and children is stored under the '_snac' field;
  97. parent messages with new children are renamed with an updated timestamp so that
  98. the more recently updated thread is shown at the top. This directory is presented
  99. in the web interface in reverse file name order up to a maximum, hardcoded limit.
  100. These files are purged when they are considered old (this time can be changed by
  101. tweaking the server configuration).
  102. .It Pa local/
  103. This subdirectory stores all activities generated by this user as hardlinks to
  104. their analogue entries in the
  105. .Pa timeline/
  106. subdirectory.
  107. .It Pa followers/
  108. This subdirectory stores the 'Follow' ActivityPub message from each
  109. Fediverse user that is following this user as a JSON file. Each file name is
  110. an MD5 hash of the actor that is a follower of this user.
  111. .It Pa following/
  112. This subdirectory stores the 'Follow' (not yet confirmed) or the 'Accept'
  113. (confirmed) ActivityPub message for each actor that is being followed. Each file
  114. name is an MD5 hash of the actor.
  115. .It Pa muted/
  116. This directory contains files which names are MD5 hashes of muted actors. The
  117. content is a line containing the actor URL.
  118. Messages from these actors will be ignored on input and not shown in any timeline.
  119. .It Pa queue/
  120. This directory contains the output queue of messages generated by the user as
  121. JSON files. File names contain timestamps that indicate when the message will
  122. be sent. Messages not accepted by their respective servers will be re-enqueued
  123. for later retransmission until a maximum number of retries is reached,
  124. then discarded.
  125. .It Pa static/
  126. Files in this directory are served as-is when requested from the
  127. .Pa https://HOST/s/...
  128. URL path. A special file named
  129. .Pa style.css
  130. can contain user-specific CSS code to be inserted into the HTML of the
  131. web interface.
  132. .It Pa history/
  133. This directory contains generated HTML files. They may be snapshots of the
  134. local timeline in previous months or other cached data.
  135. .It Pa archive/
  136. This directory is no longer used in version 2.x and later. It can be deleted.
  137. .Nm
  138. is run with a debug level >= 1.
  139. .El
  140. .Sh SEE ALSO
  141. .Xr snac 1 ,
  142. .Xr snac 8
  143. .Sh AUTHORS
  144. .An grunfink @grunfink@comam.es
  145. .Sh LICENSE
  146. See the LICENSE file for details.