SNAC(1)

πŸ’… SNAC(1) β€” General Commands Manual πŸ’…

okay bestie, welcome to the snac user manual πŸ’– This is where you land when you already have a running snac installation, so we're not doing setup from scratch. For the admin manual, see snac(8). For file and data formats, see snac(5). periodt.

✨ NAME ✨

snac β€” A simple, minimalistic ActivityPub instance

πŸ¦‹ SYNOPSIS πŸ¦‹

snac command basedir [option ...]

🌈 DESCRIPTION 🌈

The snac daemon processes messages from other servers in the Fediverse using the ActivityPub protocol. it's giving main character energy πŸ’…

This is the user manual and expects an already running snac installation. For the administration manual, see snac(8). For file and data formats, see snac(5).

πŸŽ€ Web Interface πŸŽ€

The web interface provided by snac is split in three data streams: the public timeline, the private timeline and the instance timeline. There are no other feeds like the federated firehoses provided by other similar ActivityPub implementations like Mastodon or Pleroma. fr fr.

The public timeline, also called the local timeline, is what an external visitor sees about the activity of a snac user: that is, only the list of public notes, boosts and likes the user generates or participates into. This is, obviously, read-only, and not very remarkable, unless the user publishes messages of staggering genius. πŸ’€ A set of history links, grouped by month, will also be available at the bottom of the page.

The private timeline, or simply the timeline, is the private, password-protected area of a snac server where the user really interacts with the rest of the Fediverse. it's giving secret garden energy πŸ”

The top area of the timeline provides a big text area to write notes for the public (i.e. for the user followers). As this is the second most important activity on the Fediverse, this is located in the most prominent area of the user page. You can enter plain text, @user@host mentions and other things. See the snac(5) manual for more information on the allowed markup.

Other fields immediately below the big text one allow some control about the post to be sent:

  • Sensitive content β€” tick this checkbox and your post gets marked with a content warning. The optional text box right after it lets you write a description about why your content is so sensitive.
  • Visibility β€” these radio buttons set the scope of the new post. Pick from Public, Unlisted, Followers-only and Direct Message (this one only goes to accounts mentioned in the post body).
  • Reply to (URL) β€” drop the URL of someone else's post in this optional text field, and your text becomes a reply to it instead of a standalone post.
  • Draft β€” tick this checkbox and your text won't be sent when you hit the Post button. It gets stored for later editing in the "Drafts" section.
  • Language β€” a dropdown to pick the language your post is written in. It only shows up after you configure the set of languages you expect to use in the User Settings (see below).
  • Scheduled post... β€” this dropdown lets you set a date and time for when the post goes out.
  • Attachments... β€” this dropdown lets you upload media attachments (images, audio, video, etc.) to your post.
  • Poll... β€” this dropdown gives you the voting options and turns your post into a poll. You can set the options to be voted, whether it's a multiple choice poll, and the due date.

More options are tucked under dropdown menus. Here they are:

  • Follow (by URL or user@host) β€” put a user 'actor' URL or a user@host Fediverse identifier in the input area to follow them.
  • Boost (by URL) β€” put the URL of a Fediverse note in the input area to boost it.
  • Like (by URL) β€” put the URL of a Fediverse note in the input area to like it.
  • User setup... β€” opens the user setup dialog.
  • Followed hashtags... β€” list the hashtags you want to follow here, one per line, with or without the # symbol. Since version 2.78, URLs to RSS feeds of ActivityPub objects are also allowed (like e.g. https://mastodon.social/tags/bloomscrolling).
  • Blocked hashtags... β€” list the hashtags you want to block here, one per line, with or without the # symbol.
  • Muted words... β€” list words to be silenced here. If a post includes any of this words, it's hidden behind a dropdown.

The user setup dialog allows some user information to be changed, specifically:

  • User name β€” your user name, or not really that. People like to include emojis, flags and strange symbols for some reason.
  • Avatar URL β€” the URL of a picture to be used as your avatar in timelines around the world.
  • Bio β€” enter here a bunch of self-indulgent blurb about yourself. The same markup options available for text notes apply here.
  • Always show sensitive content β€” by default, snac hides content marked as sensitive by their publishers. Tick this option and sensitive content is always shown.
  • Email address for notifications β€” if this field is not empty, an email message will be sent to this address whenever a post written by you is liked, boosted or replied to.
  • Telegram notifications β€” to enable notifications via Telegram, fill the two provided fields (Bot API key and Chat id). You need to create both a Telegram channel and a bot for this; the process is rather cumbersome but it's documented everywhere. The Bot API key is a long string of alphanumeric characters and the chat id is a big, negative number.
  • ntfy notifications β€” to enable notifications via ntfy (both self-hosted or standard ntfy.sh server), fill the two provided fields (ntfy server/topic and, if protected, the token). You need to refer to the https://ntfy.sh web site for more information on this process.
  • Notify webhook β€” if this is set to an URL, an HTTP POST will be sent to it whenever a new notification happens (see the 'Webhook for notifications' section below for more information).
  • Maximum days to keep posts β€” this numeric value specifies the number of days to pass before posts (yours and others') will be purged. This value overrides what the administrator defined in the global server settings only if it's lesser (i.e. you cannot keep posts for longer than what the admin desires). A value of 0 (the default) means that the global server settings will apply to the posts in your timeline. Also, if the administrator has configured it, purged local posts generate a Delete activity that is sent everywhere.
  • Drop direct messages from people you don't follow β€” just what it says in the tin. This is to mitigate spammers coming from Fediverse instances with lax / open registration processes. Please take note that this also avoids possibly legitimate people trying to contact you.
  • This account is a bot β€” set this checkbox if this account behaves like a bot (i.e. posts are automatically generated).
  • Auto-boost all mentions to this account β€” if this toggle is on, all mentions to this account are boosted to all followers. This can be used to create groups.
  • This account is private β€” if this toggle is on, posts are not published via the public web interface, only via the ActivityPub protocol.
  • Collapse top threads by default β€” if this toggle is on, the private timeline will always show conversations collapsed by default. This allows easier navigation through long threads.
  • Follow requests must be approved β€” if this toggle is on, follow requests are not automatically accepted, but notified and stored for later review. Pending follow requests will be shown in the people page to be approved or discarded.
  • Publish follower and following metrics β€” if this toggle is on, the number of followers and following accounts are made public (this is only the number; the specific lists of accounts are never published).
  • Show unlisted posts in the public page and RSS feed β€” if this toggle is on, posts with a scope set as 'unlisted' are shown both in the public page and the RSS feed. Please take note that, previous to version 2.92, these posts were always shown in these channels.
  • Web interface language β€” if the administrator has installed any language file, it can be selected here.
  • Time zone β€” the time zone the user is on (default: UTC). Only used for scheduled posts.
  • Languages you usually post in β€” fill this string with the ISO 639 Language Codes you expect to write your posts in, space-separated (example: en fr pt_BR).
  • Don't show posts written in these languages β€” a space-separated string of ISO 639 Language Codes (example: en fr de).
  • Password β€” write the same string in these two fields to change your password. Don't write anything if you don't want to do this.

The rest of the page contains your timeline in reverse chronological order (i.e., newest interactions first). snac shows the conversations as nested trees, unlike other Fediverse software; every time you contribute something to a conversation, the full thread is bumped up, so new interactions are shown always at the top of the page while the forgotten ones languish at the bottom. iconic behavior, honestly 🌈✨

okay so private notes β€” a.k.a. direct messages, the only socially acceptable way to slide into someone's inbox πŸ’Œ β€” they show up in the timeline like any other normal message, except they get a cute lil lock πŸ”’ on them so everyone knows they're not public. And replies to direct messages are private too, obviously, and they can't be liked or boosted. Sorry bestie, that's just the rules.

For every single entry in the timeline, snac serves you a lil lineup of reasonable actions in the form of buttons, and honestly, taste. They can be:

  • Reply... β€” unveils a text area so you can write your very intelligent, very acute comment at some uninformed fellow. This note gets sent to the original author and to your followers. You can drop mentions in the @user@format inside it, and those people become recipients of the message too. Also important, iykyk: if you reply to a boost or a like, you're really replying to the note, not to the person who admired it. πŸ’…
  • Emoji react... β€” unveils a text area where you react with an emoji by typing its identifier, which has to match one of the emojis defined in the emojis.json file. For now, only emoji identifiers wrapped in colons work, periodt.
  • Like β€” click this if you admire this post. The poster and your followers both get informed. 🫢
  • Boost β€” click this if you wanna propagate this post to all your followers. The original author gets informed as well. Main character distribution energy.
  • Bookmark β€” click this to bookmark a post. A lil keep-forever pile, we love it.
  • Follow β€” click here if you want to start receiving all the shenanigans the original author of the post will write in the future. 😭
  • Unfollow β€” click here if you are fed up of this fellow's activities πŸ’€
  • Delete β€” click here to send this post to the bin. If it's an activity written by you, the appropriate message gets sent to the rest of the involved parts telling them you no longer want your thing on their servers (ngl, not all implementations really obey this kind of requirement though πŸ™ˆ).
  • MUTE β€” this is the most important button in snac and in the Fediverse in general, no cap. Click it if you don't want to read crap from this user again in the foreseeable future. 🚫
  • Hide β€” if a conversation is getting long and annoying but not enough to MUTE its author forever, click this button to avoid seeing the post and its children anymore. Bestie boundaries ✨
  • Edit β€” posts written by you on snac version 2.19 and later can be edited and resent to their recipients. Glow-up your own post, iconic.

πŸ› οΈ Command-line options πŸ’»

The command-line tool provides the following commands:

  • init [basedir] β€” initializes the data storage. This one's interactive; it'll prompt you for all the necessary information. Heads up: the basedir directory must not exist yet.
  • upgrade basedir β€” upgrades the data storage after you install a new version. Only necessary if snac complains and demands it (and it will, dramatically).
  • httpd basedir β€” starts the daemon. go server go ✨
  • purge basedir β€” purges old data from the timeline of all users. spring cleaning energy 🧹
  • adduser basedir [uid] β€” adds a new user to the server. Interactive; it'll prompt for everything it needs.
  • deluser basedir uid β€” deletes a user, unfollowing all of their accounts first.
  • resetpwd basedir uid β€” resets a user's password to a new, random one.
  • update basedir uid β€” sends a user's updated profile out to the following instances.
  • queue basedir uid β€” processes the output queue of the specified user, sending all enqueued messages and re-enqueuing the ones that failed.
Do not run this one while the server is running. fr fr, don't.
  • follow basedir uid actor β€” sends a Follow message for the specified actor URL.
  • request basedir uid url β€” requests an object and dumps it to stdout. This is a very low level command that is not very useful to you. 😭
  • announce basedir uid url β€” announces (boosts) a post via its URL.
  • note basedir uid text [file file ... [-r inReplyTo [-d YYYYmmddHHMMSS]]] β€” enqueues a Create + Note message to all followers. If the text argument is -e, the external editor defined by the EDITOR environment variable gets invoked to prepare a message; if it's - (a lonely hyphen), the post content is read from stdin. The rest of the command line arguments are treated as media files to be attached to the post. The LANG environment variable (if defined) is used as the post language. You can also pass an optional URL to a Fediverse post, prefixed with -r, to make this note a reply to it. And if a date in YYYYmmddHHMMSS format follows -d, the note is scheduled for that moment instead of posted immediately (and that date must be in the same timezone the user has configured in the web UI).
  • note_unlisted basedir uid text [file file ... [-r inReplyTo [-d YYYYmmddHHMMSS]]] β€” like the previous one, but it creates an "unlisted" (or "quiet public") post. 🀫
  • note_mention basedir uid text [file file ... [-r inReplyTo [-d YYYYmmddHHMMSS]]] β€” like the previous one, but the post is only for the accounts mentioned in the post body.
  • block basedir instance_url β€” blocks a full instance, given its URL or domain name. All subsequent incoming activities with identifiers from that instance get immediately blocked, without further inspection. 🚷
  • unblock basedir instance_url β€” unblocks a previously blocked instance. forgiveness era πŸ•ŠοΈ
  • verify_links basedir uid β€” verifies all links or account handles stored as metadata for the given user. The verification is done by downloading the link content and searching for a link back to the snac user url that also contains a rel="me" attribute. These links get specially marked as verified in the user's public timeline and also via the Mastodon API. certified βœ…
  • export_csv basedir uid β€” exports some account data as Mastodon-compatible CSV files. Once this command runs, the following files get written to the export/ subdirectory inside the user directory: bookmarks.csv, blocked_accounts.csv, lists.csv, and following_accounts.csv.
  • export_posts basedir uid β€” exports all posts written by the user to the file outbox.json inside the export/ subdirectory inside the user directory. The format is compatible with the one generated by the equivalent option in Mastodon.
  • alias basedir uid @account@remotehost β€” sets an account as an alias of this one. This is a necessary step to migrate an account to a remote Mastodon instance (see snac(8), section 'Migrating from snac to Mastodon').
  • migrate basedir uid β€” starts a migration from this account to the one set as an alias (see snac(8), section 'Migrating from snac to Mastodon'). bye bestie, safe travels πŸ¦‹
  • import_csv basedir uid β€” imports CSV data files from a Mastodon export. This command expects the following files to be inside the import/ subdirectory of a user's directory inside the server base directory: bookmarks.csv, blocked_accounts.csv, lists.csv, and following_accounts.csv.
  • state basedir β€” dumps the current state of the server and its threads. For example:
server: comam.es (snac/2.45-dev)
uptime: 0:03:09:52
job fifo size (cur): 45
job fifo size (peak): 1532
thread #0 state: input
thread #1 state: input
thread #2 state: waiting
thread #3 state: waiting
thread #4 state: output
thread #5 state: output
thread #6 state: output
thread #7 state: waiting

The job fifo size values show the current and peak sizes of the in-memory job queue. The thread state can be: waiting (idle waiting for a job to be assigned), input or output (processing I/O packets) or stopped (not running, only to be seen while starting or stopping the server).

  • import_list basedir uid file β€” imports a Mastodon list in CSV format. The file must be stored inside the import/ subdirectory of a user's directory inside the server base directory. You can use this option to import "Mastodon Follow Packs". πŸ‘‘
  • import_block_list basedir uid file β€” imports a Mastodon list of accounts to be blocked, in CSV format. The file must be stored inside the import/ subdirectory of a user's directory inside the server base directory.
  • lists basedir uid β€” prints the name of the user created lists.
  • list_members basedir uid name β€” prints the list of actors in the named list.
  • list_create basedir uid name β€” creates a new list. ✨
  • list_remove basedir uid name β€” removes an existing list.
  • list_add basedir uid name account β€” adds an account (by its @name@host handle or actor URL) to a list.
  • list_del basedir uid name actor_url β€” deletes an actor (by its actor URL) from a list.
  • top_ten basedir uid [N] β€” returns the ids of the top ten (or top N) most popular posts, considering the sum of likes and boosts. πŸ†

🌈 Migrating an account to/from Mastodon πŸ”

See snac(8) for details. That's the whole vibe β€” the migration lore lives over in section 8, bestie.

πŸ’… Using Mastodon-compatible apps

Since version 2.27, snac ships with support for the Mastodon API, so bestie… you can literally use Mastodon-compatible mobile and desktop apps to access your account. πŸŽ€ Assuming your server is configured correctly, using these programs should be a totally straightforward, no-drama situation.

Heads up though: they'll show your timeline in a "Mastodon fashion" (i.e., as a plain list of posts), so you lose the fancy, nested thread post display with the most active threads at the top that the web interface of snac gives you. RIP to the pretty threads, but it's fine, we move. 😭

πŸ€– Implementing post bots

snac makes it so easy to post messages in a non-interactive manner. Obsessed. This example posts a string:

uptime | snac note $SNAC_BASEDIR $SNAC_USER -

You can set up a line like this from a crontab(5) or similar. Take note that you need:

  • a) command-line access to the same machine that hosts the snac instance, and
  • b) write permissions to the storage directories and files.

You can also post non-interactively using the Mastodon API and a command-line http tool like curl(1) or similar. This one has the advantage that you can do it remotely from any host, anywhere β€” the only thing you need is an API Token. Here's an example:

curl -X POST https://$SNAC_HOST/api/v1/statuses \
--header "Authorization: Bearer ${TOKEN}" -d "status=$(uptime)"

You can obtain an API Token by connecting to the following URL:

https://$SNAC_HOST/oauth/x-snac-get-token

πŸ”” Webhook for notifications

Since version 2.78, users can set the URL to a webhook that will receive an HTTP POST with every notification (in JSON format). iconic behavior ✨ This can be used to implement some automation whenever a new activity happens, like autorepliers, chatbots, interactive textual games or whatever. The examples/ subdirectory contains a tiny Python program that implements an auto-follower for every new follow. 🫢

The JSON notification object includes the following data:

  • id β€” a unique notification identifier
  • actor β€” the origin actor id
  • target β€” the target actor id
  • date β€” the notification date
  • msg β€” the full ActivityPub action JSON object
  • objid β€” the object identifier (extracted from msg, may be null)
  • type β€” the action type (extracted from msg)
  • utype β€” the action subtype (extracted from msg, may be null)
  • uid β€” the user identifier (account name)
  • basedir β€” the server base directory
  • baseurl β€” the server base URL
  • account β€” the origin actor object
  • reply β€” the activity this post is a reply to (may not exist)

🌈 ENVIRONMENT

  • SNAC_BASEDIR β€” This optional environment variable can be set to the base directory of your installation; if set, you don't have to add the base directory as an argument to command-line operations. This may prove useful if you only have one snac instance in your system (which is probably your case, bestie πŸ’–).
  • DEBUG β€” Overrides the debugging level from the server dbglevel configuration variable. Set it to an integer value. The higher, the deeper in meaningless verbiage you'll find yourself into. πŸ’€
  • EDITOR β€” The user-preferred interactive text editor to prepare notes. πŸ“
  • LANG β€” The language of the post when sending notes from the command line.

πŸ‘€ SEE ALSO

snac(5), snac(8)


πŸ‘‘ AUTHORS

grunfink @grunfink@comam.es: https://comam.es/snac/grunfink


πŸ“œ LICENSE

See the LICENSE file for details.


🫣 CAVEATS

Use the Fediverse sparingly. Don't fear the MUTE button. πŸ”‡ (no cap, muting is self-care)


πŸ’€ BUGS

Probably many. 😭 Some issues may be even documented in the TODO.md file.


okay that's the whole page babes, you're officially a snac scholar now πŸŽ“βœ¨ This one comes from the Debian folks, with the $Mdocdate$ date stamp and the SNAC(1) section tag down at the bottom β€” go forth and post responsibly, mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from