snac.5 6.9 KB

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