fed-server

module
v0.0.0-...-0832744 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2025 License: AGPL-3.0

README

fed-server

a server that can send signed federation requests using mautrix.

please do not expect any support or quality from this! i'm learning Go while creating it, so if a server explodes during use, i am not responsible.

also before anyone make fed jokes, this has everything to do with US federal agents. i'm a fed and i'm in your walls.

setup

  1. create or copy federation keys in the Synapse format (ed25519 <key id> <base64 key>)
  2. create config.json:
{
    "name": "server software name",
    "version": "server software version",
    "server_name": "example.com",
    "key": "ed25519 <key id> <base64 key>",
    "listen_address": "127.0.0.1:8888"
}

i recommend using a fresh (sub)domain for server_name, and not a real server.

  1. build go build cmd/fed-server and copy the binary somewhere suitable.
  2. run fed-server! config.json must be in the working directory, or it will not start.
  3. reverse proxy only /_matrix/key/v2/server and optionally /_matrix/federation/v1/version. WARNING: take care on this step, there is no authentication. if any other endpoints are exposed, anyone will be able to send federation requests in the server's name!

usage

POST /send/{txnID} - send federation transactions. this accepts the same JSON body as /_matrix/federation/v1/send, and uses the destination property to determine which server to send to. txnID is any transaction ID, such as a timestamp.

<any method> /request/{server}/{path} - send any kind of request to server. path is prepended with /_matrix/federation but i'll probably fix/change that quite soon.

POST /sign - returns the JSON body, but signed by the server's federation keys.

known problems

  • conduit & its forks may not like some of the events this has signed, at least from my experience trying to join rooms

Directories

Path Synopsis
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL