51 Commits

Author SHA1 Message Date
Dorian
980fc3af6d feat: add metrics export as CSV/JSON (MON-04)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:33:19 +00:00
Dorian
1b8a8cfd32 feat: add alerting system with configurable rules and UI (MON-02, MON-03)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:28:44 +00:00
Dorian
592548066e feat: add real-time metrics collection with ring buffer storage (MON-01)
Implements monitoring/collector.rs that collects per-container CPU/RAM/network/disk,
system-wide metrics, RPC latency, and WebSocket connection count every 60 seconds.
Data stored in dual ring buffers: 1-min resolution (24h) and 15-min resolution (7d).
Three new RPC endpoints: monitoring.current, monitoring.history, monitoring.containers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 11:11:02 +00:00
Dorian
45032d937b feat: add community infrastructure and update server setup
- releases/manifest.json: Seed release manifest for update server
- update.rs: Make UPDATE_MANIFEST_URL configurable via ARCHIPELAGO_UPDATE_URL env var
- CONTRIBUTING.md: Comprehensive contribution guidelines covering code style,
  PR process, testing, security disclosure, and app submission
- .github/ISSUE_TEMPLATE/: Bug report, feature request, and app submission
  issue templates with structured forms
- .github/pull_request_template.md: PR template with checklist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:57:33 +00:00
Dorian
112b15b4ea fix: polish form validation and feedback across views
- Server.vue: Add loading/disabled state to WiFi connect button,
  success toast on WiFi connection
- Credentials.vue: Disable verify button when input empty, add
  disabled styles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:49:26 +00:00
Dorian
1ca83f97ec fix: polish error handling across frontend views
- Server.vue: Add user feedback for disk cleanup and restart operations
- Credentials.vue: Add clipboard fallback, better identity load error handling
- Federation.vue: Add clipboard fallback for invite code copy
- ContainerApps.vue: Wrap polling intervals in try-catch to prevent
  unhandled promise rejections from background refresh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:44:56 +00:00
Dorian
1a07862559 fix: add loading state to Cloud file counts
All 30 UX audit findings verified resolved. Added the last missing
loading indicator for Cloud.vue file count fetching. All P0, P1, and P2
items from docs/ux-audit-2026-03.md are now addressed across Login,
Home, Apps, Server, Chat, Federation, Credentials, Settings, Marketplace,
Web5, SystemUpdate, and Cloud views.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:40:26 +00:00
Dorian
754763d9cd docs: complete UX audit of all 12 pages
Found 30 issues: 3 P0 (broken), 13 P1 (confusing), 14 P2 (polish).
Key findings: Apps empty state hardcoded off, credentials parse error,
persistent unhealthy banners, dead links, no-op buttons, silent failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:13:36 +00:00
Dorian
149a216590 chore: mark PREREL-04 complete
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:09:29 +00:00
Dorian
8e0b938dc0 test: fix and run visual regression screenshot suite for all 12 pages
Fixed splash screen blocking login (set localStorage before navigation),
replaced full page reloads with in-page pushState navigation to preserve
SPA session, added page-specific content waits for reliable screenshots.
Increased Playwright timeout to 60s. Baseline screenshots captured for:
login, home, apps, marketplace, cloud, network, web5, settings, chat,
federation, credentials, system update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:06:54 +00:00
Dorian
bc879b3581 fix: add dev-mode warnings to all 24 silent catch blocks
Every empty/comment-only catch block now logs a descriptive warning
in dev mode via `if (import.meta.env.DEV) console.warn(...)`. Covers
15 files across views, stores, components, and utils. Zero silent
catches remaining.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:58:55 +00:00
Dorian
7a7cbf1da3 docs: record quality baseline — 22 silent catches, 78 console stmts, 15 any types
41 tests passing, type-check and build clean. This becomes the
regression target — counts must only go down.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:56:51 +00:00
Dorian
5bad457922 fix: remove wildcard CORS from nginx electrs-status, verify security headers
Security headers already present in nginx config (X-Content-Type-Options,
X-Frame-Options, CSP, Referrer-Policy, Permissions-Policy). Removed
Access-Control-Allow-Origin: * from electrs-status — CORS is now handled
by the backend with origin validation. Deployed and verified all headers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:54:41 +00:00
Dorian
2bfc36baa0 fix: restrict CORS to same-origin with explicit origin validation
Replace blanket cors_origin() with validate_origin() that checks the
incoming Origin header against allowed origins (host IP + dev server).
Unknown origins no longer receive Access-Control-Allow-Origin headers.
Also added X-CSRF-Token to allowed CORS headers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:53:51 +00:00
Dorian
a7653d4c8b feat: implement CSRF protection on RPC layer
Double-submit cookie pattern: backend generates csrf_token cookie on login
(non-HttpOnly so JS can read it), validates X-CSRF-Token header matches
cookie on all authenticated RPC calls. Returns 403 if missing/mismatched.
Frontend reads cookie and sends header automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:46:52 +00:00
Dorian
b9efd1b3d0 feat: add Network Interfaces section and WiFi scan modal to Server.vue
Shows detected physical interfaces (ethernet/wifi) with IP, MAC, and
status. WiFi scan button opens a modal with signal strength bars and
password-protected connection flow. Uses network.list-interfaces and
network.scan-wifi RPC endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:35:55 +00:00
Dorian
d26b95e256 feat: add network interface management RPC endpoints
Add network.list-interfaces, network.scan-wifi, network.configure-wifi,
and network.configure-ethernet endpoints using ip and nmcli commands.
Includes input validation to prevent command injection. Deployed and
verified — list-interfaces returns real interface data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:34:17 +00:00
Dorian
fce67baa9c feat: add system stats card to Dashboard with CPU/RAM/Disk gauges
Full-width card with color-coded progress bars (green <70%, orange
70-90%, red >90%) and uptime display. Calls system.stats RPC on
mount and refreshes every 30s. Deployed and verified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:24:59 +00:00
Dorian
e12a50f938 feat: add system monitoring RPC endpoints (system.stats, system.processes, system.temperature)
Read real metrics from /proc/stat, /proc/meminfo, /proc/uptime, /proc/loadavg,
df, ps, and /sys/class/thermal/. CPU usage computed via dual-sample jiffies.
Deployed and verified on live server — all three endpoints return real data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:22:57 +00:00
Dorian
5dbc29d19c feat: replace fake Web3 card data with Coming Soon badges
The Web3 card showed hardcoded values (3 active, Valid, 2.4 GB, 1
configured) for features that don't exist yet. Replace with subtle
"Coming Soon" pill badges to avoid misleading users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:05:12 +00:00
Dorian
4874f59e1d feat: wire real RPC data to Server.vue Local Network card
Replace hardcoded values with live data from network.diagnostics and
router.list-forwards RPC calls. Add skeleton loading states and
graceful N/A fallbacks when endpoints are unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:04:26 +00:00
Dorian
38b29dd2fd refactor: remove duplicate network diagnostics from Settings, add link to Server page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:01:15 +00:00
Dorian
76269a50fa chore: verify Web5 top bar already matches Server pattern (UI-02)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:59:20 +00:00
Dorian
55a12e9bec fix: replace path-option-card with glass-card in Settings.vue
Also fix TypeScript errors in test files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:58:33 +00:00
Dorian
98b2c098aa test: add CI-compatible test runner script
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:56:10 +00:00
Dorian
0301274054 test: add identity module unit tests (9 test cases)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:55:11 +00:00
Dorian
615ce4f939 test: add auth and session unit tests (20 test cases)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:54:14 +00:00
Dorian
05ed3b7bcf test: add backend integration test scaffolding with 3 RPC tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:51:22 +00:00
Dorian
7c09c19e8e test: add router guards unit tests with 9 test cases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:38:39 +00:00
Dorian
d214ba38c6 test: add container store unit tests with 8 test cases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:37:41 +00:00
Dorian
fe0413a124 test: add app store unit tests with 11 test cases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:36:42 +00:00
Dorian
5b08aa515d test: add RPC client unit tests with 13 test cases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:35:26 +00:00
Dorian
e6cd18d8ea test: install Vitest and configure frontend test runner
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:34:14 +00:00
Dorian
d69c0d6724 changes for build for sxsw 2026-03-10 23:29:05 +00:00
Dorian
a2aa9657b1 fix: prevent My Apps crash when installing apps + add filebrowser to demo
The My Apps page went blank after installing apps because pkg['static-files'].icon
was accessed without optional chaining on dynamically installed packages that lack
the static-files property.

- Make static-files optional in PackageDataEntry type
- Add defensive ?.icon access with fallback in Apps.vue and AppDetails.vue
- Add filebrowser to mock backend staticDevApps (enables Cloud page in demo)
- Expand portMappings and marketplaceMetadata for all marketplace apps
- installPackage now uses staticApp() format for consistent data shape

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:09:59 +00:00
Dorian
0cf71c4115 fix: zero-amount invoices, identity.verify DID extraction, tor service permissions
- Allow zero-amount Lightning invoices (BOLT11 "any amount") by changing
  validation from amount_sats < 1 to amount_sats < 0
- identity.verify now extracts pubkey directly from did:key format instead
  of requiring the DID to belong to a local identity
- tor.create-service writes config to data_dir/tor-config/ instead of
  /var/lib/archipelago/tor/ (owned by debian-tor, not archipelago user)
- Add E2E test script (scripts/run-e2e-tests.sh) covering 47 RPC endpoints
- Add testing plan with results (loop/testing.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:53:36 +00:00
Dorian
e3aa95a103 fix: prevent tokio runtime deadlock in credential issue/verify
The credential issuance and verification handlers used
Handle::block_on() directly inside the tokio runtime, causing a
deadlock. Wrapped with block_in_place() to properly yield the
runtime thread.

Also completed full feature verification across all 25 test groups
(~175 checks) on live server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 07:43:12 +00:00
Dorian
5ce8b7965c fix: add dependency checks for LND, BTCPay, Mempool, Fedimint
All apps with Bitcoin dependencies now check for running Bitcoin Knots
before install. Mempool also requires Electrs. BTCPay logs a warning
when installed without LND (Lightning payments unavailable).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:33:03 +00:00
Dorian
9f7b0a76f3 chore: mark APP-103 through APP-106 as verified
All PORT_TO_PROXY mappings match nginx config (APP-103).
First-boot creates all marketplace app containers (APP-104).
get_app_config handles all 24 apps (APP-105).
get_app_metadata has entries for all 24 apps (APP-106).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:24:12 +00:00
Dorian
b581fb4126 fix: protocol-aware iframe vs new-tab behavior for all apps
Apps with absolute-path redirects (Jellyfin, Portainer, PhotoPrism,
OnlyOffice, Uptime Kuma, Fedimint) now correctly open in new tab on
HTTPS where subpath proxy breaks their redirects, but still use iframe
on HTTP where direct port access works fine.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:22:41 +00:00
Dorian
c45de13752 fix: add 6 missing apps to first-boot and fix penpot icon path
Added searxng, onlyoffice, filebrowser, nginx-proxy-manager, portainer,
and tailscale to first-boot-containers.sh so fresh ISO installs have all
marketplace apps ready. Fixed penpot icon path in Marketplace.vue to use
the correct app-icons directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:18:28 +00:00
Dorian
5f51194e12 chore: gitignore loop artifacts and mark ISO-001 complete
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:08:38 +00:00
Dorian
589adb8b18 fix: alpha release hardening — onboarding, security, and ISO build
- Convert "Choose Your Path" screen to informative (read-only cards)
- Harden "Choose Your Setup" (gray out Coming Soon options, auto-select Fresh Start)
- Auto-fetch DID on mount with retry and auto-advance after success
- Improve backup download for mobile compatibility
- Add retry logic to verify step with graceful skip option
- Route verify → done → login for complete onboarding flow
- Add AIUI install confirmation via custom event (SEC-001)
- Add file path whitelist for AIUI file access (SEC-002)
- Add log redaction for container logs sent to AIUI (SEC-003)
- Add Secure flag to session cookie in production (SEC-004)
- Fix ISO build script to handle zstd compression errors gracefully
- Sync archipelago.service from live server

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:00:28 +00:00
Dorian
e55fd3baf0 feat: add TOTP 2FA, API key switcher, login progress bar, and alpha hardening plan
- TOTP 2FA: full setup/confirm/disable/login flow with Argon2id + ChaCha20-Poly1305
  encrypted secret storage, QR code generation, and bcrypt-hashed backup codes
- API key switcher: OAuth vs personal API key toggle in AIUI chat settings with
  status indicator, key validation, and help text
- Login progress bar: server startup detection with health check polling, form
  disabled until server is ready
- AI quarantine docs: comprehensive HTML page documenting all 6 security layers
- Settings: AI Data Access permission toggles with per-category control
- Alpha hardening plan: 28-task overnight automation plan across 7 phases
  (onboarding, login, app install, AIUI, UI polish, security, ISO build)
- Backlog: node discovery spatial map feature for alpha demo

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 12:23:57 +00:00
Dorian
0b3c23ff76 chore: add pentest-fix prompt and wire verification into loop.sh
- loop/prompt-pentest-fix.md: dedicated prompt for pentest fix overnight
  runs, instructs Claude to run verify-pentest-fixes.sh as final step
- loop/loop.sh: automatically runs verification script when all plan
  tasks are complete (runs for any plan, not just pentest)

Usage: PROMPT_FILE=loop/prompt-pentest-fix.md caffeinate -i ./loop/loop.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:53:36 +00:00
Dorian
5feb4ce799 chore: add pentest verification script and wire into overnight loop
- scripts/verify-pentest-fixes.sh: 26-check automated verification
  that tests all 21 pentest findings against the live server
- loop/plan.md: add permanent post-fix verification section
- scripts/overnight-loop.sh: accept plan file arg, run verification
  after all fixes complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:50:50 +00:00
Dorian
6656d2f1d9 fix: implement 22 security pentest remediation fixes
Server-side session management with SHA-256 hashed tokens and HttpOnly
cookies. Auth middleware gating all RPC/WS/proxy routes with method
allowlist. Login rate limiting (5/60s per IP). CORS restricted to
config origin. Docker registry allowlist. App ID and path validation.
P2P message sanitization (HTML + log injection). Onion address and
known-peer validation. Nginx security headers (CSP, X-Frame-Options,
etc.) and AIUI proxy auth. Systemd hardening (non-root, NoNewPrivileges,
ProtectSystem).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:26:56 +00:00
Dorian
6623dbc4ab chore: add security pentest reports and remediation plan
Overnight pentest run produced recon, analysis, exploitation reports,
and a full security assessment. Plan.md updated with 22 prioritized
fix items for auth, SSRF, injection, XSS, and hardening.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:08:14 +00:00
Dorian
7b56927c3c feat: complete AIUI integration — all 31 overnight tasks
- Protocol: 10 context categories (apps, system, network, bitcoin, media, files, notes, search, ai-local, wallet)
- ContextBroker: real data wiring for all categories with sanitization
- Permissions: user toggles for all categories in Settings
- Nginx: Claude API, OpenRouter, SearXNG proxy pass-through
- Actions: launch-app, search-web, install-app handlers
- Chat.vue: loading state + connection indicator
- Integration test page: test-aiui.html

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 14:34:02 +00:00
Dorian
81473db38b chore: update overnight plan with nginx proxies and AIUI coordination 2026-03-04 12:09:22 +00:00