snac.5 4.4 KB

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