snac.5 8.3 KB

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