Add Rucio as a client. Closes #59#60
Open
ogarcia wants to merge 3 commits into
Open
Conversation
…ories) Add Rucio (github.com/ogarcia/rucio) as a new client type — a P2P daemon with a native libp2p network plus eMule/Kad2 compatibility, exposing a JSON REST API. Five touch points, following the existing client contract: - server/lib/rucio/RucioClient.js: fetch wrapper over the daemon API (no auth needed; optional HTTP Basic + base path for reverse proxies). - server/modules/rucioManager.js: BaseClientManager subclass. Downloads are addressed by a signed integer id (negative = eMule), so the manager keeps a hash->id map rebuilt each fetchData and translates the hash-based control methods into id-based REST calls. - server/lib/clientMeta.js: capability block. Modelled under the 'ed2k' networkType because Rucio's profile matches aMule (search + shared files + categories, no trackers, single-file), so the unified pipeline and the search instance selector light up with no frontend branching. - server/lib/downloadNormalizer.js: normalizers feeding the ed2k branch. - ClientRegistry/server.js + config.js wiring (RUCIO_* env vars). Frontend: - A Rucio icon (ClientIcon + logo-rucio.svg) and a CLIENT_NAMES label. - A dedicated "Rucio" search source button alongside ED2K Server / Kad / Prowlarr. The search widget now gates each source on the actual client TYPE connected (not just networkType), so the aMule ED2K/Kad buttons are not falsely enabled by a Rucio-only setup, and targets the matching instance type for the chosen source. - The footer renders Rucio as its own status badge from a flat getNetworkStatus, and the ED2K/KAD headers are gated on an actual aMule instance being present, so a Rucio-only setup shows no phantom ED2K/KAD. - The download state map accepts both snake_case and PascalCase, so the integration works against any daemon version. Unified search spans Rucio's own network and eMule/Kad in one query. v1 is poll-based; the daemon's WebSocket push is left for a later iteration.
Until now Rucio reused the 'ed2k' networkType so the integration could land without touching the dashboard. That conflated it with aMule: shared chart series, shared filter toggle, shared stats and footer grouping, all labelled "aMule". This makes Rucio a first-class network everywhere. Backend (no DB migration — instance_metrics is type-agnostic and the metrics API buckets per networkType dynamically): - clientMeta: Rucio networkType 'ed2k' -> 'rucio'. - unifiedItemBuilder: apply the source-based shape (sources, category id + name, ed2k-style link, no trackers, single-file) to any non-BitTorrent network, so ed2k and rucio share it. Frontend — generalize the hardcoded two-network (ed2k/bittorrent) UI to N networks so Rucio gets its own series/toggle/column: - constants: NETWORK_NAMES + NETWORK_ORDER (ed2k=aMule, rucio=Rucio, bittorrent=BitTorrent). - ClientFilterContext: generic isNetworkTypeEnabled() + rucioConnected / isRucioEnabled; the "don't disable everything" safety no longer assumes two types. - useClientChartConfig: returns a `networks` list (connected+enabled, ordered) that the views map over; old booleans kept for back-compat. - HomeView / StatisticsView: one speed/transfer chart per network. - StatsWidget: per-network breakdown over N networks. - MobileSpeedWidget: network selector built per connected network. - Header: network filter toggles + per-instance chips built dynamically per connected network (Rucio instances were previously dropped from the groups). - Footer: speed totals gated by isNetworkTypeEnabled (generic).
Owner
|
Hi @ogarcia, thanks for the contribution! I will review it as soon as possible. |
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.
This adds Rucio as a new client type. Rucio is a P2P file-sharing daemon — a native libp2p network (BLAKE3 / verified streaming) plus eMule/Kad2 compatibility — exposing a clean JSON REST API.
The PR is split into two commits so each concern is reviewable on its own:
1.
Rucio: add client integrationA self-contained, working client integration following the existing five touch points:
server/lib/rucio/RucioClient.js— afetchwrapper over the daemon API. Rucio has no built-in auth (it delegates to a reverse proxy), so connecting needs just a base URL; optional HTTP Basic credentials and a base path are supported for proxied / sub-path setups.server/modules/rucioManager.js—BaseClientManagersubclass. Downloads are addressed by a signed integer id (negative = eMule), so the manager keeps ahash → idmap (rebuilt eachfetchData) and translates the hash-based control methods into id-based REST calls. StampsinstanceIdon every item so batch operations resolve the manager.server/lib/clientMeta.js+downloadNormalizer.js— capability block and normalizers.ClientRegistry/server.js+config.jswiring (RUCIO_*env vars).configTester+ the test endpoint), so the Test button works in both the wizard and the settings modal.Capabilities:
search,sharedFiles,categories,renameFile,cancelDeletesFiles,removeSharedMustDeleteFiles: false(Rucio can un-share via the API without deleting the file). No trackers, single-file.2.
Rucio: give it its own network typePromotes Rucio from reusing the
ed2knetworkType to its ownrucionetworkType, so it's a first-class entity everywhere instead of being lumped in with aMule. No DB migration is needed (the metrics table is type-agnostic and the metrics API buckets per networkType dynamically). The hardcoded two-network (ed2k/bittorrent) dashboard is generalised to N networks:useClientChartConfigreturns anetworkslist; HomeView / StatisticsView / MobileSpeedWidget render one chart per connected network.ClientFilterContextexposes a genericisNetworkTypeEnabled(); the Header filter toggles + per-instance chips and the Footer status/speed totals are built per connected network.StatsWidgetshows a per-network breakdown.unifiedItemBuilderapplies the source-based shape to any non-BitTorrent network, so ed2k and rucio share it.Configuring an instance
Settings → Download Clients → Add → Rucio, or the first-run wizard, or env:
RUCIO_ENABLED=true
RUCIO_HOST=localhost
RUCIO_PORT=3003
optional: RUCIO_USE_SSL, RUCIO_BASE_PATH, RUCIO_USERNAME, RUCIO_PASSWORD
Testing
Verified end-to-end against a live Rucio daemon (0.32.0): connect; unified search returns real results; add (rucio: and ed2k:); pause / resume / cancel / delete; category assign + create/edit with colour + dir; the connection test; the per-network charts / filter toggles / stats / footer; the Add-Client modal and the first-run wizard with a Rucio-only setup.