snac.5 7.0 KB

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