Skip to content

Dashboard: time-frame picker and one-click .zip export, always available, with docs and a browser test #4129

Closed

Description

@pithead-developer

What's the problem

The dashboard card only offers "Journal window (hours)", a number from 1 to 168 (dashboard/mining_dashboard/web/static/system/supportbundle.mjs:88-91), and a two-step "collect, then download" flow. It is part of tracker #4032.

  • There is no start and end picker, so an owner cannot choose a past incident window, and the card does not show how far back the logs reach.
  • The route exists only when the control channel is on: dashboard/mining_dashboard/web/server.py:586-590 registers the control routes under if config.DASHBOARD_CONTROL_ENABLED, which answers 404 when off, and that flag defaults to false (dashboard/mining_dashboard/config/config.py:232-233). Enabling it needs a dashboard password (lib/pithead/28-parse-and-validate-config.sh:403-404) and brings in config editing that can change the payout wallet. So a normal appliance owner gets a 404 and no hint why.
  • The docs are wrong. docs/dashboard.md:1674 and docs/operations.md:32 say the host "refuses rather than truncating". The collector truncates every unit to 2 MiB (07-support-bundle.sh:266). docs/operations.md:31 says "the last 200 log lines per container", which stops being true for the appliance and for DIY once Support bundle collector: one .zip of the whole journal for a chosen start and end time, with a manifest #4127 and DIY parity: the same windowed .zip from the dashboard and from ./pithead support-bundle --since/--until #4130 land. "Send it with a bug report" is only a link to Add a 'Report a bug' link (bugs@pitheadmining.com) to the shell and Maintenance #3746 (docs/dashboard.md:1678), not steps. The CHANGELOG has no entry for this feature.
  • There is no browser test of the card (dashboard/tests/browser/ has none for it), and dashboard/tests/frontend/system/supportbundle.test.mjs is a string match only.

What it impacts

How I found it

This came from a read-only audit of develop at eb929ce on 2026-11-15, against the owner's request and the acceptance criteria of #4032, verified by a second agent. The owner said on 2026-11-15: "make sure 2.0.4 has the export logs feature also. i want to be able to select a time frame and then dump pretty much every log on the system into a zip file for download. this is so we can debug issues users face".

Evidence is the file:line list above. Not verified: how the global auth middleware gates the route today (the audit found no test that an unauthenticated download is refused). Also not verified: whether the host-side runner that does the collect (control-run-pending) is available without the control channel. The developer must check both.

How important is it

Release blocker for v2.0.4 (owner, 2026-11-12 and 2026-11-15). This is the part the owner will actually touch. Part of #4032.

Owner, 2026-11-15, on availability: "always allow it to be downloaded". The export must not depend on the control channel switch.

Acceptance criteria

  • The card has a start and end picker with presets (last 1 h, 6 h, 24 h, 72 h, 7 days) and a custom range. Default is the last 72 h.
  • The card shows the oldest retained log time, so the owner sees how far back the logs reach. A range reaching past it is clamped or flagged before the owner starts, and the card shows the effective window that came back in the manifest.
  • One click starts collection and, when it finishes, starts the .zip download without a second button. The file name is support-bundle-<UTC timestamp>.zip.
  • The card shows progress while collecting and a clear message for each failure: invalid range, collect failed, rate limit ("collected less than a minute ago", 46b:7-11), download unavailable.
  • The export is always available, on the appliance and on DIY, whatever DASHBOARD_CONTROL_ENABLED says, and without turning on config editing. Config editing, restart and the other control actions stay off when the switch is off. A test covers the export with the switch off.
  • When a dashboard password is set, every export route requires login, and a request with no login is refused. A test asserts it. When no password is set, the export is served to whoever can reach the dashboard, like the rest of the dashboard. This is the owner's ruling; the bundle is redacted. The docs say so plainly.
  • The control request keeps the CSRF header check (X-Pithead-Control, diagnostics_views.py:30-38).
  • docs/dashboard.md (the Support bundle section around :1668-1685) and docs/operations.md (:31-32) are rewritten: how to open the card, pick a range, download the zip, and attach it to a bug report with steps (not only a link). The false "refuses rather than truncates" and "last 200 log lines" claims are corrected to match the real size policy from Support bundle collector: one .zip of the whole journal for a chosen start and end time, with a manifest #4127.
  • CHANGELOG.md has an entry under Unreleased for the export, naming the zip and the time-frame picker.
  • A Playwright test in dashboard/tests/browser/ picks a range, clicks export and checks the downloaded file is a zip with the manifest and the chosen window. It also checks the error state for an invalid range.
  • dashboard/tests/frontend/system/supportbundle.test.mjs and dashboard/tests/web/views/test_support_bundle_views.py are updated, with a real zip fixture instead of the fake 8-byte payload.
  • make check passes.

Possible solutions

  • Register the support-bundle routes always, separate from DASHBOARD_CONTROL_ENABLED, and keep the host runner's support-bundle verb reachable without the config-editing verbs. The best split is not verified.
  • Use native datetime-local inputs plus preset buttons. Read the retained range from the previous manifest or from a small status endpoint.
  • Poll the existing result endpoint and start the download from the applied state, so there is a single click.

Activity

  1. added this to the v2.0.4 milestone on Nov 15, 2026
  2. added
    enhancement
    dashboard
    appliance
    release-blocker
    P1-user-facing
    on Nov 15, 2026
  3. pithead-developer commented on Nov 15, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4127. I made no edits and opened no branch or PR, because this issue's UI and test work needs #4127's change first. #4127 is still open with no PR. On origin/develop at eb929ce the collector (lib/pithead/07-support-bundle.sh) takes only an hours window and has no .zip output, start/end fields or manifest. The issue itself says it "depends on #4127 for the request fields (start and end), the .zip and the manifest". The picker, the one-click zip download, the "effective window from the manifest" display, the Playwright test that checks the zip and manifest, and the corrected docs all use those contracts. If I built them now I would be guessing the request/response shape and the size policy, and #4127 could change either. #4127 carries the release-blocker label and is the first piece of #4032. What is done: I read the issue and the repo state and confirmed the dependency. What unblocks this: #4127 merges. On resume I will build the picker, always-on export routes and tests as described in the issue. Two items the issue leaves unverified still need checking then: how auth gates the route, and whether the host runner's support-bundle verb works without the control channel.

    The runner resumes this issue when that one closes.

  4. added
    blocked
    on Nov 15, 2026
  5. removed
    blocked
    on Nov 16, 2026
  6. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #4172.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-user-facingappliancedashboardenhancementrelease-blocker

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions