From d9fbb8ddd4b6a9d2aef9e8620324cd72a231cab2 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Sat, 9 Apr 2022 03:36:40 -0400 Subject: [PATCH] update readme, deprecation warning on relay.manage, and existing inboxes don't prevent following --- README.md | 15 +++++---------- relay/manage.py | 11 ++++------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index da3fcfd..8264009 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,15 @@ It simply will not run on older Python versions. 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 $ $EDITOR relay.yaml 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, 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 -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 @@ -60,12 +56,11 @@ superior to, the Mastodon relay software, with improved memory efficiency. ## Management -You can perform a few management tasks such as peering or depeering other relays by -invoking the `relay.manage` module. +You can perform a few management tasks such as peering or depeering other relays. 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 Pleroma and other LitePub-compliant software. diff --git a/relay/manage.py b/relay/manage.py index 44bca8e..7cdcb02 100644 --- a/relay/manage.py +++ b/relay/manage.py @@ -284,21 +284,14 @@ def relay_run(): async def handle_follow_actor(app, target): - database = app['database'] config = app['config'] if not target.startswith('http'): target = f'https://{target}/actor' - if database.get_inbox(target): - return click.echo(f'Error: Already following actor: {target}') - if config.is_banned(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) click.echo(f'Sent follow message to: {target}') @@ -329,3 +322,7 @@ async def handle_start_webserver(): def main(): cli(prog_name='relay') + + +if __name__ == '__main__': + click.echo('Running relay.manage is depreciated. Run `activityrelay [command]` instead.')