snac.5 8.6 KB

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