snac.5 8.5 KB

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