Commit Graph
14 Commits
Author SHA1 Message Date
Andy Dixon 841f27487a Keep progress streams open until the job finishes
The stream used to close after three minutes, which a job queued behind
other users could exceed. It now runs until the job completes or the
client disconnects, sending a keep-alive comment every 15 seconds so
nginx does not time out an idle stream.
2026-03-21 12:35:13 +00:00
Andy Dixon 957c6404c1 Document sessions, limits and GitHub App setup 2026-03-15 14:27:38 +00:00
Andy Dixon 09b57f7afa Offer GitHub sign-in in the frontend
The load dialog shows the GitHub account state with sign-in, sign-out
and repository-selection links. A clone that needs authorisation shows
a Sign in with GitHub or Grant repository access button, and the
repository is resumed automatically on return from GitHub.
2026-03-15 09:52:44 +00:00
Andy Dixon b216b86004 Add GitHub App sign-in for private repositories
/api/github/login redirects to GitHub with a single-use state bound to
the session; the callback exchanges the code for a user token kept in
memory and expired with it. Clones pass the token through git config
in the environment, never the URL or arguments, and ignore host git
config and credential helpers. Failed clones report authRequired
(signin or install) so the frontend can offer the right next step.

Configured with GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_APP_SLUG.
2026-02-28 12:27:34 +00:00
Andy Dixon 25c8c45de4 Limit concurrent indexing to two runs
Further jobs report a queued phase until a slot frees, so a burst of
users cannot exhaust the container's CPU and memory at once.
2026-02-21 19:55:38 +00:00
Andy Dixon 1c93df022d Expire idle snapshots and abandoned jobs, cap snapshot count
A background sweep every minute drops snapshots unused for an hour,
finished jobs, and uploads never committed, deleting their workspaces.
At most 8 snapshots are held; the least recently used is evicted.
2026-02-21 09:37:43 +00:00
Andy Dixon 25e2d2f390 Keep one snapshot per session instead of one globally
Indexing used to discard every existing snapshot, so concurrent users
wiped out each other's landscapes. Only the same session's previous
snapshot and workspace are replaced now.
2026-02-15 18:15:47 +00:00
Andy Dixon 26800b9b66 Scope jobs and snapshots to a browser session
An HttpOnly, SameSite=Lax session cookie is issued when a job is
created. Job and snapshot routes return 404 to any other session, so
indexed source is only readable by the browser that loaded it.
2026-02-15 10:53:01 +00:00
Andy Dixon d8d4a77ba7 Use random job and snapshot IDs
Timestamp-derived IDs were guessable, and the ID is what grants access
to indexed source. crypto/rand.Text gives 26 base32 characters.
2026-02-07 12:18:26 +00:00
Andy Dixon 981ec88f43 Add Docker build script and README
Multi-stage Dockerfile runs the tests, builds a static binary, and ships
it on Alpine with git for GitHub clones.
2026-02-01 21:48:24 +00:00
Andy Dixon 59d7e99e0b Note invalid UTF-8 replacement difference 2026-02-01 15:33:38 +00:00
Andy Dixon 62c363b031 Prefilter indexer regexps with literal checks
Go's regexp backtracker dominated indexing. Each pattern now runs only
when a cheap necessary-condition check passes, cutting indexing of the
Go standard library source from 4.7s to 1.4s.
Adds BenchmarkIndexDirectory.
2026-01-25 15:57:26 +00:00
Andy Dixon 5816dea6b1 Add Go HTTP/SSE API server with embedded frontend
Implements the API routes (jobs, progress events, snapshots, search,
entities, source delivery with release) to net/http and serves the
static frontend from the same binary on the same origin.
2026-01-25 09:10:28 +00:00
Andy Dixon f040f28325 Add source indexer
Parallel file parsing, import linking, language/layer classification,
and .gitignore/.ignore handling, with tests.
2026-01-24 14:08:43 +00:00