From e29dc521e28a8561f1e4fdf71fa4afd433d3076c Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jul 2024 21:19:33 -0400 Subject: [PATCH] update doc and add NEODB_SEARCH_PEERS config --- README.md | 8 +++++--- boofilsic/settings.py | 4 ++++ compose.yml | 1 + docs/configuration.md | 4 +++- docs/features.md | 6 ++++-- mastodon/models/bluesky.py | 2 +- takahe/utils.py | 2 ++ 7 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index da7f4b86..a1fcfb83 100644 --- a/README.md +++ b/README.md @@ -51,16 +51,18 @@ Follow us on [Fediverse](https://mastodon.social/@neodb) or join our [Discord co + view home feed with friends' activities * every activity can be set as viewable to self/follower-only/public * eligible items, e.g. podcasts and albums, are playable in feed - + login with other Fediverse server account and import social graph + + login with other Fediverse identity and import social graph * supported servers: Mastodon/Pleroma/Firefish/GoToSocial/Pixelfed/friendica/Takahē - + share collections and reviews to Fediverse ~~and Twitter~~ feed + + login with Bluesky / ATProto identity and import social graph + + login with threads.net (requires app verification by Meta) + + share collections and reviews to Fediverse/Bluesky/Threads - ActivityPub support + NeoDB users can follow and interact with users on other ActivityPub services like Mastodon and Pleroma + NeoDB instances communicate with each other via an extended version of ActivityPub + NeoDB instances may share public rating and reviews with a default relay + implementation is based on [Takahē](https://jointakahe.org/) server - Other - + i18n/language support is being worked on + + i18n: English, and Simp/Trad Chinese translation ## Host your own instance Please see [docs/install.md](docs/install.md) diff --git a/boofilsic/settings.py b/boofilsic/settings.py index e1feefd9..55e06750 100644 --- a/boofilsic/settings.py +++ b/boofilsic/settings.py @@ -85,6 +85,8 @@ env = environ.FileAwareEnv( NEODB_MIN_MARKS_FOR_DISCOVER=(int, 1), # Disable cron jobs, * for all NEODB_DISABLE_CRON_JOBS=(list, []), + # federated search peers + NEODB_SEARCH_PEERS=(list, []), # INTEGRATED TAKAHE CONFIGURATION TAKAHE_DB_URL=(str, "postgres://takahe:takahepass@127.0.0.1:5432/takahe"), # Spotify - https://developer.spotify.com/ @@ -268,6 +270,8 @@ DOWNLOADER_CACHE_TIMEOUT = env("NEODB_DOWNLOADER_CACHE_TIMEOUT") DOWNLOADER_RETRIES = env("NEODB_DOWNLOADER_RETRIES") DISABLE_CRON_JOBS = env("NEODB_DISABLE_CRON_JOBS") +SEARCH_PEERS = env("NEODB_SEARCH_PEERS") + FANOUT_LIMIT_DAYS = env("NEODB_FANOUT_LIMIT_DAYS") # ====== USER CONFIGUTRATION END ====== diff --git a/compose.yml b/compose.yml index 21752232..6d9966b5 100644 --- a/compose.yml +++ b/compose.yml @@ -32,6 +32,7 @@ x-shared: NEODB_MASTODON_CLIENT_SCOPE: NEODB_DISABLE_DEFAULT_RELAY: NEODB_DISABLE_CRON_JOBS: + NEODB_SEARCH_PEERS: NEODB_MIN_MARKS_FOR_DISCOVER: NEODB_SENTRY_DSN: TAKAHE_SENTRY_DSN: diff --git a/docs/configuration.md b/docs/configuration.md index 0e1da012..833fd8e4 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -40,7 +40,9 @@ if you are doing debug or development: ## Settings for Federation - - `DISABLE_DEFAULT_RELAY` is set to `False` by default, the server will send and receive public posts from `relay.neodb.net`. + - `NEODB_SEARCH_PEERS` is empty by default, which means NeoDB will search all known peers running production version of NeoDB when user look for items. This can be set to a comma-separated list of host names, so that NeoDB will only search those servers; or search no other peers if set to just `-`. + + - `NEODB_DISABLE_DEFAULT_RELAY` is set to `False` by default, the server will send and receive public posts from `relay.neodb.net`. `relay.neodb.net` is [open sourced](https://github.com/neodb-social/neodb-relay) and operated by NeoDB developers, it works like most ActivityPub relays except it only relays between NeoDB instances, it helps public information like catalogs and trends flow between NeoDB instances. You may set it to `True` if you don't want to relay public posts with other NeoDB instances. diff --git a/docs/features.md b/docs/features.md index 9d2b15cf..3d87b1c6 100644 --- a/docs/features.md +++ b/docs/features.md @@ -42,9 +42,11 @@ NeoDB has [various features](features.md), and you may image it as a mix of Mast - view home feed with friends' activities - every activity can be set as viewable to self/follower-only/public - eligible items, e.g. podcasts and albums, are playable in feed - - login with other Fediverse server account and import social graph + - login with other Fediverse identity and import social graph - supported servers: Mastodon/Pleroma/Firefish/GoToSocial/Pixelfed/friendica/Takahē - - share collections and reviews to Fediverse ~~and Twitter~~ feed + - login with Bluesky / ATProto identity and import social graph + - login with threads.net (requires app verification by Meta) + - share collections and reviews to Fediverse/Bluesky/Threads - ActivityPub support - NeoDB users can follow and interact with users on other ActivityPub services like Mastodon and Pleroma - NeoDB instances communicate with each other via an extended version of ActivityPub diff --git a/mastodon/models/bluesky.py b/mastodon/models/bluesky.py index 8d7b4302..713a9938 100644 --- a/mastodon/models/bluesky.py +++ b/mastodon/models/bluesky.py @@ -159,7 +159,7 @@ class BlueskyAccount(SocialAccount): return False if self.handle != profile.handle: logger.warning( - "ATProto refresh: handle mismatch {self.handle} from did doc -> {profile.handle} from PDS" + f"ATProto refresh: handle mismatch {self.handle} from did doc -> {profile.handle} from PDS" ) self.account_data = { k: v for k, v in profile.__dict__.items() if isinstance(v, (int, str)) diff --git a/takahe/utils.py b/takahe/utils.py index ece1f8c1..28245720 100644 --- a/takahe/utils.py +++ b/takahe/utils.py @@ -763,6 +763,8 @@ class Takahe: @staticmethod def get_neodb_peers(): + if settings.SEARCH_PEERS: # '-' = disable federated search + return [] if settings.SEARCH_PEERS == ["-"] else settings.SEARCH_PEERS cache_key = "neodb_peers" peers = cache.get(cache_key, None) if peers is None: