update readme, deprecation warning on relay.manage, and existing inboxes don't prevent following

This commit is contained in:
Izalia Mae 2022-04-09 03:36:40 -04:00
parent 0d77614bdb
commit d9fbb8ddd4
2 changed files with 9 additions and 17 deletions

View file

@ -17,14 +17,15 @@ It simply will not run on older Python versions.
Download the project and install with pip (`pip3 install .`). Download the project and install with pip (`pip3 install .`).
Copy `relay.yaml.example` to `relay.yaml` and edit it as appropriate: Run `activityrelay setup` and answer the prompts or copy `relay.yaml.example` to `relay.yaml`
and edit it as appropriate:
$ cp relay.yaml.example relay.yaml $ cp relay.yaml.example relay.yaml
$ $EDITOR relay.yaml $ $EDITOR relay.yaml
Finally, you can launch the relay: Finally, you can launch the relay:
$ python3 -m relay $ activityrelay run
It is suggested to run this under some sort of supervisor, such as runit, daemontools, It is suggested to run this under some sort of supervisor, such as runit, daemontools,
s6 or systemd. Configuration of the supervisor is not covered here, as it is different s6 or systemd. Configuration of the supervisor is not covered here, as it is different
@ -44,11 +45,6 @@ found on the relay. In Pleroma this would be something like:
$ MIX_ENV=prod mix relay_follow https://your.relay.hostname/actor $ MIX_ENV=prod mix relay_follow https://your.relay.hostname/actor
Mastodon uses an entirely different relay protocol but supports LitePub relay protocol
as well when the Mastodon relay handshake is used. In these cases, Mastodon relay
clients should follow `http://your.relay.hostname/inbox` as they would with Mastodon's
own relay software.
## Performance ## Performance
@ -60,12 +56,11 @@ superior to, the Mastodon relay software, with improved memory efficiency.
## Management ## Management
You can perform a few management tasks such as peering or depeering other relays by You can perform a few management tasks such as peering or depeering other relays.
invoking the `relay.manage` module.
This will show the available management tasks: This will show the available management tasks:
$ python3 -m relay.manage $ activityrelay --help
When following remote relays, you should use the `/actor` endpoint as you would in When following remote relays, you should use the `/actor` endpoint as you would in
Pleroma and other LitePub-compliant software. Pleroma and other LitePub-compliant software.

View file

@ -284,21 +284,14 @@ def relay_run():
async def handle_follow_actor(app, target): async def handle_follow_actor(app, target):
database = app['database']
config = app['config'] config = app['config']
if not target.startswith('http'): if not target.startswith('http'):
target = f'https://{target}/actor' target = f'https://{target}/actor'
if database.get_inbox(target):
return click.echo(f'Error: Already following actor: {target}')
if config.is_banned(target): if config.is_banned(target):
return click.echo(f'Error: Refusing to follow banned actor: {target}') return click.echo(f'Error: Refusing to follow banned actor: {target}')
if config.whitelist_enabled and not config.is_whitelisted(target):
return click.echo(f'Error: Refusing to follow non-whitelisted actor: {target}')
await misc.follow_remote_actor(target) await misc.follow_remote_actor(target)
click.echo(f'Sent follow message to: {target}') click.echo(f'Sent follow message to: {target}')
@ -329,3 +322,7 @@ async def handle_start_webserver():
def main(): def main():
cli(prog_name='relay') cli(prog_name='relay')
if __name__ == '__main__':
click.echo('Running relay.manage is depreciated. Run `activityrelay [command]` instead.')