selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Codeberg
snac logo

Self-host snac

2.92

Minimal Fediverse server in portable C with Mastodon API

ReleaseOpen SourceMIT
Updated8 months ago
Setup difficultyAdvanced
Port
8001 (TCP socket the snac daemon listens on in the documented examples (proxy by nginx/Apache/httpd for TLS))
Install with Build from Source
snac screenshot 1

What is snac?

Should you self-host snac?

snac scores 61/100 on selfhost.directory (how scoring works) and ranks #18 of 69 in Social Networks & Forums.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is advanced: plan for several services and some ongoing maintenance. It is MIT-licensed.

Its closest alternative on selfhost.directory is Discourse (83/100, 48 024 stars). It scores higher overall, so compare the two before you pick. See snac vs Discourse side by side.

Features

  • ActivityPub Federation
  • Content warnings
  • Hashtag following and blocking
  • Mastodon API supportOptional at build time via -DNO_MASTODON_API
  • Mastodon-compatible import/export
  • Media attachments
  • Multi-user support
  • Nested conversation threads
  • No Database Required
  • Notifications
  • Polls
  • Post visibility levels
  • Scheduled posts
  • Web Interface

How to install snac

Install snac with Build from Source

curl
Environment variables
DEBUG, SNAC_BASEDIR, EDITOR, LANG

Requirements:

apt install libssl-dev libcurl4-openssl-dev # as root

Build and install:

make
make install # as root

Then `snac init <basedir>`, `snac adduser` and `snac httpd <basedir>` behind a TLS reverse proxy.

How to configure snac

  • addresslocalhostListen network address; a leading / means a UNIX socket instead.

    Listen network address; a leading / means a UNIX socket instead.

  • admin_accountUser name of the instance administrator (optional).

    User name of the instance administrator (optional).

  • admin_emailEmail address of the instance administrator (optional).

    Email address of the instance administrator (optional).

  • badlogin_expire300Seconds a blocked IP address stays ignored in login attempts.

    Seconds a blocked IP address stays ignored in login attempts.

  • badlogin_retries5Failed logins from one IP before further attempts are rejected.

    Failed logins from one IP before further attempts are rejected.

  • cssurlsList of site-wide CSS file URLs loaded before each user's own CSS.

    List of site-wide CSS file URLs loaded before each user's own CSS.

  • dbglevel0Debug verbosity as an integer.

    Debug verbosity as an integer.

    values: 0-3

  • DEBUGOverrides the dbglevel configuration value; higher means more verbose output.

    Overrides the dbglevel configuration value; higher means more verbose output.

    values: 0-3

  • def_timeline_entriesDefault number of timeline entries shown in the web interface.

    Default number of timeline entries shown in the web interface.

  • disable_block_notificationsNever send notifications about Block activities.

    Never send notifications about Block activities.

    values: true/false

  • disable_cacheTurn off timeline caching; for debugging only, makes everything slower.

    Turn off timeline caching; for debugging only, makes everything slower.

    values: true/false

  • disable_email_notificationsSend no email notification for any user.

    Send no email notification for any user.

    values: true/false

  • disable_emojireactDisable all EmojiReact support, input and output.

    Disable all EmojiReact support, input and output.

    values: true/false

  • disable_historyDo not serve monthly history snapshots or their links.

    Do not serve monthly history snapshots or their links.

    values: true/false

  • disable_inbox_collectionSkip inbox collection, which helps discovery but adds traffic.

    Skip inbox collection, which helps discovery but adds traffic.

    values: true/false

  • disable_notify_webhookForbid users from setting a notification webhook URL.

    Forbid users from setting a notification webhook URL.

    values: true/false

  • disable_openbsd_securityDisable use of unveil(2) and pledge(2) under OpenBSD.

    Disable use of unveil(2) and pledge(2) under OpenBSD.

    values: true/false

  • disable_sandboxDisable Linux Landlock sandboxing (needs it compiled in and kernel 5.13.0+).

    Disable Linux Landlock sandboxing (needs it compiled in and kernel 5.13.0+).

    values: true/false

  • EDITORInteractive text editor used when posting notes with the -e argument.

    Interactive text editor used when posting notes with the -e argument.

  • enable_svgShow SVG image attachments, which are hidden by default since 2.73.

    Show SVG image attachments, which are hidden by default since 2.73.

    values: true/false

  • fastcgiTalk to the front-end http server over FastCGI instead of HTTP proxying.

    Talk to the front-end http server over FastCGI instead of HTTP proxying.

    values: true/false

  • favicon_urlURL of a favicon, replacing the default one.

    URL of a favicon, replacing the default one.

  • ffmpeg_pathffmpegOverride the default ffmpeg command name or path.

    Override the default ffmpeg command name or path.

  • force_ipv6_requestsMake outgoing HTTP requests use only IPv6.

    Make outgoing HTTP requests use only IPv6.

    values: true/false

  • hide_delete_post_buttonDo not show the button that deletes a post.

    Do not show the button that deletes a post.

    values: true/false

  • hostHost name of the instance.

    Host name of the instance.

  • http_headersExtra HTTP response header/value pairs to add.

    Extra HTTP response header/value pairs to add.

  • keep_replied_meAdd a remote reply to one of your posts to the local public timeline.

    Add a remote reply to one of your posts to the local public timeline.

    values: true/false

  • keep_replied_postsAdd the remote parent post to the local public timeline when you reply to it.

    Add the remote parent post to the local public timeline when you reply to it.

    values: true/false

  • LANGLanguage of posts sent from the command line.

    Language of posts sent from the command line.

  • layoutDisk storage layout version; should never be edited by hand.

    Disk storage layout version; should never be edited by hand.

  • local_purge_daysSame as timeline_purge_days but for user-written local timeline entries.

    Same as timeline_purge_days but for user-written local timeline entries.

  • max_attachments4Maximum attachments per post.

    Maximum attachments per post.

  • max_failing_days15Days of continuous failed outgoing messages before an instance is considered down.

    Days of continuous failed outgoing messages before an instance is considered down.

  • max_poll_option_length60Maximum length of a single poll option.

    Maximum length of a single poll option.

  • max_poll_options8Maximum number of options in a poll.

    Maximum number of options in a poll.

  • max_public_entries20Maximum posts returned in user RSS feeds and outboxes.

    Maximum posts returned in user RSS feeds and outboxes.

  • max_timeline_entriesMaximum timeline entries shown in the web interface.

    Maximum timeline entries shown in the web interface.

  • min_account_ageReject activity from accounts created more recently than this many seconds (anti-spam).

    Reject activity from accounts created more recently than this many seconds (anti-spam).

  • mogrify_pathmogrifyOverride the default mogrify command name or path.

    Override the default mogrify command name or path.

  • num_threadsExact number of threads used when processing connections; values below 4 are ignored.

    Exact number of threads used when processing connections; values below 4 are ignored.

  • port8001Listen network port (ignored when address is a UNIX socket).

    Listen network port (ignored when address is a UNIX socket).

  • prefixURL path prefix the instance is mounted under.

    URL path prefix the instance is mounted under.

  • propagate_local_purgeSend a Delete activity everywhere for every purged local post.

    Send a Delete activity everywhere for every purged local post.

    values: true/false

  • protocolhttpsURL schema used; set to http only when running inside hidden networks such as Tor or I2P.

    URL schema used; set to http only when running inside hidden networks such as Tor or I2P.

    values: https|http

  • proxy_mediaProxy remote image, audio and video links through snac to hide user IPs.

    Proxy remote image, audio and video links through snac to hide user IPs.

    values: true/false

  • purge_staticDelete files in user static directories that are not attached, used as avatar/header/favicon or served as emoji.

    Delete files in user static directories that are not attached, used as avatar/header/favicon or served as emoji.

    values: true/false

  • queue_retry_maxMaximum retries for outgoing messages that failed to post.

    Maximum retries for outgoing messages that failed to post.

  • queue_retry_minutesMinutes to wait before retrying a failed message, multiplied by retries already done.

    Minutes to wait before retrying a failed message, multiplied by retries already done.

  • queue_timeoutMaximum seconds to wait while sending a queued message.

    Maximum seconds to wait while sending a queued message.

  • queue_timeout_2Timeout for servers that already timed out on the previous retry.

    Timeout for servers that already timed out on the previous retry.

  • rss_hashtag_poll_hours4How often hashtag RSS feeds are polled, in hours (minimum 1).

    How often hashtag RSS feeds are polled, in hours (minimum 1).

  • shared_inboxesAnnounce shared inboxes or not; optimizes incoming traffic on bigger instances.

    Announce shared inboxes or not; optimizes incoming traffic on bigger instances.

    values: true/false

  • short_descriptionTextual short description about the instance (optional).

    Textual short description about the instance (optional).

  • short_description_rawWhether the short description is kept raw or converted to HTML.

    Whether the short description is kept raw or converted to HTML.

    values: true/false

  • show_instance_timelineServe a latest-user-posts timeline at the instance base URL instead of the static greeting page.

    Serve a latest-user-posts timeline at the instance base URL instead of the static greeting page.

    values: true/false

  • smtp_passwordPassword for the SMTP server, if it needs credentials.

    Password for the SMTP server, if it needs credentials.

  • smtp_urlSMTP URL used for email notifications instead of piping to sendmail.

    SMTP URL used for email notifications instead of piping to sendmail.

  • smtp_userCredentials for the SMTP server, if it needs them.

    Credentials for the SMTP server, if it needs them.

  • SNAC_BASEDIROptional base directory so it need not be passed to command-line operations.

    Optional base directory so it need not be passed to command-line operations.

  • strict_public_timelinesShow only posts and boosts originating from an account in public timelines (no conversation trees).

    Show only posts and boosts originating from an account in public timelines (no conversation trees).

    values: true/false

  • strip_exifStrip EXIF and other metadata from uploaded images and videos; needs mogrify and ffmpeg installed.

    Strip EXIF and other metadata from uploaded images and videos; needs mogrify and ffmpeg installed.

    values: true/false

  • timeline_purge_daysAge in days after which timeline entries are purged; 0 disables purging.

    Age in days after which timeline entries are purged; 0 disables purging.

  • titleName of the instance (optional).

    Name of the instance (optional).

  • TZTime zone used by the docker entrypoint example when initializing the container.

    Time zone used by the docker entrypoint example when initializing the container.

  • vkeyPublic VAPID key used for notifications on some client.

    Public VAPID key used for notifications on some client.

More in Microblogging

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…