Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
SNAC(5) 		       File Formats Manual			 SNAC(5)

NAME
     snac -- message formatting and file format documentation

DESCRIPTION
     The  snac daemon processes messages from other servers in the Fediverse us-
     ing the ActivityPub protocol.

     This manual describes the allowed formatting of note messages and the  disk
     storage  layout of snac server and user data. For the operation manual, see
     snac(1).  For the administration manual, see snac(8).

   Message Formatting
     Message notes respect the entered new line breaks	rigorously.   A  special
     subset of Markdown is allowed, including:

     bold	 **text between two pairs of asterisks**

     italic	 *text between a pair of asterisks*

     strikethrough text
		 ~~text between two pairs of tildes~~

     underlined text
		 __text between two pairs of underscores__

     code	 Text `between backticks` is formatted as code.

		 ```
		 /* text between lines starting with three backticks is preformatted */
		 int main(int argc, char *argv[])
		 {
		     return 0;
		 }

		 ```

     links	 Standalone  URLs  are	converted  to  links. Also, from version
		 2.54, markdown-style links in the form of [link label](url) are
		 also supported.

     attached images
		 Standalone URLs for which the final extension is recognized  as
		 an  image (.jpg, .gif, .png, etc), are converted to ActivityPub
		 image attachments. Also, from version 2.57, markdown-style  im-
		 age  links  in the form of ![alt text](image url) are also sup-
		 ported.

     line separators
		 Horizontal rules can be inserted by typing three minus  symbols
		 alone in a line.

     quoted text
		 Lines starting with > (blockquotes).

     bullet points
		 Lines	starting  with	an asterisk or hyphen, plus a space (un-
		 sorted lists).

     headers	 One, two or three # at the beginning of a  line  plus	a  space
		 plus some text are converted to HTML headers.

     user mentions
		 Strings  in  the  format  @user@host  are  requested  using the
		 Webfinger protocol and converted to links and mentions if some-
		 thing reasonable is found.

     emoticons /emojis / smileys / silly symbols
		 (Note: from version 2.51, these symbols are configurable by the
		 instance administrator, so the available ones may differ).

		 The following traditional ASCII emoticons  or	special  strings
		 are converted to related emojis:

		 :-) :-D X-D ;-) B-) :-( :-* <3 :-/ 8-o
		 %-) :_( :-| >:-( :facepalm: :shrug: :shrug2:
		 :eyeroll: :beer: :beers: :munch: :thumb:

   Accepted HTML
     All HTML tags in entries are neutered except the following ones:

     a p br blockquote ul ol li cite small h2 h3
     span i b u s pre code em strong hr img del

   Disk Layout
     This section documents version 2.7 of the disk storage layout.

     The base directory contains the following files and folders:

     server.json
		 Server configuration.

     user/	 Directory holding user subdirectories.

     object/	 Directory holding the ActivityPub objects. Filenames are hashes
		 of  each message Id, stored in subdirectories starting with the
		 first two letters of the hash.

     queue/	 This directory contains the global queue of  input/output  mes-
		 sages	as JSON files.	File names contain timestamps that indi-
		 cate when the message will be sent. Messages  not  accepted  by
		 their respective servers will be re-enqueued for later retrans-
		 mission until a maximum number of retries is reached, then dis-
		 carded.

     inbox/	 Directory storing collected inbox URLs from other instances.

     archive/	 If  this  directory  exists,  all input and output messages are
		 logged inside it, including HTTP headers. Only useful	for  de-
		 bugging. May grow to enormous sizes.

     error/	 If  this  directory  exists, HTTP signature check error headers
		 are logged here.  Only useful for debugging.

     log/	 If this directory exists, log messages are also stored there in
		 daily files.

     app/	 This directory stores Mastodon API apps.

     token/	 This directory stores Mastodon API tokens.

     style.css	 The server-wide CSS. The content of this file is inserted  into
		 the  HTML output unless a user-specific one exist in the user's
		 static/ folder.

     greeting.html
		 This file is served when the server base URL is requested  from
		 a  web browser. See snac(8) for more information about the cus-
		 tomization options.

     public.idx  This file contains the list of public posts from all  users  in
		 the server.

     filter_reject.txt
		 This  (optional)  file  contains a list of regular expressions,
		 one per line, to be applied to  the  content  of  all	incoming
		 posts;  if any of them match, the post is rejected. This brings
		 the flexibility and destruction power of regular expressions to
		 your Fediverse experience. To be used wisely (see  snac(8)  for
		 more information).

     announcement.txt
		 If  this  file  is  present,  an  announcement will be shown to
		 logged in users on every page with its  contents.  It	is  also
		 available  through the Mastodon API.  Users can dismiss the an-
		 nouncement, which works by storing the modification time in the
		 "last_announcement" field of the user.json file. When the  file
		 is  modified,	the announcement will then reappear. It can con-
		 tain only text and will be ignored if it  has	more  than  2048
		 bytes.

     server.pid  This file stores the server PID in a single text line.

     Each  user directory is a subdirectory of BASEDIR/user/, has the user id as
     name and contains the following subdirectories and files:

     user.json	 User configuration file.

     user_o.json
		 User configuration override file. This file is intended for ad-
		 ministrators to override some	user  preferences.  For  current
		 version, the fields that can be overridden are 'purge_days' and
		 'email'.

     key.json	 Secret/public key PEM data.

     followers.idx
		 This  file  contains  the list of followers as a list of hashed
		 object identifiers.

     followers/  This directory stores hard links to the actor	objects  in  the
		 object storage.

     following/  This directory stores the users being followed as hard links to
		 the  'Follow'	or  'Accept' objects in the object storage. File
		 names are the hashes of each actor Id.

     private/	 This directory stores hard links to the timeline entries in the
		 object storage.

     private.idx
		 This file contains the list of timeline entries as  a	list  of
		 hashed object identifiers.

     public/	 This directory stores hard links to the public timeline entries
		 in the object storage.

     public.idx  This  file  contains  the  list of public timeline entries as a
		 list of hashed object identifiers.

     pinned/	 This directory stores hard links to pinned posts.

     pinned.idx  This file contains the list of pinned posts as a list of hashed
		 object identifiers.

     bookmark/	 This directory stores hard links to bookmarked posts.

     bookmark.idx
		 This file contains the list of pinned posts as a list of hashed
		 object identifiers.

     draft/	 This directory stores post drafts.

     draft.idx	 This file contains the list of drafts as a list of  hashed  ob-
		 ject identifiers.

     muted/	 This  directory  contains files which names are hashes of muted
		 actors. The content is a line containing the actor  URL.   Mes-
		 sages	from these actors will be ignored on input and not shown
		 in any timeline.

     hidden/	 This directory contains references to the hidden  timeline  en-
		 tries.

     limited/	 This  directory  contains references to the actor URLs for lim-
		 ited  users  (those  being  followed  but  with  their   boosts
		 blocked).

     queue/	 This  directory contains the output queue of messages generated
		 by the user as JSON files. File names contain	timestamps  that
		 indicate  when  the message will be sent. Messages not accepted
		 by their respective servers will be re-enqueued for  later  re-
		 transmission until a maximum number of retries is reached, then
		 discarded.

     static/	 Files	in  this  directory are served as-is when requested from
		 the https://HOST/USER/s/... URL  path.  A  special  file  named
		 style.css  can  contain  user-specific  CSS code to be inserted
		 into the HTML of the web interface.

     history/	 This directory contains generated HTML files. They may be snap-
		 shots of the local timeline in previous months or other  cached
		 data.

     export/	 This  directory will contain exported data in Mastodon-compati-
		 ble CSV format after executing  the  'export_csv'  command-line
		 operation.

     import/	 Mastodon-compatible  CSV  files must be copied into this direc-
		 tory to use any of the importing functions.

SEE ALSO
     snac(1), snac(8)

AUTHORS
     grunfink @grunfink@comam.es

LICENSE
     See the LICENSE file for details.

FreeBSD ports 15.quarterly	   $Mdocdate$				 SNAC(5)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=snac&sektion=5&manpath=FreeBSD+Ports+15.1.quarterly>

home | help