|
NAME
DESCRIPTIONThe This is the admin manual. For user operation, see snac(1). For file and data formats, see snac(5). Special cares about your snac you must know beforehand
Building and InstallationA C compiler must be installed in the system, as well as the
development headers and libraries for OpenSSL (or compatible) and curl. To
build make And, after that, run as root make install Data storage InitializationOnce snac init $HOME/snac-data A small set of questions will be asked regarding the installation,
specially the host name it will run under, the local network address and
port Since version 2.57, if the 'network address' starts with /, it's assumed to be a UNIX-like socket (please take note that the http proxy must have full read and write access to this socket; this is a common pitfall. Permissions will break your heart). You can launch the snac httpd $HOME/snac-data Log messages are sent to the standard error stream. By default, only relevant information is written there. You can increase the debugging level by editing the 'dbglevel' field in the server.json file or by setting a numeric value between 0 and 3 to the DEBUG environment variable, see below. If you operate a Linux systemd-enabled system, OpenBSD, FreeBSD or NetBSD, there are startup scripts and configuration data in the examples directory. For other operating systems, please read the appropriate documentation on how to install a daemon as a non-root service. Upgrading to a new versionSometimes, the data storage disk layout changes between versions.
If there is such a change, snac upgrade $HOME/snac-data Take special care to execute this upgrade operation without any
Server SetupAn http server with TLS and proxying support must already be
installed and configured. Adding UsersUsers must be created from the command line. You can do it by running snac adduser $HOME/snac-data All needed data will be prompted for. There is no artificial limit on the number of users that can be created. CustomizationThe server.json configuration file allows some behaviour tuning:
You must restart the server to make effective these changes. If a file named greeting.html is present in the server base directory, it will be returned whenever the base URL of the server is requested. Fill it with whatever information about the instance you want to supply to people visiting the server, like sign up requirements, site policies and such. The special %userlist% mark in the file will cause the list of users in this instance to be inserted. Users can change a bit of information about themselves from the web interface. See snac(1) for details. Further, every user can have a private CSS file in their static/style.css that will be served instead of the server-wide one. It's not modifiable from the web interface to avoid users shooting themselves in the foot by destroying everything. Custom EmojisFrom version 2.51, support for customized Emojis in posts is available (previously, they were hardcoded). Emojis are read from the emojis.json file in the instance base directory, as a JSON object of key / value pairs (if this file does not exist, it will be created with the predefined set). Each key in the object contains the text to be found (e.g., the :-) for a smiling face), and its associated value, the text string that will replace it (in this example case, the HTML entity for the Unicode codepoint for the smiley or the Emoji itself as text). Emoji values can also be URLs to image files; in this case, they will not be substituted in the post content, but added to the 'tag' array as an ActivityPub standard 'Emoji' object (it's recommendable that the Emoji key be enclosed in colons for maximum compatilibity with other ActivityPub implementations, like e.g. :happydoggo:). These images can be served from an external source or from the static directory of the instance admin. If you want to disable any Emoji substitution, change the file to contain just an empty JSON object ({}). SPAM MitigationThere have been some SPAM attacks on the Fediverse and, as too
many instances and server implementations out there still allow automatic
account creation, it will only get worse. The From version 2.50, post content can be filtered out by regular
expressions. These weapons of mass destruction can be written into the
ActivityPub SupportThese are the following activities and objects that
The rest of activities and objects are dropped on input. There is partial support for OrderedCollection objects in the /outbox (with the last 20 entries of the local timeline shown). No pagination is supported. Intentionally, the /followers and /following paths return empty lists. Migrating from snac to MastodonSince version 2.60, you can migrate your
https://fedi.tips/transferring-your-mastodon-account-to-another-server/ 1. On your snac export_csv $SNAC_BASEDIR origin You'll find the following CSV files in the export/ subdirectory inside the user directory: bookmarks.csv, blocked_accounts.csv, lists.csv, and following_accounts.csv. 2. In the web interface of your new Mastodon account, click on Preferences > Import and Export > Import and upload the CSV files one at a time. You must specify the type of file you are uploading. 3. Still in the web interface of your new Mastodon account, click on Preferences > Account > Moving From a Different Account, then click on Create an account alias and follow the instructions. (When it asks you to write your old account’s handle, it needs to include the @ at the start as well as the @ in the middle; as of our example, @origin@snac.example.org). It seems this step is not performed immediately, you must wait an unspecified number of minutes for this to be effective. 4. Meanwhile, you must tell snac alias $SNAC_BASEDIR origin "@destination@mastodon.example.com" 5. Finally, you must order snac migrate $SNAC_BASEDIR origin This process can be very long and unreliable; any destination server may be down, too busy, disconnected or gone. I recommend you to read the document I linked above to know about all the sorrows awaiting. Also, please take note that the Migrating from Mastodon to snacSince version 2.61, you can migrate accounts on other ActivityPub
instances to your https://fedi.tips/transferring-your-mastodon-account-to-another-server/ 1. On the web interface of your origin Mastodon account, click on Preferences > Import and Export > Export and download the CSV files under the "Follows", "Lists", "You Block" and "Bookmarks" labels. After being downloaded, you should find the following files on your download directory: bookmarks.csv, blocked_accounts.csv, lists.csv, and following_accounts.csv. 2. Copy all those files to the import/ subdirectory of the user's directory inside the server base directory, and run snac import_csv $SNAC_BASEDIR destination This process may take some time because it depends on the
availability / responsiveness of all the ActivityPub servers involved
(webfinger, accounts, posts, etc.). Some errors may be transient and retried
later. Also, if 3. Again on your snac alias $SNAC_BASEDIR destination "@origin@mastodon.example.com" Check that no errors were shown. If they do, the origin Mastodon server may be busy or down; try again later. 4. Move back to the web interface of the origin Mastodon account,
go to Preferences > Account
> Move To A Different Account, and follow the
instructions there. Set the handle of the new account to your
Instance blockingFull instances can be blocked. This operation must be done from the command-line tool. See snac(1). Bad login throttlingSince version 2.67, a simple logic to avoid brute force attacks
against user passwords has been implemented: if, from a given IP address,
the number of failed logins reaches a given threshold, further tries from
that IP address are never successful until a timer expires. The maximum
number of retries can be configured in the
server.json file by setting the
Subscribing to Fediverse RelaysSince version 2.69, a Example: snac adduser $SNAC_BASEDIR relay # only needed once snac follow $SNAC_BASEDIR relay https://relay.example.com/actor Users on your instance do NOT need to follow the local relay user to benefit from following hashtags. Please take note that subscribing to relays can increase the traffic towards your instance significantly. In any case, lowering the "Maximum days to keep posts" value for the relay special user is recommended (e.g. setting to just 1 day). Web interface languageSince version 2.73, the web UI can be localized via simple .po files (they are directly parsed, no support for gettext is needed). No language file is installed by default; the administrator must
copy any desired .po files to the lang/ subdirectory
in the base directory. Once the server is restarted, users can select the
new language from the user settings. The To create new language files, create a copy of
po/en.po, rename it to a reasonable value like
pl.po or pt_BR.po, change
the translator in the header to yourself and fill the msgstr strings with
your translation. If you have any doubt on how to modify .po files, there
are many tutorials out there. If you want your language file to be included
in the standard ENVIRONMENT
EXAMPLESYou want to install the Log into the system as snacusr and execute: snac init /home/snacusr/fedidata Answer "example.com" to the host name question, "/fedi" to the path prefix question, "localhost" to the address and "8001" to the port. Create the users snac adduser /home/snacusr/fedidata walter snac adduser /home/snacusr/fedidata jesse Answer the questions with reasonable values. Execute the server: snac httpd /home/snacusr/fedidata Edit the nginx configuration and add the following snippet to the example.com server section: # nginx configuration example
# main web access point
location /fedi {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# webfinger
location /.well-known/webfinger {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# Mastodon API (entry points)
location /api/v1/ {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /api/v2/ {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# Mastodon API (OAuth support)
location /oauth {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# optional
location /.well-known/nodeinfo {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# optional (needed by some Mastodon API clients)
location /.well-known/host-meta {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# optional (Mastodon-like link share entrypoint)
location /share {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# optional (Mastodon-like "authorize interaction" entrypoint)
location /authorize_interaction {
proxy_pass http://localhost:8001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
}
Restart the nginx daemon and connect to https://example.com/fedi/walter. The empty, default screen will be shown. Enter the admin section with the credentials defined for this user. Search people, start following them, engage in arid discussions and generally enjoy the frustrating experience of Social Media. This is an example of a similar configuration for the Apache2 web server: # apache2 configuration example
ProxyPreserveHost On
# Main web access point
<Location /fedi>
ProxyPass http://127.0.0.1:8001/social
</Location>
# WebFinger
<Location /.well-known/webfinger>
ProxyPass http://127.0.0.1:8001/.well-known/webfinger
</Location>
# Mastodon API (entry points)
<Location /api/v1/>
ProxyPass http://127.0.0.1:8001/api/v1/
</Location>
<Location /api/v2/>
ProxyPass http://127.0.0.1:8001/api/v2/
</Location>
# Mastodon API (OAuth support)
<Location /oauth>
ProxyPass http://127.0.0.1:8001/oauth
</Location>
# NodeInfo (optional)
<Location /.well-known/nodeinfo>
ProxyPass http://127.0.0.1:8001/.well-known/nodeinfo
</Location>
# host-meta (optional, needed for some Mastodon API clients)
<Location /.well-known/host-meta>
ProxyPass http://127.0.0.1:8001/.well-known/host-meta
</Location>
# optional (Mastodon-like link share entrypoint)
<Location /share>
ProxyPass http://127.0.0.1:8001/share
</Location>
# optional (Mastodon-like "authorize interaction" entrypoint)
<Location /authorize_interaction>
ProxyPass http://127.0.0.1:8001/share
</Location>
Since version 2.43, fastcgi_pass localhost:8001; The only thing to change on Further, using the FastCGI interface allows a much simpler configuration under OpenBSD's native httpd, given that it's natively implemented there and you no longer need to configure the complicated relayd server. This is an example: # OpenBSD httpd configuration example
# other server configuration
[...]
location "/fedi/*" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/.well-known/webfinger" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/oauth/*" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/api/v1/*" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/api/v2/*" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/.well-known/nodeinfo" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/.well-known/host-meta" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/share" {
fastcgi socket tcp "127.0.0.1" 8001
}
location "/authorize_interaction" {
fastcgi socket tcp "127.0.0.1" 8001
}
SEE ALSOAUTHORSgrunfink @grunfink@comam.es LICENSESee the LICENSE file for details. CAVEATSJSON files are fragile when modified by hand. Take care.
|