Go to file
2022-04-08 17:43:53 -05:00
.cargo Update deps 2022-02-01 11:47:17 -06:00
docker Add console-subscriber, add cargo publish step 2021-12-19 14:24:31 -06:00
scss Don't style instance descriptions 2020-09-27 12:44:23 -05:00
src Update RSA 2022-04-08 17:39:38 -05:00
templates Update to latest activitystreams 2022-01-17 16:54:45 -06:00
.drone.yml Rename crate to avoid crates.io collision 2021-12-28 10:30:48 -06:00
.env Support exporting metrics to Opentelemetry 2021-09-18 13:40:47 -05:00
.gitignore Update readme 2021-02-09 22:19:04 -06:00
Cargo.lock Bump version 2022-04-08 17:43:53 -05:00
Cargo.toml Bump version 2022-04-08 17:43:53 -05:00
LICENSE Fix VERIFY_SIGNATURES config, add README 2020-03-19 22:23:10 -05:00
README.md Remove max conns from readme 2021-03-19 10:52:04 -05:00

AodeRelay

A simple and efficient activitypub relay

Usage

To simply run the server, the command is as follows

$ ./relay

To learn about any other tasks, the --help flag can be passed

$ ./relay --help
relay 0.2.0
An activitypub relay

USAGE:
    relay [FLAGS] [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -u, --undo       Undo allowing or blocking domains
    -V, --version    Prints version information

OPTIONS:
    -a <allowed>...        A list of domains that should be allowed
    -b <blocks>...         A list of domains that should be blocked

To add domains to the blocklist, use the -b flag and pass a list of domains

$ ./relay -b asonix.dog blimps.xyz

To remove domains from the blocklist, simply pass the -u flag along with -b

$ ./relay -ub asonix.dog blimps.xyz

The same rules apply for allowing domains, although domains are allowed with the -a flag

$ ./relay -a asonix.dog blimps.xyz
$ ./relay -ua asonix.dog blimps.xyz

Allowed domains are only checked against incoming activities if RESTRICTED_MODE is enabled. Blocks can be published in the nodeinfo metadata by setting PUBLISH_BLOCKS to true

For advanced setups, it may be useful to run the relay API and the background tasks in separate processes, possibly on separate hosts. The -j and -n flags have been provided for this purpose. By passing -n, a relay can be spawned that handles no deliveries. By passing -j, a relay will not be spawned, but any deliveries existing in the database will be processed.

Subscribing

Mastodon admins can subscribe to this relay by adding the /inbox route to their relay settings. For example, if the server is https://relay.my.tld, the correct URL would be https://relay.my.tld/inbox.

Pleroma admins can subscribe to this relay by adding the /actor route to their relay settings. For example, if the server is https://relay.my.tld, the correct URL would be https://relay.my.tld/actor.

Supported Activities

  • Accept Follow {remote-actor}, this is a no-op
  • Reject Follow {remote-actor}, an Undo Follow is sent to {remote-actor}
  • Announce {anything}, {anything} is Announced to listening servers
  • Create {anything}, {anything} is Announced to listening servers
  • Follow {self-actor}, become a listener of the relay, a Follow will be sent back
  • Follow Public, become a listener of the relay
  • Undo Follow {self-actor}, stop listening on the relay, an Undo Follow will be sent back
  • Undo Follow Public, stop listening on the relay
  • Delete {anything}, the Delete {anything} is relayed verbatim to listening servers Note that this activity will likely be rejected by the listening servers unless it has been signed with a JSON-LD signature
  • Update {anything}, the Update {anything} is relayed verbatim to listening servers Note that this activity will likely be rejected by the listening servers unless it has been signed with a JSON-LD signature

Supported Discovery Protocols

  • Webfinger
  • NodeInfo

Configuration

By default, all these values are set to development values. These are read from the environment, or from the .env file in the working directory.

HOSTNAME=localhost:8080
ADDR=127.0.0.1
PORT=8080
DEBUG=true
RESTRICTED_MODE=false
VALIDATE_SIGNATURES=false
HTTPS=false
DATABASE_URL=
PRETTY_LOG=true
PUBLISH_BLOCKS=false

To run this server in production, you'll likely want to set most of them

HOSTNAME=relay.my.tld
ADDR=0.0.0.0
PORT=8080
DEBUG=false
RESTRICTED_MODE=false
VALIDATE_SIGNATURES=true
HTTPS=true
DATABASE_URL=postgres://pg_user:pg_pass@pg_host:pg_port/pg_database
PRETTY_LOG=false
PUBLISH_BLOCKS=true

Contributing

Unless otherwise stated, all contributions to this project will be licensed under the CSL with the exceptions listed in the License section of this file.

License

This work is licensed under the Cooperative Software License. This is not a Free Software License, but may be considered a "source-available License." For most hobbyists, self-employed developers, worker-owned companies, and cooperatives, this software can be used in most projects so long as this software is distributed under the terms of the CSL. For more information, see the provided LICENSE file. If none exists, the license can be found online here. If you are a free software project and wish to use this software under the terms of the GNU Affero General Public License, please contact me at asonix@asonix.dog and we can sort that out. If you wish to use this project under any other license, especially in proprietary software, the answer is likely no.