2022-05-06 07:04:51 +00:00
|
|
|
# Commands
|
|
|
|
|
|
|
|
There are a number of commands to manage your relay's database and config. You can add `--help` to
|
|
|
|
any category or command to get help on that specific option (ex. `activityrelay inbox --help`).
|
|
|
|
|
2024-01-24 05:48:15 +00:00
|
|
|
Note: `activityrelay` is only available via pip or pipx if `~/.local/bin` is in `$PATH`. If not,
|
|
|
|
use `python3 -m relay` if installed via pip or `~/.local/bin/activityrelay` if installed via pipx.
|
2022-05-06 21:23:44 +00:00
|
|
|
|
2022-05-06 07:04:51 +00:00
|
|
|
|
|
|
|
## Run
|
|
|
|
|
2024-02-22 16:54:09 +00:00
|
|
|
Run the relay.
|
2022-05-06 07:04:51 +00:00
|
|
|
|
|
|
|
activityrelay run
|
|
|
|
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
Run the setup wizard to configure your relay.
|
|
|
|
|
|
|
|
activityrelay setup
|
|
|
|
|
|
|
|
|
2024-01-24 05:48:15 +00:00
|
|
|
## Convert
|
|
|
|
|
|
|
|
Convert the old config and jsonld to the new config and SQL backend. If the old config filename is
|
|
|
|
not specified, the config will get backed up as `relay.backup.yaml` before converting.
|
|
|
|
|
|
|
|
activityrelay convert --old-config relaycfg.yaml
|
|
|
|
|
|
|
|
|
|
|
|
## Edit Config
|
|
|
|
|
|
|
|
Open the config file in a text editor. If an editor is not specified with `--editor`, the default
|
|
|
|
editor will be used.
|
|
|
|
|
|
|
|
activityrelay edit-config --editor micro
|
|
|
|
|
|
|
|
|
2022-11-27 01:53:06 +00:00
|
|
|
## Config
|
|
|
|
|
2022-12-04 06:12:58 +00:00
|
|
|
Manage the relay config
|
2022-11-27 01:53:06 +00:00
|
|
|
|
|
|
|
activityrelay config
|
|
|
|
|
|
|
|
|
2022-12-04 06:12:58 +00:00
|
|
|
### List
|
|
|
|
|
|
|
|
List the current config key/value pairs
|
|
|
|
|
|
|
|
activityrelay config list
|
|
|
|
|
|
|
|
|
2022-11-27 01:53:06 +00:00
|
|
|
### Set
|
|
|
|
|
|
|
|
Set a value for a config option
|
|
|
|
|
|
|
|
activityrelay config set <key> <value>
|
|
|
|
|
|
|
|
|
2024-02-18 13:02:43 +00:00
|
|
|
## User
|
|
|
|
|
|
|
|
### List
|
|
|
|
|
|
|
|
List all available users.
|
|
|
|
|
|
|
|
activityrelay user list
|
|
|
|
|
|
|
|
|
|
|
|
### Create
|
|
|
|
|
|
|
|
Create a new user. You will be prompted for the new password.
|
|
|
|
|
|
|
|
activityrelay user create <username> [associated ActivityPub handle]
|
|
|
|
|
|
|
|
|
|
|
|
### Delete
|
|
|
|
|
|
|
|
Delete a user.
|
|
|
|
|
|
|
|
activityrelay user delete <username>
|
|
|
|
|
|
|
|
|
|
|
|
### List Tokens
|
|
|
|
|
|
|
|
List all API tokens for a user.
|
|
|
|
|
|
|
|
activityrelay user list-tokens <username>
|
|
|
|
|
|
|
|
|
|
|
|
### Create Token
|
|
|
|
|
|
|
|
Generate a new API token for a user.
|
|
|
|
|
|
|
|
activityrelay user create-token <username>
|
|
|
|
|
|
|
|
|
|
|
|
### Delete Token
|
|
|
|
|
|
|
|
Delete an API token.
|
|
|
|
|
|
|
|
activityrelay user delete-token <code>
|
|
|
|
|
|
|
|
|
2022-05-06 07:04:51 +00:00
|
|
|
## Inbox
|
|
|
|
|
|
|
|
Manage the list of subscribed instances.
|
|
|
|
|
|
|
|
|
|
|
|
### List
|
|
|
|
|
|
|
|
List the currently subscribed instances or relays.
|
|
|
|
|
|
|
|
activityrelay inbox list
|
|
|
|
|
|
|
|
|
|
|
|
### Add
|
|
|
|
|
|
|
|
Add an inbox to the database. If a domain is specified, it will default to `https://{domain}/inbox`.
|
|
|
|
If the added instance is not following the relay, expect errors when pushing messages.
|
|
|
|
|
2024-02-18 13:02:43 +00:00
|
|
|
activityrelay inbox add <inbox or domain> --actor <actor url> --followid <follow activity ID> --software <nodeinfo software name>
|
2022-05-06 07:04:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Remove
|
|
|
|
|
|
|
|
Remove an inbox from the database. An inbox or domain can be specified.
|
|
|
|
|
|
|
|
activityrelay inbox remove <inbox or domain>
|
|
|
|
|
|
|
|
|
|
|
|
### Follow
|
|
|
|
|
|
|
|
Follow an instance or relay actor and add it to the database. If a domain is specified, it will
|
|
|
|
default to `https://{domain}/actor`.
|
|
|
|
|
|
|
|
activityrelay inbox follow <actor or domain>
|
|
|
|
|
|
|
|
Note: The relay must be running for this command to work.
|
|
|
|
|
|
|
|
|
|
|
|
### Unfollow
|
|
|
|
|
|
|
|
Unfollow an instance or relay actor and remove it from the database. If the instance or relay does
|
|
|
|
not exist anymore, use the `inbox remove` command instead.
|
|
|
|
|
|
|
|
activityrelay inbox unfollow <domain, actor, or inbox>
|
|
|
|
|
|
|
|
Note: The relay must be running for this command to work.
|
|
|
|
|
|
|
|
|
|
|
|
## Whitelist
|
|
|
|
|
|
|
|
Manage the whitelisted domains.
|
|
|
|
|
|
|
|
|
|
|
|
### List
|
|
|
|
|
|
|
|
List the current whitelist.
|
|
|
|
|
|
|
|
activityrelay whitelist list
|
|
|
|
|
|
|
|
|
|
|
|
### Add
|
|
|
|
|
|
|
|
Add a domain to the whitelist.
|
|
|
|
|
|
|
|
activityrelay whitelist add <domain>
|
|
|
|
|
|
|
|
|
|
|
|
### Remove
|
|
|
|
|
|
|
|
Remove a domain from the whitelist.
|
|
|
|
|
|
|
|
activityrelay whitelist remove <domain>
|
|
|
|
|
|
|
|
|
2022-12-04 06:12:58 +00:00
|
|
|
### Import
|
|
|
|
|
2024-01-24 05:48:15 +00:00
|
|
|
Add all current inboxes to the whitelist.
|
2022-12-04 06:12:58 +00:00
|
|
|
|
|
|
|
activityrelay whitelist import
|
|
|
|
|
|
|
|
|
2022-05-06 07:04:51 +00:00
|
|
|
## Instance
|
|
|
|
|
|
|
|
Manage the instance ban list.
|
|
|
|
|
|
|
|
|
|
|
|
### List
|
|
|
|
|
2024-01-24 05:48:15 +00:00
|
|
|
List the currently banned instances.
|
2022-05-06 07:04:51 +00:00
|
|
|
|
|
|
|
activityrelay instance list
|
|
|
|
|
|
|
|
|
|
|
|
### Ban
|
|
|
|
|
2024-01-24 05:48:15 +00:00
|
|
|
Add an instance to the ban list. If the instance is currently subscribed, it will be removed from
|
|
|
|
the inbox list.
|
2022-05-06 07:04:51 +00:00
|
|
|
|
2024-02-18 13:02:43 +00:00
|
|
|
activityrelay instance ban <domain> --reason <text> --note <text>
|
2022-05-06 07:04:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Unban
|
|
|
|
|
|
|
|
Remove an instance from the ban list.
|
|
|
|
|
|
|
|
activityrelay instance unban <domain>
|
|
|
|
|
|
|
|
|
2024-01-24 05:48:15 +00:00
|
|
|
### Update
|
|
|
|
|
2024-02-18 13:02:43 +00:00
|
|
|
Update the ban reason or note for an instance ban. Either `--reason` and/or `--note` must be
|
|
|
|
specified.
|
2024-01-24 05:48:15 +00:00
|
|
|
|
2024-02-18 13:02:43 +00:00
|
|
|
activityrelay instance update bad.example.com --reason <text> --note <text>
|
2024-01-24 05:48:15 +00:00
|
|
|
|
|
|
|
|
2022-05-06 07:04:51 +00:00
|
|
|
## Software
|
|
|
|
|
|
|
|
Manage the software ban list. To get the correct name, check the software's nodeinfo endpoint.
|
2024-01-24 05:48:15 +00:00
|
|
|
You can find it at `nodeinfo['software']['name']`.
|
2022-05-06 07:04:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
### List
|
|
|
|
|
|
|
|
List the currently banned software.
|
|
|
|
|
|
|
|
activityrelay software list
|
|
|
|
|
|
|
|
|
|
|
|
### Ban
|
|
|
|
|
|
|
|
Add a software name to the ban list.
|
|
|
|
|
|
|
|
If `-f` or `--fetch-nodeinfo` is set, treat the name as a domain and try to fetch the software
|
|
|
|
name via nodeinfo.
|
|
|
|
|
|
|
|
If the name is `RELAYS` (case-sensitive), add all known relay software names to the list.
|
|
|
|
|
2024-02-18 13:02:43 +00:00
|
|
|
activityrelay software ban [-f/--fetch-nodeinfo] <name, domain, or RELAYS> --reason <text> --note <text>
|
2022-05-06 07:04:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Unban
|
|
|
|
|
|
|
|
Remove a software name from the ban list.
|
|
|
|
|
|
|
|
If `-f` or `--fetch-nodeinfo` is set, treat the name as a domain and try to fetch the software
|
|
|
|
name via nodeinfo.
|
|
|
|
|
|
|
|
If the name is `RELAYS` (case-sensitive), remove all known relay software names from the list.
|
|
|
|
|
2024-01-24 05:48:15 +00:00
|
|
|
activityrelay software unban [-f/--fetch-nodeinfo] <name, domain, or RELAYS>
|
|
|
|
|
|
|
|
|
|
|
|
### Update
|
|
|
|
|
|
|
|
Update the ban reason or note for a software ban. Either `--reason` and/or `--note` must be
|
|
|
|
specified.
|
|
|
|
|
2024-02-18 13:02:43 +00:00
|
|
|
activityrelay software update relay.example.com --reason <text> --note <text>
|