Skip to content

fix: harden SMART scan, site links and CI gates - #48

Merged
TimInTech merged 1 commit into
mainfrom
fix/audit-findings
Nov 3, 2026
Merged

TimInTech merged 1 commit into
mainfrom
fix/audit-findings

Conversation

@TimInTech

Copy link
Copy Markdown
Owner

Follow-up to the repository audit.

  • SMART: an unparseable smartctl answer for one disk is reported and skipped instead of aborting the report; remaining disks and smart.json still update. Regression test fails on the old code.
  • Website: CHANGELOG.md/file links now point at the GitHub blob instead of 404ing under /anleitung/; headings carry GitHub-style anchors so #-installation, #health-monitoring--alerts and #relaying-through-an-external-smtp-provider resolve.
  • Pages workflow: rebuilds on README changes (the guide reads them at build time) and pins all actions to commit SHAs.
  • CI: new documentation-site job builds Astro, verifies 5 routes, commands and anchors, runs npm audit.
  • README: the alert quick start leaves HEALTH_MAIL_TO commented out so --test-notify proves ntfy.

Local verification: tests/maintenance OK, tests/run.sh 141/141, npm run build 5 pages, npm audit --omit=dev 0 vulnerabilities.

- maintenance: a disk whose smartctl output is not JSON no longer aborts
  the whole report; the device is named as unreadable and the remaining
  disks plus their state file keep working (regression test added).
- site: repository-relative file links (CHANGELOG.md and friends) point
  at the GitHub blob, headings get GitHub-style anchors so the upstream
  #-installation, #health-monitoring--alerts and
  #relaying-through-an-external-smtp-provider links resolve again.
- pages workflow: rebuild on README/README.de.md changes because the
  guide reads them at build time; pin all actions to commit SHAs.
- ci: new documentation-site job builds Astro, verifies the five routes,
  key commands and anchors, and runs npm audit on pull requests.
- readme: keep HEALTH_MAIL_TO commented out in the alert quick start so
  --test-notify proves ntfy instead of failing on a missing MTA.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T00:25:50.030427Z 2e6af69 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TimInTech
TimInTech merged commit b39859d into main Nov 3, 2026
15 checks passed
@TimInTech
TimInTech deleted the fix/audit-findings branch November 3, 2026 00:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e6af6940c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +230 to +234
except (ValueError, CommandError):
# One unreadable disk must never hide the health of the remaining ones.
lines.extend(['', '{} ({})'.format(dev, disk.get('model') or 'unbekanntes Modell'),
'SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.'])
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate cancellation instead of treating it as a disk failure

When a user cancels an in-progress SMART query, Runner.run() raises CommandError with its cancellation event set. This handler now swallows that exception, skips the remaining disks, and reaches write_json() with an incomplete or empty baseline, even though the UI reports the operation as cancelled. Re-raise cancellation errors before handling ordinary disk failures, as sections_report() already does, so cancelling a scan does not overwrite SMART history.

Useful? React with 👍 / 👎.

Comment on lines +234 to +238
continue
if not isinstance(data, dict):
lines.extend(['', '{} ({})'.format(dev, disk.get('model') or 'unbekanntes Modell'),
'SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.'])
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve previous SMART baselines for unreadable disks

If a disk with an existing baseline temporarily returns invalid JSON, this continue leaves its identity out of current, and the final write_json() replaces smart.json without that disk's history. On the next successful scan, previous.get(identity, {}) is empty, so increased error counters are reported without their delta since the last successful measurement. Previously the parse failure aborted before replacing the baseline. Retain existing entries for unreadable disks while updating the successfully queried disks.

Useful? React with 👍 / 👎.

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.

1 participant