Repository navigation
Add, list and remove Torznab indexers with torrential indexers - #120
Merged
Merged
Conversation
…hange at once An indexer in config.yaml can now hold its key as api_key, beside api_key_env; both is a config error that names the line. The login service passes only TORRENTIAL_HOME, so an api_key_env indexer stopped a service engine from starting, and that error now says to write the key as api_key. Any write that leaves a key in config.yaml makes the file readable by its owner alone, and the key prints as redacted wherever it could reach a log. Three new requests (wire version 12) let a paired device or this machine's torrential manage the indexers of the engine it drives. Adding asks the address for t=caps first and refuses with a plain reason; a Prowlarr or Jackett server's own address adds each of its indexers. The engine writes config.yaml keeping every other line and the comments of entries that stay, then swaps the search's source list without a restart. Tests cover the key rules, the line-keeping edits, the file mode, caps parsing against Jackett's and Prowlarr's real answers, a reconfigured search, and a 401 for a stranger, a token no device holds, this machine's token from another machine, and a removed device, each leaving config.yaml unchanged.
…e it drives `torrential indexers add <address> --key <key>` takes a Torznab feed or Prowlarr's or Jackett's own address, `torrential indexers` shows whether each answers and its categories, and `torrential indexers remove <name>` takes one out. Each takes --json, and through torrential connect each acts on the server's engine. End-to-end tests run a stand-in Torznab indexer and a stand-in Prowlarr: refusals for a missing key, a wrong key, a 404, a web page and a closed port, a search that uses a new indexer with no restart, a Prowlarr import of only its enabled torrent indexers, and no key in any output or log. The remote test adds an indexer from a paired laptop and finds it in the server's config.yaml. The README gets a short "Private and local trackers" section, and the agent skill one line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
torrential can now search private and local trackers without hand-editing YAML or exporting environment variables. A person runs Prowlarr or Jackett, adds the tracker there, and runs
torrential indexers add <address> --key <key>.What changes for the person:
sources.torznabentries takeapi_key:besideapi_key_env:. One or the other; both is a config error that names the line. The login service passes onlyTORRENTIAL_HOME, so before this a keyed indexer stopped a service engine from starting. The error for an unsetapi_key_envnow says to write the key asapi_key.torrential setupon a file someone keyed by hand. The key never appears inDebugoutput, logs, errors, the list, or--json. A key pasted into the address (?apikey=) moves out of the URL.torrential indexers add <url> [--name] [--key]asks the address fort=capsfirst and refuses with a plain reason: it needs a key, it refused the key (HTTP 401/403 or Torznab error 100 to 199), it answered HTTP 404 or a web page, or it cannot be reached. On success the engine writes the entry and searches it at once, with no restart. Running it again with a new key updates the entry instead of adding a second./api/v1/indexeras{prowlarr}/{id}/api, and each configured Jackett indexer fromt=indexersas its own feed. Prowlarr is recognized byappNamein/api/v1/system/status, so no flag is needed.torrential indexerslists each entry, whether it answers now, where its key comes from, and its top-level categories.torrential indexers remove <name>takes one out, and out ofsources.disabled. All three take--json.torrential connectusers manage the server's indexers. A paired device may; a stranger, a token no device holds, this machine's own token sent from another machine, and a removed device each get 401, and the test checks config.yaml is untouched after each.How it was proved:
-D warningsand rustfmt pass, and so do the core, search, daemon (config, indexers, device refusals), binary unit, golden, CLI search, CLI indexers and remote tests.indexers add http://127.0.0.1:9117 --key …importedthepiratebayandnyaasi, andindexers add http://127.0.0.1:9696 --key …importedthe-pirate-bayandnyaa.si. The service kept the same PID throughout, and config.yaml became mode 600 with the owner's comments andplayer:line intact.titles sintel,sources tt1727587andplay tt1727587 --jsonall found Sintel (2010) through The Pirate Bay via Jackett. The stream URL served a Matroska header (1a45dfa3), andrmremoved the play.Windows: the change adds no platform code, and the owner-only write uses the existing
write_private, so the Windows CI job is the check. A Windows machine has not runindexersby hand.🤖 Generated with Claude Code