8000 Support running sv2-ui against an externally managed mining stack (no Docker orchestration) · Issue #427 · stratum-mining/sv2-ui · GitHub
[go: up one dir, main page]

Skip to content

Support running sv2-ui against an externally managed mining stack (no Docker orchestration) #427

In review

Description

@pavlenex

Problem

sv2-ui currently couples its monitoring dashboard to owning and orchestrating the mining stack through a Docker daemon. Specifically, it assumes it:

Connects to a Docker socket to create, start, stop, restart, and remove the sv2-translator and sv2-jdc containers and manage a sv2-network.
Generates and owns the Translator and JDC configuration files via the setup wizard and Settings page.
Uses container state as service health and reads container logs through the Docker API for diagnostics, log viewing/export, and active-pool detection.
Reaches the Translator and JDC monitoring APIs at hardcoded Docker DNS names in production (http://sv2-translator:9092 and http://sv2-jdc:9091).
Relies on first-visit interactive password creation when no admin credential exists yet.

Self-hosting platforms and process supervisors (such as StartOS, Umbrel, Docker Compose, systemd, Kubernetes, and NixOS) already manage process lifecycles, networking, configuration, health checks, and logs. translator_sv2 and jd_client_sv2 in sv2-apps already run cleanly as standalone supervised services with configurable monitoring endpoints, so the bottleneck is in sv2-ui:

Platforms that intentionally isolate services without granting Docker daemon or privileged host access (such as StartOS, which already ships Translator and JDC) cannot package sv2-ui at all.
Platforms that do allow it (such as Umbrel) have to ship a privileged Docker-in-Docker sidecar on the host network namespace with custom firewall rules, extra_hosts workarounds, and lifecycle hooks just to run the dashboard alongside a Bitcoin node.
Operators running Translator and JDC natively (e.g. under systemd or standard Docker Compose) cannot use sv2-ui as a standalone dashboard.

Expected Outcome

An operator or packaging platform must be able to run sv2-ui solely as a web dashboard against an already-running, externally managed Translator (and optionally JDC) stack, with the following observable guarantees:

Configurable monitoring endpoints

sv2-ui can be pointed at operator-configured Translator and optional JDC monitoring API endpoints instead of hardcoded Docker DNS hostnames.
When no JDC endpoint is configured, sv2-ui operates in non-JD (Translator-only) mode and does not probe JDC. When a JDC endpoint is configured, sv2-ui operates in JD mode.
Invalid or malformed endpoint configuration is rejected clearly at startup.

Docker-free external-stack mode

sv2-ui starts, serves the dashboard, and shuts down cleanly without a Docker daemon or Docker socket present, and never attempts to inspect, start, stop, restart, or remove mining services (including on SIGINT/SIGTERM).
Service health and connection status shown in the UI and reported by backend health/status endpoints are derived from the configured monitoring APIs rather than Docker container state, and do not stall waiting for Docker-log-derived pool detection.
Stack lifecycle, setup wizard, configuration editing, reset, host/Bitcoin probing, and Docker log viewing/export are unavailable in this mode: the UI does not redirect to setup or present broken Docker/lifecycle/log controls, and the corresponding backend mutation and log endpoints reject requests cleanly.
Dashboard metrics (hashrate, workers, shares, best difficulty, blocks found, charts) and non-Docker features (such as appearance settings and Telegram monitoring alerts) continue to work accurately without emitting misleading Docker-orchestration messages (for example, reporting that mining stopped when sv2-ui shuts down, or reporting pinned Docker image tags as the externally running sv2-apps versions).

Host-provisioned admin credentials

A host platform or operator can provision and rotate the F2D4 admin credential before sv2-ui is first accessed, so the instance is never exposed in an unclaimed state where the first visitor can set the password.
The credential provisioning format or mechanism is documented and stable so external packagers can generate and rotate credentials reliably.

No regression to managed mode

The default Docker-orchestrated setup wizard, container lifecycle management, log diagnostics, and interactive password setup continue to work unchanged when external-stack mode is not enabled.
Cross-Repo Notes
This issue is self-contained in sv2-ui and is not blocked on sv2-apps.
Features that currently rely on container log scraping or pinned Docker image metadata (active upstream pool / failover / solo-fallback status, and running sv2-apps versions) are expected to degrade gracefully in external-stack mode until sv2-apps exposes that data on its monitoring API (tracked separately in sv2-apps).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0