snac.1 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. .Dd $Mdocdate$
  2. .Dt SNAC 1
  3. .Os
  4. .Sh NAME
  5. .Nm snac
  6. .Nd A simple, minimalistic ActivityPub instance
  7. .Sh SYNOPSIS
  8. .Nm
  9. .Cm command
  10. .Ar basedir
  11. .Op Ar option ...
  12. .Sh DESCRIPTION
  13. The
  14. .Nm
  15. daemon processes messages from other servers in the Fediverse
  16. using the ActivityPub protocol.
  17. .Pp
  18. This is the user manual and expects an already running
  19. .Nm
  20. installation. For the administration manual, see
  21. .Xr snac 8 .
  22. For file and data formats, see
  23. .Xr snac 5 .
  24. .Ss Web Interface
  25. The web interface provided by
  26. .Nm
  27. is split in two data streams: the public timeline and the
  28. private timeline. There are no other feeds like the server-scoped
  29. or the federated firehoses provided by other similar ActivityPub
  30. implementations like Mastodon or Pleroma.
  31. .Pp
  32. The public timeline, also called the local timeline, is what an
  33. external visitor sees about the activity of a
  34. .Nm
  35. user: that is, only the list of public notes, boosts and likes
  36. the user generates or participates into. This is, obviously,
  37. read-only, and not very remarkable, unless the user publishes
  38. messages of staggering genious. A set of history links, grouped
  39. by month, will also be available at the bottom of the page.
  40. .Pp
  41. The private timeline, or simply the timeline, is the private,
  42. password-protected area of a
  43. .Nm
  44. server where the user really interacts with the rest of the
  45. Fediverse.
  46. .Pp
  47. The top area of the timeline provides a big text area to write
  48. notes for the public (i.e. for the user followers). As this is
  49. the second most important activity on the Fediverse, this is
  50. located in the most prominent area of the user page. You can
  51. enter plain text, @user@host mentions and other things. See the
  52. .Xr snac 5
  53. manual for more information on the allowed markup.
  54. .Pp
  55. More options are hidden under a toggle control. They are the
  56. following:
  57. .Bl -tag -offset indent
  58. .It Follow (by URL or user@host)
  59. Fill the input area with a user 'actor' URL or a user@host
  60. Fediverse identifier to follow.
  61. .It Boost (by URL)
  62. Fill the input area with the URL of a Fediverse note to be
  63. boosted.
  64. .It User setup...
  65. This option opens the user setup dialog.
  66. .El
  67. .Pp
  68. The user setup dialog allows some user information to be
  69. changed, specifically:
  70. .Bl -tag -offset indent
  71. .It User name
  72. Your user name, or not really that. People like to include
  73. emojis, flags and strange symbols for some reason.
  74. .It Avatar URL
  75. The URL of a picture to be used as your avatar in timelines
  76. around the world.
  77. .It Bio
  78. Enter here a bunch of self-indulgent blurb about yourself.
  79. The same markup options available for text notes apply here.
  80. .It Always show sensitive content
  81. By default,
  82. .Nm
  83. hides content marked as sensitive by their publishers.
  84. If you check this option, sensitive content is always shown.
  85. .It Email address for notifications
  86. If this field is not empty, an email message will be sent
  87. to this address whenever a post written by you is liked,
  88. boosted or replied to.
  89. .It Telegram notifications
  90. To enable notifications via Telegram, fill the two provided
  91. fields (Bot API key and Chat id). You need to create both
  92. a Telegram channel and a bot for this; the process is rather
  93. cumbersome but it's documented everywhere. The Bot API key
  94. is a long string of alphanumeric characters and the chat id
  95. is a big, negative number.
  96. .It ntfy notifications
  97. To enable notifications via ntfy (both self-hosted or
  98. standard ntfy.sh server), fill the two provided
  99. fields (ntfy server/topic and, if protected, the token).
  100. You need to refer to the https://ntfy.sh web site for
  101. more information on this process.
  102. .It Maximum days to keep posts
  103. This numeric value specifies the number of days to pass before
  104. posts (yours and others') will be purged. This value overrides
  105. what the administrator defined in the global server settings
  106. only if it's lesser (i.e. you cannot keep posts for longer
  107. than what the admin desires). A value of 0 (the default) means
  108. that the global server settings will apply to the posts in your
  109. timeline.
  110. .It Drop direct messages from people you don't follow
  111. Just what it says in the tin. This is to mitigate spammers
  112. coming from Fediverse instances with lax / open registration
  113. processes. Please take note that this also avoids possibly
  114. legitimate people trying to contact you.
  115. .It Password
  116. Write the same string in these two fields to change your
  117. password. Don't write anything if you don't want to do this.
  118. .El
  119. .Pp
  120. The rest of the page contains your timeline in reverse
  121. chronological order (i.e., newest interactions first).
  122. .Nm
  123. shows the conversations as nested trees, unlike other Fediverse
  124. software; everytime you contribute something to a conversation,
  125. the full thread is bumped up, so new interactions are shown
  126. always at the top of the page while the forgotten ones languish
  127. at the bottom.
  128. .Pp
  129. Private notes (a.k.a. direct messages) are also shown in
  130. the timeline as normal messages, but marked with a cute lock
  131. to mark them as non-public. Replies to direct messages are
  132. also private and cannot be liked nor boosted.
  133. .Pp
  134. For each entry in the timeline, a set of reasonable actions
  135. in the form of buttons will be shown. These can be:
  136. .Bl -tag -offset indent
  137. .It Reply
  138. Unveils a text area to write your intelligent and acute comment
  139. to an uninformed fellow. This note is sent to the original
  140. author as well as to your followers. The note can include
  141. mentions in the @user@format; these people will also become
  142. recipients of the message. If you reply to a boost or like,
  143. you are really replying to the note, not to the admirer of it.
  144. .It Like
  145. Click this if you admire this post. The poster and your
  146. followers will be informed.
  147. .It Boost
  148. Click this if you want to propagate this post to all your
  149. followers. The original author will also be informed.
  150. .It Follow
  151. Click here if you want to start receiving all the shenanigans
  152. the original author of the post will write in the future.
  153. .It Unfollow
  154. Click here if you are fed up of this fellow's activities.
  155. .It Delete
  156. Click here to send this post to the bin. If it's an activity
  157. written by you, the appropriate message is sent to the rest
  158. of involved parts telling them that you no longer want your
  159. thing in their servers (not all implementations really obey
  160. this kind of requirements, though).
  161. .It MUTE
  162. This is the most important button in
  163. .Nm
  164. and the Fediverse in general. Click it if you don't want
  165. to read crap from this user again in the forseeable future.
  166. .It Hide
  167. If a conversation is getting long and annoying but not enough
  168. to MUTE its author forever, click this button to avoid seeing
  169. the post and its children anymore.
  170. .It Edit
  171. Posts written by you on
  172. .Nm
  173. version 2.19 and later can be edited and resent to their
  174. recipients.
  175. .El
  176. .Ss Command-line options
  177. The command-line tool provide the following commands:
  178. .Bl -tag -offset indent
  179. .It Cm init Op basedir
  180. Initializes the data storage. This is an interactive command; necessary
  181. information will be prompted for. The
  182. .Ar basedir
  183. directory must not exist.
  184. .It Cm upgrade Ar basedir
  185. Upgrades the data storage after installing a new version.
  186. Only necessary if
  187. .Nm
  188. complains and demands it.
  189. .It Cm httpd Ar basedir
  190. Starts the daemon.
  191. .It Cm purge Ar basedir
  192. Purges old data from the timeline of all users.
  193. .It Cm adduser Ar basedir Op uid
  194. Adds a new user to the server. This is an interactive command;
  195. necessary information will be prompted for.
  196. .It Cm resetpwd Ar basedir Ar uid
  197. Resets a user's password to a new, random one.
  198. .It Cm queue Ar basedir Ar uid
  199. Processes the output queue of the specied user, sending all
  200. enqueued messages and re-enqueing the failing ones. This command
  201. must not be executed if the server is running.
  202. .It Cm follow Ar basedir Ar uid Ar actor
  203. Sends a Follow message for the specified actor URL.
  204. .It Cm request Ar basedir Ar uid Ar url
  205. Requests an object and dumps it to stdout. This is a very low
  206. level command that is not very useful to you.
  207. .It Cm note Ar basedir Ar uid Ar text
  208. Enqueues a Create + Note message to all followers. If the
  209. .Ar text
  210. argument is -e, the external editor defined by the EDITOR
  211. environment variable will be invoked to prepare a message; if
  212. it's - (a lonely hyphen), the post content will be read from stdin.
  213. .It Cm block Ar basedir Ar instance_url
  214. Blocks a full instance, given its URL or domain name. All subsequent
  215. incoming activities with identifiers from that instance will be immediately
  216. blocked without further inspection.
  217. .It Cm unblock Ar basedir Ar instance_url
  218. Unblocks a previously blocked instance.
  219. .It Cm state Ar basedir
  220. Dumps the current state of the server and its threads. For example:
  221. .Bd -literal -offset indent
  222. server: comam.es (snac/2.45-dev)
  223. uptime: 0:03:09:52
  224. job fifo size (cur): 45
  225. job fifo size (peak): 1532
  226. thread #0 state: input
  227. thread #1 state: input
  228. thread #2 state: waiting
  229. thread #3 state: waiting
  230. thread #4 state: output
  231. thread #5 state: output
  232. thread #6 state: output
  233. thread #7 state: waiting
  234. .Ed
  235. .Pp
  236. The job fifo size values show the current and peak sizes of the
  237. in-memory job queue. The thread state can be: waiting (idle waiting
  238. for a job to be assigned), input or output (processing I/O packets)
  239. or stopped (not running, only to be seen while starting or stopping
  240. the server).
  241. .El
  242. .Ss Migrating an account from Mastodon
  243. See
  244. .Xr snac 8
  245. for details.
  246. .Ss Using Mastodon-compatible apps
  247. Since version 2.27,
  248. .Nm
  249. includes support for the Mastodon API, so you can use Mastodon-compatible
  250. mobile and desktop applications to access your account. Given a correctly
  251. configured server, the usage of these programs should be straightforward.
  252. Please take note that they will show your timeline in a 'Mastodon fashion'
  253. (i.e., as a plain list of posts), so you will lose the fancy, nested thread
  254. post display with the most active threads at the top that the web interface of
  255. .Nm
  256. provides.
  257. .Ss Implementing post bots
  258. .Nm
  259. makes very easy to post messages in a non-interactive manner. This example
  260. posts a string:
  261. .Bd -literal -offset indent
  262. uptime | snac note $SNAC_BASEDIR $SNAC_USER -
  263. .Ed
  264. .Pp
  265. You can setup a line like this from a
  266. .Xr crontab 5
  267. or similar. Take note that you need a) command-line access to the same machine
  268. that hosts the
  269. .Nm
  270. instance, and b) write permissions to the storage directories and files.
  271. .Pp
  272. You can also post non-interactively using the Mastodon API and a command-line
  273. http tool like
  274. .Xr curl 1
  275. or similar. This has the advantage that you can do it remotely from any host,
  276. anywhere; the only thing you need is an API Token. This is an example:
  277. .Bd -literal -offset indent
  278. curl -X POST https://$SNAC_HOST/api/v1/statuses \\
  279. --header "Authorization: Bearer ${TOKEN}" -d "status=$(uptime)"
  280. .Ed
  281. .Pp
  282. You can obtain an API Token by connecting to the following URL:
  283. .Bd -literal -offset indent
  284. https://$SNAC_HOST/oauth/x-snac-get-token
  285. .Ed
  286. .Pp
  287. .Sh ENVIRONMENT
  288. .Bl -tag -width Ds
  289. .It Ev DEBUG
  290. Overrides the debugging level from the server 'dbglevel' configuration
  291. variable. Set it to an integer value. The higher, the deeper in meaningless
  292. verbiage you'll find yourself into.
  293. .It Ev EDITOR
  294. The user-preferred interactive text editor to prepare messages.
  295. .El
  296. .Sh SEE ALSO
  297. .Xr snac 5 ,
  298. .Xr snac 8
  299. .Sh AUTHORS
  300. .An grunfink Lk https://comam.es/snac/grunfink @grunfink@comam.es
  301. .Sh LICENSE
  302. See the LICENSE file for details.
  303. .Sh CAVEATS
  304. Use the Fediverse sparingly. Don't fear the MUTE button.
  305. .Sh BUGS
  306. Probably plenty. Some issues may be even documented in the TODO.md file.