snac.5 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. .El
  48. .Pp
  49. HTML tags are left untouched. This is probably a bad idea that may
  50. change in future versions.
  51. .Pp
  52. .Ss Disk Layout
  53. This section documents version 1 of the disk storage layout. It's still
  54. subject to change.
  55. .Pp
  56. The base directory contains the following files and folders:
  57. .Bl -tag -width tenletters
  58. .It Pa server.json
  59. Server configuration.
  60. .It Pa user/
  61. Directory holding user subdirectories.
  62. .It Pa archive/
  63. If this directory exists, all input and output messages are logged inside it,
  64. including HTTP headers. Only useful for debugging. May grow to enormous sizes.
  65. .El
  66. .Pp
  67. Each user directory is a subdirectory of
  68. .Pa BASEDIR/user/ ,
  69. has the user id as name and contains the following subdirectories and files:
  70. .Bl -tag -width tenletters
  71. .It Pa user.json
  72. User configuration file.
  73. .It Pa key.json
  74. SHA-1 secret/public key PEM data.
  75. .It Pa actors/
  76. This subdirectory stores cached 'Person' ActivityPub messages as JSON files. Each
  77. file name is an MD5 hash of the actor URL.
  78. .It Pa timeline/
  79. This subdirectory stores the user's timeline. Everytime a valid message arrives,
  80. it's stored in this directory as a JSON object. The file name spec is: a Unix
  81. timestamp followed by a hyphen followed by an MD5 of the message Id. Additionally,
  82. metadata for each message parent and children is stored under the '_snac' field;
  83. parent messages with new children are renamed with an updated timestamp so that
  84. the more recently updated thread is shown at the top. This directory is presented
  85. in the web interface in reverse file name order up to a maximum, hardcoded limit.
  86. These files are purged when they are considered old (this time can be changed by
  87. tweaking the server configuration).
  88. .It Pa local/
  89. This subdirectory stores all activities generated by this user as hardlinks to
  90. their analogue entries in the
  91. .Pa timeline/
  92. subdirectory. These files are never deleted.
  93. .It Pa followers/
  94. This subdirectory stores the 'Follow' ActivityPub message from each
  95. Fediverse user that is following this user as a JSON file. Each file name is
  96. an MD5 hash of the actor that is a follower of this user.
  97. .It Pa following/
  98. This subdirectory stores the 'Follow' (not yet confirmed) or the 'Accept'
  99. (confirmed) ActivityPub message for each actor that is being followed. Each file
  100. name is an MD5 hash of the actor.
  101. .It Pa muted/
  102. This directory contains files which names are MD5 hashes of muted actors. The
  103. content is a line containing the actor URL.
  104. Messages from these actors will be ignored on input and not shown in any timeline.
  105. .It Pa queue/
  106. This directory contains the output queue of messages generated by the user as
  107. JSON files. File names contain timestamps that indicate when the message will
  108. be sent. Messages not accepted by their respective servers will be re-enqueued
  109. for later retransmission until a maximum number of retries is reached,
  110. then discarded.
  111. .It Pa static/
  112. Files in this directory are served as-is when requested from the
  113. .Pa https://HOST/s/...
  114. URL path. A special file named
  115. .Pa style.css
  116. can contain user-specific CSS code to be inserted into the HTML of the
  117. web interface.
  118. .It Pa history/
  119. This directory contains generated HTML files. They may be snapshots of the
  120. local timeline in previous months or other cached data.
  121. .It Pa archive/
  122. This directory is no longer used in version 2.x and later. It can be deleted.
  123. .Nm
  124. is run with a debug level >= 1.
  125. .El
  126. .Sh SEE ALSO
  127. .Xr snac 1 ,
  128. .Xr snac 8
  129. .Sh AUTHORS
  130. .An grunfink
  131. .Sh LICENSE
  132. See the LICENSE file for details.