snac.5 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 code
  29. Text `between backticks` is formatted as code.
  30. .Bd -literal
  31. ```
  32. /* text between lines with only three backticks is preformatted */
  33. int main(int argc, char *argv[])
  34. {
  35. return 0;
  36. }
  37. ```
  38. .Ed
  39. .It links
  40. Standalone URLs.
  41. .It quoted text
  42. Lines starting with >.
  43. .It User Mentions
  44. Strings in the format @user@host are requested using the Webfinger
  45. protocol and converted to links and mentions if something reasonable
  46. is found.
  47. .It Emoticons / Smileys / Silly Symbols
  48. The following traditional ASCII emoticons or special strings are
  49. converted to related emojis:
  50. .Bd -literal
  51. :-) :-D X-D ;-) B-) :-( :-* <3 :-/ 8-o
  52. %-) :_( :-| >:-( :facepalm: :shrug: :shrug2:
  53. :eyeroll: :beer: :beers: :munch: :thumb:
  54. .Ed
  55. .El
  56. .Pp
  57. .Ss Accepted HTML
  58. All HTML tags in entries are neutered except the following ones:
  59. .Bd -literal
  60. a p br blockquote ul li cite
  61. span i b u pre code em strong
  62. .Ed
  63. .Pp
  64. .Ss Disk Layout
  65. This section documents version 2.7 of the disk storage layout.
  66. .Pp
  67. The base directory contains the following files and folders:
  68. .Bl -tag -width tenletters
  69. .It Pa server.json
  70. Server configuration.
  71. .It Pa user/
  72. Directory holding user subdirectories.
  73. .It Pa object/
  74. Directory holding the ActivityPub objects. Filenames are hashes of each
  75. message Id, stored in subdirectories starting with the first two letters
  76. of the hash.
  77. .It Pa queue/
  78. This directory contains the global queue of input/output messages as JSON files.
  79. File names contain timestamps that indicate when the message will
  80. be sent. Messages not accepted by their respective servers will be re-enqueued
  81. for later retransmission until a maximum number of retries is reached,
  82. then discarded.
  83. .It Pa inbox/
  84. Directory storing collected inbox URLs from other instances.
  85. .It Pa archive/
  86. If this directory exists, all input and output messages are logged inside it,
  87. including HTTP headers. Only useful for debugging. May grow to enormous sizes.
  88. .It Pa error/
  89. If this directory exists, HTTP signature check error headers are logged here.
  90. Only useful for debugging.
  91. .It Pa app/
  92. This directory stores Mastodon API apps.
  93. .It Pa token/
  94. This directory stores Mastodon API tokens.
  95. .El
  96. .Pp
  97. Each user directory is a subdirectory of
  98. .Pa BASEDIR/user/ ,
  99. has the user id as name and contains the following subdirectories and files:
  100. .Bl -tag -width tenletters
  101. .It Pa user.json
  102. User configuration file.
  103. .It Pa user_o.json
  104. User configuration override file. This file is intended for administrators to
  105. override some user preferences. For current version, the fields that can be
  106. overridden are 'purge_days' and 'email'.
  107. .It Pa key.json
  108. Secret/public key PEM data.
  109. .It Pa followers.idx
  110. This file contains the list of followers as a list of hashed object identifiers.
  111. .It Pa followers/
  112. This directory stores hard links to the actor objects in the object storage.
  113. .It Pa following/
  114. This directory stores the users being followed as hard links to the 'Follow'
  115. or 'Accept' objects in the object storage. File names are the hashes of each
  116. actor Id.
  117. .It Pa private.idx
  118. This file contains the list of timeline entries as a list of hashed
  119. object identifiers.
  120. .It Pa private/
  121. This directory stores hard links to the timeline entries in the object storage.
  122. .It Pa public.idx
  123. This file contains the list of public timeline entries as a list of hashed
  124. object identifiers.
  125. .It Pa public/
  126. This directory stores hard links to the public timeline entries in the object
  127. storage.
  128. .It Pa muted/
  129. This directory contains files which names are hashes of muted actors. The
  130. content is a line containing the actor URL.
  131. Messages from these actors will be ignored on input and not shown in any timeline.
  132. .It Pa hidden/
  133. This directory contains references to the hidden timeline entries.
  134. .It Pa queue/
  135. This directory contains the output queue of messages generated by the user as
  136. JSON files. File names contain timestamps that indicate when the message will
  137. be sent. Messages not accepted by their respective servers will be re-enqueued
  138. for later retransmission until a maximum number of retries is reached,
  139. then discarded.
  140. .It Pa static/
  141. Files in this directory are served as-is when requested from the
  142. .Pa https://HOST/USER/s/...
  143. URL path. A special file named
  144. .Pa style.css
  145. can contain user-specific CSS code to be inserted into the HTML of the
  146. web interface.
  147. .It Pa history/
  148. This directory contains generated HTML files. They may be snapshots of the
  149. local timeline in previous months or other cached data.
  150. .El
  151. .Sh SEE ALSO
  152. .Xr snac 1 ,
  153. .Xr snac 8
  154. .Sh AUTHORS
  155. .An grunfink Lk https://comam.es/snac/grunfink @grunfink@comam.es
  156. .Sh LICENSE
  157. See the LICENSE file for details.