Commit Graph

13 Commits

Author SHA1 Message Date
Leopere 1ce1c833b6
Add comprehensive curl/stream examples to all code tabs and skill.md
- Expand index.html code examples (curl, Python, JS, Rust, Go) to
  include /stream, /dice, /password, /coin, /8ball, and /health
  endpoints alongside /random — stream examples were previously missing
- Fix skill.md: remove duplicated stream code block, add dedicated
  sections for dice, password, coin, and 8ball endpoints with full
  curl examples and parameter docs
- Add comprehensive "curl (comprehensive)" cheat-sheet section to
  skill.md covering every endpoint in one block

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 13:50:56 -05:00
Leopere 5b49685ae9
Harden resilience: auto-restart harvester, poison-safe mutexes, graceful shutdown
- Replace all Mutex::lock().unwrap() with lock_or_recover() that recovers
  from poisoned mutexes instead of panicking (cascading failure prevention)
- Wrap harvester loop in catch_unwind with a supervisor thread that
  automatically restarts on panic (requires panic=unwind in release profile)
- Add exponential backoff with jitter for camera reconnection (2s base,
  60s cap) instead of fixed 10s intervals
- Enforce frame deadline: frames exceeding FRAME_TIMEOUT are treated as
  errors rather than just logged
- Add graceful shutdown via SIGINT/SIGTERM with axum's
  with_graceful_shutdown
- Track harvester restart count via AtomicU64 for diagnostics
- Extract docs/MCP handlers into src/docs_handlers.rs to keep main.rs
  under 400 lines
- Change release profile from panic=abort to panic=unwind so
  catch_unwind actually works in production
- Add tokio signal feature for shutdown handling

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 13:47:23 -05:00
Leopere ffc9102522
Default password length to 20 characters
20 is the recommended minimum for 2026. The API and UI still
accept shorter lengths if explicitly requested.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:01:18 -05:00
Leopere b082f6df5a
Slim nav down to Portfolio, TRNG, and Tools
Replace the full dropdown nav with three simple links: Portfolio
(colinknapp.com), TRNG (/), and Tools (/tools). Removed all
unused dropdown CSS from both pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 16:59:31 -05:00
Leopere 8f06c6c381
Show Sum and Possible on dice rolls
Dice output now always shows "Sum: X of Possible: Y" where Y is
sides * count, on both the main page and standalone /tools page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 16:56:21 -05:00
Leopere cde28f7069
Add consistent header/footer to standalone /tools page
The /tools page now has the same chrome as the main page:
- Skip-to-content link
- Full navigation bar with all dropdown menus
- Accessibility notice in footer
- Footer CTA with shimmer border and contact modal
- Matomo + PostHog analytics scripts
- Same max-width (800px) and font/color variables

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 16:55:33 -05:00
Leopere b39bf68f06
Move password exclude-ambiguous checkbox to its own row
The checkbox was crammed into the controls flex row alongside the
length/charset/generate button, causing layout issues at narrower
widths. Now sits on its own line between controls and output box
on both the main page and standalone /tools page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 16:49:28 -05:00
Leopere b7bff60271
Add standalone /tools page for bookmarkable quantum random tools
Dedicated tools-only page at /tools with dice, password generator,
coin flip, and 8 ball - each with its own click-to-copy output box.
Clean, lightweight page without API docs/MCP/contact form clutter.
Linked from the main page's QTRNG Tools section.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 16:45:14 -05:00
Leopere 7bf292d64e
Add Quantum 8 Ball tool and click-to-copy for all outputs
New QTRNG tool: Quantum 8 Ball with all 20 classic Magic 8 Ball
responses, selected via rejection sampling on quantum camera noise.
Includes /8ball API endpoint, sentiment classification (positive/
neutral/negative), and a fun dark-orb UI with shake animation and
color-coded answers. Both output boxes (random bytes + tools) now
support click-to-copy with a toast notification.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 16:42:52 -05:00
Leopere 4d302559e4
Add QTRNG tools: quantum dice, password generator, coin flip; build-test script
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 16:24:51 -05:00
Leopere cad9ef1b23
Remove /raw endpoint completely - security hardening
- Removed /raw route from server
- Removed get_raw function and RawQuery struct
- Removed extract_raw_lsb import
- Removed all /raw references from skill.md documentation
- Replaced url_template placeholders with concrete example URLs in MCP JSON
- Users can no longer access raw sensor data

Security: Raw sensor data access completely removed to prevent potential
information leakage from camera sensor patterns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 17:05:57 -05:00
Leopere 05aea9530b
Add MCP self-referencing docs and /docs endpoint
- Enhanced /.well-known/mcp.json to extract hostname from request headers (SNI/Host)
- Added self-referencing URLs that work with localhost, domains, and reverse proxies
- Documented all 5 API endpoints (random, raw, stream, cameras, health) as MCP tools
- Added /docs endpoint serving HTML documentation from skill.md
- Added /docs/skill.md for raw markdown access
- Added /docs/mcp.json as alias to /.well-known/mcp.json
- Created skill.md with comprehensive API documentation
- Markdown to HTML conversion happens at build time

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 16:34:28 -05:00
Leopere 40451b7d4c
Camera TRNG: webcam-based true random number generator
MIT with attribution (see LICENSE). Docker: build locally, no registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 15:46:26 -05:00