Sin descripción

Benton Edmondson de1f9001c6 license: add gplv3 license hace 1 año
.github 158bad5b98 GHA: add write permissions to workflow hace 1 año
.vscode dd5d523732 rename from mimicry to servitor hace 1 año
ansi 0afdf6847c ansi: make SetLength handle non-ascii hace 1 año
assets 46ce14c7ac readme: add demo gif hace 1 año
client 04119e2f4d client: make request forgery check less strict hace 1 año
config 53c8165543 ui: fix misnamed config item hace 1 año
feed dd5d523732 rename from mimicry to servitor hace 1 año
gemtext dd5d523732 rename from mimicry to servitor hace 1 año
history 6928d069ff Globally reformat with go fmt hace 1 año
hypertext dd5d523732 rename from mimicry to servitor hace 1 año
jtp 93adacf7dd jtp: fix typo in readme hace 1 año
markdown dd5d523732 rename from mimicry to servitor hace 1 año
mime 6928d069ff Globally reformat with go fmt hace 1 año
object dd5d523732 rename from mimicry to servitor hace 1 año
plaintext dd5d523732 rename from mimicry to servitor hace 1 año
pub e8ac942356 pub/post: Parents(0) is used to prevent a microload that determines if there are any parents hace 1 año
splicer e17d36263c splicer: simplify logic and make it more parallel hace 1 año
style c433ebb8ac config: config is now accessible throughout the program hace 1 año
ui e8ac942356 pub/post: Parents(0) is used to prevent a microload that determines if there are any parents hace 1 año
.gitignore dd5d523732 rename from mimicry to servitor hace 1 año
go.mod dd5d523732 rename from mimicry to servitor hace 1 año
go.sum 97742ab7bc implemented package config hace 1 año
license de1f9001c6 license: add gplv3 license hace 1 año
main.go 5350e8c596 main.go: remove accidental test value from version variable hace 1 año
readme.md 7682a8bc57 reamdme: add line break in fediverse overview to make it more readable hace 1 año

readme.md

Servitor

A command-line RSS-style ActivityPub client that works with Mastodon, Lemmy, PeerTube, and more.

Features

  • Works with fediverse software such as Mastodon, Lemmy, PeerTube, and more
  • Doesn't require a server
  • Sidesteps defederation politics
    • because posts are always pulled directly from their source site, you are not affected by servers blocking each other
  • Keeps your subscriptions private
    • subscriptions are stored locally, so you can subscribe to people without sending them follow requests
  • Follows the Unix philosophy
    • the browser itself is just handles the ActivityPub protocol, media viewing is all handled by separate programs

Installation

Run uname -ms and, based on the corresponding output, download the latest corresponding release.

I only necessarily test Linux x86_64 releases, but will fix issues with others as they arise.

Usage

  • servitor open @username@example.org to open profiles.
  • servitor open https://example.org/user/username to open links.
  • servitor feed feed-name to open feeds (see below).

Configuration

The config file is located at ~/.config/servitor/config.toml.

[feeds]
# the entries will be spliced together
# in chronological order, like an RSS reader
linux = [ # open with `servitor feed linux`
    "@torvalds@social.kernel.org",
    "@luke@videos.lukesmith.xyz",
    "@thelinuxexperiment@tilvids.com",
]
dnd = [ # open with `servitor feed dnd`
    "@rpgmemes@ttrpg.network",
    "@dnd@lemmy.world",
]

[style.colors]
primary = "#A4f59b"
error = "#9c3535"
highlight = "#0d7d00"
code_background = "#4b4b4b"

[network]
preload_amount = 5 # the number of posts to load in above and below the highlighted post
timeout_seconds = 5
cache_size = 128 # the number of JSON responses the cache can hold

[media]
# described below

Media Hook

There are various ways to open files on Linux (xdg-open, mailcap, handlr, bespoke scripts, etc). The media.hook config option allows you to configure whichever one you use. The value is a list of strings that will be executed as a command. Parameters will be substituted as follows:

  • %url — substituted with the URL being opened
  • %mimetype — substituted with the media type being opened, e.g. image/png
  • %supertype — substituted with the first part of the media type, e.g. image
  • %subtype — substituted with the subtype, e.g. png

Here is a simple example config that opens videos and gifs in mpv, images in feh, and everything else in firefox:

[media]
hook = [
    "sh", "-c",
    '''
        if test "$2" = "video"; then exec mpv --keep-open=yes "$0"; fi
        if test "$1" = "image/gif"; then exec mpv --keep-open=yes "$0"; fi
        if test "$2" = "image"; then exec feh --scale-down --image-bg black "$0"; fi
        exec firefox "$0"
    ''',
    "%url", "%mimetype", "%supertype"
]

media.hook defaults to ["xdg-open", "%url"].

Keybindings

j — move down\ k — move up\ space — select the highlighted item\ c — view the creator of the highlighted item\ r — view the recipient of the highlighted item (e.g. the group it was posted to)\ a — view the actor of the activity (e.g. view the retweeter of a retweet)\ h — move back in your browser history\ l — move forward in your browser history\ g — move to the expanded item (i.e. move to the current OP)\ ctrl+c — exit the program

Media

p — open the highlighted user's profile picture\ b — open the highlighted user's banner\ o — open the content of a post itself (e.g. open the video associated with a video post)\ number keys — open a link within the highlighted text

Where to Find Content to Follow

Please submit a PR if you know of another good resource.

A Brief Overview of the Fediverse

For the purpose of this browser, the fediverse can be thought of as a collection of internet forums that use a shared protocol called ActivityPub. Instead of serving content over text/html, they serve their content over application/activity+json, which provides for higher-level semantics such as comment sections, retweets, etc.

Just like conventional forums, each site has a different moderation policy, and the administrators of each site have complete control over the moderation of that site. Unlike conventional internet forums, the fediverse allows users from one site to interact with (like, follow, comment on, etc) users and posts on another site, assuming the administrators of the both sites permit the interaction.

Supported Markup Formats

Servitor can render posts published in:

Dependencies

I tried to minimize the amount of dependencies used. They are:

Planned Improvements

  • The ability to connect to ActivityPub search engines and algorithm providers (however controversial that may be)
  • Better support for long-form content