snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

snac.5 (8456B)


      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 strikethrough text
     29 ~~text between a pair of tildes~~
     30 .It underlined text
     31 __text between two pairs of underscores__
     32 .It code
     33 Text `between backticks` is formatted as code.
     34 .Bd -literal
     35 ```
     36 /* text between lines with only three backticks is preformatted */
     37 int main(int argc, char *argv[])
     38 {
     39     return 0;
     40 }
     41 
     42 ```
     43 .Ed
     44 .It links
     45 Standalone URLs are converted to links. Also, from version 2.54,
     46 markdown-style links in the form of [link label](url) are also
     47 supported.
     48 .It attached images
     49 Standalone URLs for which the final extension is recognized as an
     50 image (.jpg, .gif, .png, etc), are converted to ActivityPub image
     51 attachments. Also, from version 2.57, markdown-style image links
     52 in the form of ![alt text](image url) are also supported.
     53 .It line separators
     54 Horizonal rules can be inserted by typing three minus symbols
     55 alone in a line.
     56 .It quoted text
     57 Lines starting with >.
     58 .It headers
     59 One, two or three # at the beginning of a line plus a space plus
     60 some text are converted to HTML headers.
     61 .It user mentions
     62 Strings in the format @user@host are requested using the Webfinger
     63 protocol and converted to links and mentions if something reasonable
     64 is found.
     65 .It emoticons /emojis / smileys / silly symbols
     66 (Note: from version 2.51, these symbols are configurable by the
     67 instance administrator, so the available ones may differ).
     68 .Pp
     69 The following traditional ASCII emoticons or special strings are
     70 converted to related emojis:
     71 .Bd -literal
     72 :-) :-D X-D ;-) B-) :-( :-* <3 :-/ 8-o
     73 %-) :_( :-| >:-( :facepalm: :shrug: :shrug2:
     74 :eyeroll: :beer: :beers: :munch: :thumb:
     75 .Ed
     76 .El
     77 .Pp
     78 .Ss Accepted HTML
     79 All HTML tags in entries are neutered except the following ones:
     80 .Bd -literal
     81 a p br blockquote ul ol li cite small h2 h3
     82 span i b u s pre code em strong hr img del
     83 .Ed
     84 .Pp
     85 .Ss Disk Layout
     86 This section documents version 2.7 of the disk storage layout.
     87 .Pp
     88 The base directory contains the following files and folders:
     89 .Bl -tag -width tenletters
     90 .It Pa server.json
     91 Server configuration.
     92 .It Pa user/
     93 Directory holding user subdirectories.
     94 .It Pa object/
     95 Directory holding the ActivityPub objects. Filenames are hashes of each
     96 message Id, stored in subdirectories starting with the first two letters
     97 of the hash.
     98 .It Pa queue/
     99 This directory contains the global queue of input/output messages as JSON files.
    100 File names contain timestamps that indicate when the message will
    101 be sent. Messages not accepted by their respective servers will be re-enqueued
    102 for later retransmission until a maximum number of retries is reached,
    103 then discarded.
    104 .It Pa inbox/
    105 Directory storing collected inbox URLs from other instances.
    106 .It Pa archive/
    107 If this directory exists, all input and output messages are logged inside it,
    108 including HTTP headers. Only useful for debugging. May grow to enormous sizes.
    109 .It Pa error/
    110 If this directory exists, HTTP signature check error headers are logged here.
    111 Only useful for debugging.
    112 .It Pa log/
    113 If this directory exists, log messages are also stored there in daily files.
    114 .It Pa app/
    115 This directory stores Mastodon API apps.
    116 .It Pa token/
    117 This directory stores Mastodon API tokens.
    118 .It Pa style.css
    119 The server-wide CSS. The content of this file is inserted into the HTML output
    120 unless a user-specific one exist in the user's
    121 .Pa static/
    122 folder.
    123 .It Pa greeting.html
    124 This file is served when the server base URL is requested from a web browser. See
    125 .Xr snac 8
    126 for more information about the customization options.
    127 .It Pa public.idx
    128 This file contains the list of public posts from all users in the server.
    129 .It Pa filter_reject.txt
    130 This (optional) file contains a list of regular expressions, one per line, to be
    131 applied to the content of all incoming posts; if any of them match, the post is
    132 rejected. This brings the flexibility and destruction power of regular expressions
    133 to your Fediverse experience. To be used wisely (see
    134 .Xr snac 8
    135 for more information).
    136 .It Pa announcement.txt
    137 If this file is present, an announcement will be shown to logged in users
    138 on every page with its contents. It is also available through the Mastodon API.
    139 Users can dismiss the announcement, which works by storing the modification time
    140 in the "last_announcement" field of the
    141 .Pa user.json
    142 file. When the file is modified, the announcement will then reappear. It can
    143 contain only text and will be ignored if it has more than 2048 bytes.
    144 .El
    145 .Pp
    146 Each user directory is a subdirectory of 
    147 .Pa BASEDIR/user/ ,
    148 has the user id as name and contains the following subdirectories and files:
    149 .Bl -tag -width tenletters
    150 .It Pa user.json
    151 User configuration file.
    152 .It Pa user_o.json
    153 User configuration override file. This file is intended for administrators to
    154 override some user preferences. For current version, the fields that can be
    155 overridden are 'purge_days' and 'email'.
    156 .It Pa key.json
    157 Secret/public key PEM data.
    158 .It Pa followers.idx
    159 This file contains the list of followers as a list of hashed object identifiers.
    160 .It Pa followers/
    161 This directory stores hard links to the actor objects in the object storage.
    162 .It Pa following/
    163 This directory stores the users being followed as hard links to the 'Follow'
    164 or 'Accept' objects in the object storage. File names are the hashes of each
    165 actor Id.
    166 .It Pa private/
    167 This directory stores hard links to the timeline entries in the object storage.
    168 .It Pa private.idx
    169 This file contains the list of timeline entries as a list of hashed
    170 object identifiers.
    171 .It Pa public/
    172 This directory stores hard links to the public timeline entries in the object
    173 storage.
    174 .It Pa public.idx
    175 This file contains the list of public timeline entries as a list of hashed
    176 object identifiers.
    177 .It Pa pinned/
    178 This directory stores hard links to pinned posts.
    179 .It Pa pinned.idx
    180 This file contains the list of pinned posts as a list of hashed
    181 object identifiers.
    182 .It Pa bookmark/
    183 This directory stores hard links to bookmarked posts.
    184 .It Pa bookmark.idx
    185 This file contains the list of pinned posts as a list of hashed
    186 object identifiers.
    187 .It Pa draft/
    188 This directory stores post drafts.
    189 .It Pa draft.idx
    190 This file contains the list of drafts as a list of hashed
    191 object identifiers.
    192 .It Pa muted/
    193 This directory contains files which names are hashes of muted actors. The
    194 content is a line containing the actor URL.
    195 Messages from these actors will be ignored on input and not shown in any timeline.
    196 .It Pa hidden/
    197 This directory contains references to the hidden timeline entries.
    198 .It Pa limited/
    199 This directory contains references to the actor URLs for limited users (those
    200 being followed but with their boosts blocked).
    201 .It Pa queue/
    202 This directory contains the output queue of messages generated by the user as
    203 JSON files. File names contain timestamps that indicate when the message will
    204 be sent. Messages not accepted by their respective servers will be re-enqueued
    205 for later retransmission until a maximum number of retries is reached,
    206 then discarded.
    207 .It Pa static/
    208 Files in this directory are served as-is when requested from the
    209 .Pa https://HOST/USER/s/...
    210 URL path. A special file named
    211 .Pa style.css
    212 can contain user-specific CSS code to be inserted into the HTML of the
    213 web interface.
    214 .It Pa history/
    215 This directory contains generated HTML files. They may be snapshots of the
    216 local timeline in previous months or other cached data.
    217 .It Pa export/
    218 This directory will contain exported data in Mastodon-compatible CSV format
    219 after executing the 'export_csv' command-line operation.
    220 .It Pa import/
    221 Mastodon-compatible CSV files must be copied into this directory to use
    222 any of the importing functions.
    223 .It Pa server.pid
    224 This file stores the server PID in a single text line.
    225 .El
    226 .Sh SEE ALSO
    227 .Xr snac 1 ,
    228 .Xr snac 8
    229 .Sh AUTHORS
    230 .An grunfink Lk https://comam.es/snac/grunfink @grunfink@comam.es
    231 .Sh LICENSE
    232 See the LICENSE file for details.