snac.5 6.4 KB

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