Skip to content

feat(indexers): auto-rotate domain-rotating indexers to a working mirror#707

Open
shuff57 wants to merge 2 commits into
Listenarrs:canaryfrom
shuff57:feature/indexer-domain-rotation
Open

feat(indexers): auto-rotate domain-rotating indexers to a working mirror#707
shuff57 wants to merge 2 commits into
Listenarrs:canaryfrom
shuff57:feature/indexer-domain-rotation

Conversation

@shuff57

@shuff57 shuff57 commented Jun 27, 2026

Copy link
Copy Markdown

Background service that keeps domain-rotating indexers (Anna's Archive, AudioBookBay) reachable by switching to a working mirror when the current domain goes down.

  • IndexerDomainRotationService: tests the current host; if unreachable, iterates candidate mirrors and persists the first working one.
  • Candidates = current host + built-in seed list per indexer type + optional user overrides (IndexerMirrorOverridesJson).
  • HttpDomainReachabilityChecker: short-timeout GET; any HTTP response (incl. Cloudflare 403) = reachable; DNS/connection failure = unreachable.
  • Hosted service runs on startup + every 6h. Settings toggle EnableIndexerDomainRotation (default true, incl. existing installs via migration default). 8 backend unit tests with a mockable reachability checker.

🤖 Generated with Claude Code

shuff57 and others added 2 commits June 27, 2026 12:39
Background service checks domain-rotating indexers (Anna's Archive,
AudioBookBay) every 6h and switches to the first reachable mirror when
the current domain is unreachable. Rotation is opt-out via settings.

- IndexerMirrorCatalog: static seed map keyed by Implementation string
- IDomainReachabilityChecker / HttpDomainReachabilityChecker: probe
  with 8s timeout; any HTTP response (incl. 403 Cloudflare) = reachable
- IIndexerDomainRotationService / IndexerDomainRotationService:
  test current → iterate candidates (current+seeds+user overrides,
  deduped) → persist first working host via IIndexerRepository
- IndexerDomainRotationBackgroundService + Processor: 2m init delay,
  6h interval, scoped-service resolution per cycle
- ApplicationSettings: EnableIndexerDomainRotation (default true),
  IndexerMirrorOverridesJson (optional per-type extras)
- Migration: AddIndexerDomainRotationSettings
- FE: EnableIndexerDomainRotation CheckboxCard in Search Settings
- Tests: 8 unit tests covering all rotation/no-op scenarios

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ng installs

The C# property defaults to true, but the migration added the column with
defaultValue:false, so existing settings rows had rotation off. Match the
intended default so it's on by default everywhere.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shuff57 shuff57 requested a review from a team June 27, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant