snac.5 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. (Note: from version 2.51, these symbols are configurable by the
  49. instance administrator, so the available ones may differ).
  50. .Pp
  51. The following traditional ASCII emoticons or special strings are
  52. converted to related emojis:
  53. .Bd -literal
  54. :-) :-D X-D ;-) B-) :-( :-* <3 :-/ 8-o
  55. %-) :_( :-| >:-( :facepalm: :shrug: :shrug2:
  56. :eyeroll: :beer: :beers: :munch: :thumb:
  57. .Ed
  58. .El
  59. .Pp
  60. .Ss Accepted HTML
  61. All HTML tags in entries are neutered except the following ones:
  62. .Bd -literal
  63. a p br blockquote ul ol li cite small
  64. span i b u s pre code em strong hr img del
  65. .Ed
  66. .Pp
  67. .Ss Disk Layout
  68. This section documents version 2.7 of the disk storage layout.
  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 object/
  77. Directory holding the ActivityPub objects. Filenames are hashes of each
  78. message Id, stored in subdirectories starting with the first two letters
  79. of the hash.
  80. .It Pa queue/
  81. This directory contains the global queue of input/output messages as JSON files.
  82. File names contain timestamps that indicate when the message will
  83. be sent. Messages not accepted by their respective servers will be re-enqueued
  84. for later retransmission until a maximum number of retries is reached,
  85. then discarded.
  86. .It Pa inbox/
  87. Directory storing collected inbox URLs from other instances.
  88. .It Pa archive/
  89. If this directory exists, all input and output messages are logged inside it,
  90. including HTTP headers. Only useful for debugging. May grow to enormous sizes.
  91. .It Pa error/
  92. If this directory exists, HTTP signature check error headers are logged here.
  93. Only useful for debugging.
  94. .It Pa log/
  95. If this directory exists, log messages are also stored there in daily files.
  96. .It Pa app/
  97. This directory stores Mastodon API apps.
  98. .It Pa token/
  99. This directory stores Mastodon API tokens.
  100. .It Pa style.css
  101. The server-wide CSS. The content of this file is inserted into the HTML output
  102. unless a user-specific one exist in the user's
  103. .Pa static/
  104. folder.
  105. .It Pa greeting.html
  106. This file is served when the server base URL is requested from a web browser. See
  107. .Xr snac 8
  108. for more information about the customization options.
  109. .It Pa public.idx
  110. This file contains the list of public posts from all users in the server.
  111. .It Pa filter_reject.txt
  112. This (optional) file contains a list of regular expressions, one per line, to be
  113. applied to the content of all incoming posts; if any of them match, the post is
  114. rejected. This brings the flexibility and destruction power of regular expressions
  115. to your Fediverse experience. To be used wisely (see
  116. .Xr snac 8
  117. for more information).
  118. .El
  119. .Pp
  120. Each user directory is a subdirectory of
  121. .Pa BASEDIR/user/ ,
  122. has the user id as name and contains the following subdirectories and files:
  123. .Bl -tag -width tenletters
  124. .It Pa user.json
  125. User configuration file.
  126. .It Pa user_o.json
  127. User configuration override file. This file is intended for administrators to
  128. override some user preferences. For current version, the fields that can be
  129. overridden are 'purge_days' and 'email'.
  130. .It Pa key.json
  131. Secret/public key PEM data.
  132. .It Pa followers.idx
  133. This file contains the list of followers as a list of hashed object identifiers.
  134. .It Pa followers/
  135. This directory stores hard links to the actor objects in the object storage.
  136. .It Pa following/
  137. This directory stores the users being followed as hard links to the 'Follow'
  138. or 'Accept' objects in the object storage. File names are the hashes of each
  139. actor Id.
  140. .It Pa private.idx
  141. This file contains the list of timeline entries as a list of hashed
  142. object identifiers.
  143. .It Pa private/
  144. This directory stores hard links to the timeline entries in the object storage.
  145. .It Pa public.idx
  146. This file contains the list of public timeline entries as a list of hashed
  147. object identifiers.
  148. .It Pa public/
  149. This directory stores hard links to the public timeline entries in the object
  150. storage.
  151. .It Pa muted/
  152. This directory contains files which names are hashes of muted actors. The
  153. content is a line containing the actor URL.
  154. Messages from these actors will be ignored on input and not shown in any timeline.
  155. .It Pa hidden/
  156. This directory contains references to the hidden timeline entries.
  157. .It Pa limited/
  158. This directory contains references to the actor URLs for limited users (those
  159. being followed but with their boosts blocked).
  160. .It Pa queue/
  161. This directory contains the output queue of messages generated by the user as
  162. JSON files. File names contain timestamps that indicate when the message will
  163. be sent. Messages not accepted by their respective servers will be re-enqueued
  164. for later retransmission until a maximum number of retries is reached,
  165. then discarded.
  166. .It Pa static/
  167. Files in this directory are served as-is when requested from the
  168. .Pa https://HOST/USER/s/...
  169. URL path. A special file named
  170. .Pa style.css
  171. can contain user-specific CSS code to be inserted into the HTML of the
  172. web interface.
  173. .It Pa history/
  174. This directory contains generated HTML files. They may be snapshots of the
  175. local timeline in previous months or other cached data.
  176. .El
  177. .Sh SEE ALSO
  178. .Xr snac 1 ,
  179. .Xr snac 8
  180. .Sh AUTHORS
  181. .An grunfink Lk https://comam.es/snac/grunfink @grunfink@comam.es
  182. .Sh LICENSE
  183. See the LICENSE file for details.