Commit Graph
12 Commits
Author SHA1 Message Date
tke a23fa00dfb feat(proxy): apt proxy audit + doctor mode; reinstall-from-clone = update
apt-audit.js scans EVERY file in apt.conf.d for Acquire::*::Proxy, classifying:
- creds: embedded userinfo (plaintext leak + stale-cred hammering risk)
- overrides: sorts after 80proxy-bridge so apt last-wins REPLACES the bridge URL
- external: points at a non-bridge proxy
Installer Legacy section alerts + fixes (backup kept: *.disabled-by-proxy-bridge).
New 'install.js doctor [--fix]': audits apt, bashrc, snap, service drop-ins,
service state, keyring presence; exit 1 when issues found.

Update semantics: deploy writes .installed-from (git commit + file hashes);
runtime JSONs are never created if present and never overwritten; tests prove
3 consecutive installs leave runtime state byte-identical. Downgrade protection
comes from the visible marker + diff reporting, never silent clobbering.

Tests: 6 audit + 2 installer (update-semantics, doctor) — suite now 23/23.
2026-09-23 16:07:53 +02:00
tke 753fac9fe9 fix(proxy): installer — no prompts during dry-run; never pin service to agent-bundled node
- askConfirm short-circuits non-interactively in --dry-run (prints what would be asked)
- systemd node resolution order: existing unit's pinned binary > newest nvm node >
  PATH lookup excluding hermes-agent runtimes > process.execPath. On the live box
  this keeps the unit byte-identical (true idempotency for the service section).
2026-09-23 15:15:33 +02:00
tke 3f9be30784 feat(proxy): idempotent interactive installer; retire credential-embedding legacy scripts
install.js (node, replaces install_proxy.sh + setup.js + update_*.sh + get_proxy.sh):
- sections: preflight, deploy, config import/create, credentials, legacy migration,
  systemd unit, system-wide proxy (bashrc/apt/docker/snapd/ollama), verify
- idempotent: re-run converges; tests prove a second non-interactive run shows
  zero CHANGED
- imports existing /opt configs non-destructively; asks before changing
- credentials: prompted when keyring entry missing; verified with ONE CONNECT
  round-trip before storing; 407 responses are never stored (anti-lockout);
  unreachable upstream stores nothing
- legacy migration: removes bashrc #PROXY_A93JK2 line + plaintext-cred files,
  rewrites cred-embedding apt/snap/service drop-ins to the bridge URL
- flags: --dry-run, --non-interactive (fails listing missing info), --no-systemd

Tests cover dry-run-no-op, idempotency, verify-store-on-200, refuse-on-407.
2026-09-23 15:14:19 +02:00
tke c514f32661 feat(proxy): credential-failure backoff prevents corp proxy account lockout
After 3 consecutive 407s within 120s (defaults; env-tunable), the bridge stops
sending Proxy-Authorization to that upstream for 300s, then retries once with
refreshed keyring creds. A successful request clears the failure state. Requests
during the lockout fail fast with the upstream's 407 instead of retrying stale
credentials — the exact pattern that locks accounts.

Tests: 407-stub lockout engages on 4th attempt; success mid-stream resets the
counter (re-lock needs a fresh 3); missing creds never send an auth header.
Harness: awaitProxyResponse() decouples client-side settle from server FIN
timing (previous once(end) pattern wedged under node --test).
2026-09-23 14:57:18 +02:00
tke 0b8c5001fc fix(proxy): port HTTPS-upstream TLS-wrap from deployed bridge; unify CONNECT establishment
- parseProxyConfig handles PAC 'HTTPS host:port' (tls.connect + CONNECT inside TLS) in
  both the CONNECT and plain-HTTP handlers — ports live fix d8b9db2 into the repo
- CONNECT: split tunnel establishment into establishDirect / sendConnectToProxy,
  removing the duplicate DIRECT 'connect' listener that raced onUpstreamData
- env-overridable PROFILE_FILE / REMOTES_FILE / PAC_DIR (test hermeticity)
- tests: +DIRECT echo exactly-once, +HTTPS upstream via local PAC dir + self-signed
  TLS stub (no internet needed); 8/8 pass
2026-09-23 14:49:07 +02:00
tke 52e0c00cd8 fix(proxy): handle blocked CONNECT resets 2026-07-01 09:37:41 +02:00
tobiasandClaude Opus 4.7 401b3e1781 feat(proxy): add destination overrides and fix PAC helpers
Add a hot-reloaded override table (overrides.json) that forces specific
hosts/IPs to a chosen profile regardless of the active profile, applied
across all bridge ports. Matching supports exact host, wildcard, domain
suffix, single IP, and CIDR. Managed via `proxy-bridge override
list|add|remove|clear` and surfaced in status/config.

Also fix two PAC sandbox helpers: localHostOrDomainIs (unqualified-host
case) and isInNet (was a no-op stub, now does real IPv4 subnet matching).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 21:58:11 +02:00
tke 7f73746427 Update proxy bridge setup 2026-05-22 13:01:54 +02:00
tke 203f2bf189 feat(proxy): secure refactor and system-wide integration
- Removed hardcoded corporate proxy URL from all scripts.
- Updated bridge.js to load configuration from /opt/proxy-bridge/config.json.
- Updated setup.js to interactively configure upstream proxy and credentials.
- Enhanced install_proxy.sh to automatically configure APT, Bash, and system services.
- Purged sensitive URL from git history and verified zero leakage.
2026-05-22 12:23:16 +02:00
tke ac3245b78f proxy-bridge: add keyring-based HTTP CONNECT proxy bridge 2026-04-27 14:27:27 +02:00
tke 71bffc77ae proxy: add ollama to restart services 2026-04-27 14:25:36 +02:00
tobias 92c7fc69c6 Restructure repository: organize tools by purpose, create what search tool
- Move single-file tools to tools/ organized by category (security, forensics, data, etc.)
- Move multi-file projects to projects/ (go-tools, puzzlebox, timesketch, rust-tools)
- Move system scripts to scripts/ (proxy, display, setup, windows)
- Organize config files in config/ (shell, visidata, applications)
- Move experimental tools to archive/experimental
- Create 'what' fuzzy search tool with progressive enhancement (ollama->fzf->grep)
- Add initial metadata database for intelligent tool discovery
- Preserve git history using 'git mv' commands
2026-02-21 23:20:42 +01:00