Skip to content

Add community.alldebrid-resolver 1.2.0 - #10

Merged
agalwood merged 3 commits into
motrixapp:mainfrom
DonTarken:add-alldebrid-resolver
Nov 11, 2026
Merged

agalwood merged 3 commits into
motrixapp:mainfrom
DonTarken:add-alldebrid-resolver

Conversation

@DonTarken

@DonTarken DonTarken commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Adds AllDebrid Resolver, a community site-resolver plugin that automatically unlocks supported file-host download links (1fichier, Rapidgator, etc.) via the official AllDebrid API and feeds high-speed direct links to Aria2.

  • Repository: https://github.com/DonTarken/motrix-plugin-alldebrid
  • Release: https://github.com/DonTarken/motrix-plugin-alldebrid/releases/tag/v1.2.0
  • Package asset: community.alldebrid-resolver-1.2.0.moext (6850 bytes)
  • Package SHA-256: 14ef0fe353c8d8e18cfff12a46bcc659c9efa9ef2a109a3f6687db1fb1c14a4a
  • Permissions requested:
    • http: Communicates with https://api.alldebrid.com/v4 to verify account status and unlock links.
    • notify: Displays desktop notifications on link unlock and account status.
    • storage: Persists plugin configuration locally.
    • hostPermissions: ["*://*/*"]: Required by Motrix to intercept input download URLs in beforeCreate hook.
  • Tested & Verified:
    • 15 automated unit tests covering all host validation, strict authority parsing, fail-closed security, Bearer authentication, and error handling edge cases.
    • Tested live in Motrix 2.x on Windows with active AllDebrid subscription and verified real-world downloads.

@agalwood

Copy link
Copy Markdown
Member

I found a few issues that should be addressed before adding this plugin to the registry.

  1. Fail closed when the supported-host list is unavailable. isSupportedHost() returns true when the domain set is missing or empty. If the /hosts request fails or returns an empty list, an unrelated download URL may be sent to /link/unlock, including a private or signed URL.

    Return false when no validated host list is available, leave the download unchanged, and retain a previously validated cache if a refresh fails. Add tests for timeouts, non-200 responses, invalid JSON, empty lists, and failed refreshes. Verify that unsupported URLs are never sent to /link/unlock.

  2. Keep credentials and full URLs out of diagnostics. Authenticated requests currently put the API key in the query string. Consider using the Authorization: Bearer header documented by AllDebrid. The plugin also passes complete original and resolved URLs to the logger, which may contain access tokens.

    Log only the information needed for diagnosis, such as the hostname and error code, and sanitize exception messages. Add tests using token-bearing URLs and request errors, and verify that secrets do not appear in logs or notifications.

  3. Match exclusions against the parsed hostname. shouldSkip() searches the entire URL for strings such as localhost and alldebrid.com. A URL may therefore be skipped because one of those strings appears in its path or query.

    Parse HTTP(S) URLs using a parser available in the plugin runtime, and compare hostnames using exact or dot-boundary suffix matching. Add tests for matching strings in paths and queries, lookalike domains, credentials, ports, and IPv6.

After the fixes, please publish a new plugin version and update the package URL, SHA-256, and size in this PR.

@DonTarken DonTarken changed the title Add community.alldebrid-resolver 1.1.0 Add community.alldebrid-resolver 1.2.0 Nov 10, 2026
@DonTarken

Copy link
Copy Markdown
Contributor Author

Hi @agalwood,

Thank you for the detailed and constructive code review!

I have implemented all the requested changes in release v1.2.0:

  1. Fail-closed host validation & cache resilience:

    • isSupportedHost() strictly fails closed (returns false) if no validated host list is available or empty, ensuring unsupported URLs are never sent to /link/unlock and leaving downloads unchanged.
    • The plugin retains the previously validated cache when a background refresh fails (network error, timeout, or non-200).
    • Added automated tests for network timeouts, non-200 responses, invalid JSON, empty lists, and verifying downloads are left untouched for unsupported links.
  2. Bearer authentication & sanitized diagnostics:

    • Authenticated requests to the AllDebrid API now use the standard Authorization: Bearer <apiKey> header instead of putting the key in the query string.
    • Diagnostic logs now only log sanitized hostnames and error codes; full URLs and query tokens are completely excluded from logs and notifications.
  3. Strict hostname parsing (shouldSkip):

    • Replaced substring .includes() matching with strict authority extraction and hostname comparison.
    • Hostname comparisons use exact and dot-boundary suffix matching. It handles IPv6 bracketed hosts, port stripping, and user credentials in URLs.
    • Added unit test coverage for path/query false positives, credentials, ports, IPv6, and lookalike domains.
  4. Release & Registry manifest:

    • Packaged and published release v1.2.0.
    • Updated the package URL, SHA-256, and size in this PR.

All 15 automated unit test suites pass cleanly. Ready for your review!

@agalwood
agalwood merged commit 2bdc3d8 into motrixapp:main Nov 11, 2026
1 check passed
@DonTarken
DonTarken deleted the add-alldebrid-resolver branch November 11, 2026 15:42
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.

2 participants