snac.5 4.4 KB

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