1
0
Fork
You've already forked fed-server
0
No description
  • Go 100%
2025年05月24日 05:42:39 +01:00
cmd add AGPL license and also sign raw body in /sign 2025年05月19日 01:18:04 +01:00
internal /request: return raw content instead of trying to handle the response as json 2025年05月24日 05:40:37 +01:00
.gitignore dump my work 2025年04月28日 09:25:43 +01:00
COPYING add AGPL license and also sign raw body in /sign 2025年05月19日 01:18:04 +01:00
go.mod update mautrix 2025年05月11日 06:12:14 +01:00
go.sum update mautrix 2025年05月11日 06:12:14 +01:00
README.md add known issues section to README.md (1 issue kek) 2025年05月24日 05:42:39 +01:00

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