Files
tobi 39ad509968 [feature] Add db functions, api endpoints, and settings panel sections for relay subscriptions + pushes (#4796)
# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request:

- adds database functionality + tables for three new models: RelayPush, RelaySubscription, and RelayMatcher.
- adds api endpoints `/api/v1/admin/relay_subscriptions` etc, and `/api/v1/relay_pushes` etc, to allow admins to manage relay subscriptions, and users to manage relay push connections.
- adds settings panel sections for admins to manage relay subscriptions and relay subscription matchers, and for users to manage relay push connections and relay push matchers
- adds documentation for all of the above

The goal is, unlike other ActivityPub server softwares, to make a split between relay subscriptions (accepting delivery of posts from a relay), and relay push connections (pushing posts to a relay). Relay subscriptions are an admin-level thing, as they can cause ballooning storage size and we don't necessarily want users to be able to do that. On the other hand, relay pushes are a user level thing, as users should be able to configure on a granular level which posts of theirs are sent to which relays.

Using relay flags and relay matchers (see documentation), admins and users can configure exactly which posts are pulled and pushed via relays.

![admin-settings-relay-subscription](/attachments/6504419a-21ad-4782-ba33-3f3205d49c20)

Relates to https://codeberg.org/superseriousbusiness/gotosocial/issues/1123 but doesn't quite close it yet.

**THIS DOES NOT YET ADD BACKEND FUNCTIONALITY FOR ACTUALLY PUSHING POSTS + ACCEPTING POSTS** -- that will come in a separate PR.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first two checkboxes must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have not used so-called 'AI' to create the proposed changes.
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [x] I/we have made any necessary changes to documentation.
- [x] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4796
2026-04-26 10:56:54 +02:00
..
2024-11-05 14:36:43 +01:00
2025-02-28 16:10:16 -08:00