snac.5 7.8 KB

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