Commit Graph
41 Commits
Author SHA1 Message Date
Evan JarrettandClaude Opus 5 a7c7db68a9 dev: share the hold's network namespace with the appview
The hold needs did:web:localhost%3A8080 so that the aud it presents in
service tokens is accepted: atproto only allows a port-bearing did:web on
localhost, and did:web:<ip>%3A<port> is rejected by real PDSes. Joining
the hold's netns (network_mode: service:atcr-hold) lets both reach each
other on localhost. The appview's 5000 is published on the hold service,
which owns the namespace.

Dev compose only; nothing in deploy/ or CI references this file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 20:49:24 -05:00
Evan Jarrett 6758996300 add SBOM package diffing, verify hold-service captain records
- diff view gains a Packages tab with added/removed/changed/unchanged
  package tables and purl-derived type/license/upstream links
- captain records verified against the DID's atcr_hold service before
  caching (processor + batch backfill), preventing forged holds
- fix empty-handle updates clobbering cached handles and colliding on
  the UNIQUE constraint
- move fillPrevCIDs into repo.go; DirectRepoOperator is now canonical,
  repomgr kept as a test oracle
- surface read-only crew status in hold selector
- reconcile docs
2026-06-13 12:49:03 -05:00
Evan Jarrett ab4a4ebf9d admin panel long running imrovements, billing fixes, ui cleanup
1. Multiple registry domains + per-user domain preference

The biggest feature. The appview can serve several registry domains (e.g. buoy.cr, atcr.io),
and users can now pick which one shows up in their pull/push commands.

- Lexicon/record: adds registryDomain (and documents ociClient)
to the sailor profile (lexicons/.../profile.json, pkg/atproto/lexicon.go).
- DB: new registry_domain column on users (schema.sql + migration 0027),
with GetUserByDID/Handle reads, UpdateUserRegistryDomain writer,
and Jetstream caching it on profile updates (writes unconditionally so clearing propagates).
- UI/handlers: new UpdateRegistryDomainHandler + /api/profile/registry-domain route,
a <select> in the user settings panel (only shown when >1 domain configured), and resolveRegistryURL()
which falls back to the primary domain if the user's pref is stale/removed. Tests added for all of it.

2. default_hold_did removed → first managed_holds entry is the default

Consolidates two overlapping config fields into one. ServerConfig.DefaultHoldDID is gone;
PrimaryHoldDID() now returns managed_holds[0]. managed_holds is now REQUIRED.
Updated in config, validation, server wiring, test harness, example YAML, and the deploy template.

3. Admin long-running operations → generic background-job framework

New pkg/hold/admin/jobs.go introduces a reusable startJob/jobRegistry pattern
 (a detached context.Background() job + a /admin/api/jobs/{key}/status polling endpoint).
This replaces the bespoke scan-backfill goroutine state machine, and now also wraps crew tier remap and crew import
all three previously looped synchronously on the request context and got 504'd/cancelled mid-run by the reverse proxy.
 Forms switched from POST-redirect to htmx fragments (job_progress.html, job_result.html, crew_import_results.html)
 the old crew_import_results.html page and scan_backfill_progress.html partial were deleted.
This is also captured as a new rule in CLAUDE.md.

4. Cascade-delete manifest on last-tag deletion

DeleteTagHandler now, after removing the last tag pointing to a digest, cascade-deletes the manifest itself
 (PDS + DB + hold blob purge) — but only if it's not a child of a manifest list (multi-arch parent).
 New GetTagDigest and ShouldCascadeDeleteManifest queries back it, plus cascade_delete_test.go.
 Also switches tag rkey computation to the atproto.RepositoryTagToRKey helper.

5. Billing simplification

Drops the OwnerBadge config option (hold-owner supporter badge).
The user-profile template no longer special-cases an "owner" badge value (only "Captain").
Example tiers renamed to the nautical scheme (deckhand/bosun/quartermaster).

6. Build/deploy: go generate always runs via Make

make generate is now a phony target that always runs go generate ./... (regenerating cbor_gen, icon sprites, etc.),
 and build-trixie depends on it. The deploy tooling (provision.go/update.go)
drops its own runGenerate calls since the Makefile handles it.

7. New cmd/firehose-tap tool (untracked)

A standalone CLI that subscribes to a com.atproto.sync.subscribeRepos endpoint and pretty-prints events,
with emphasis on Sync 1.1 compliance fields (per-op prev CIDs, commit prevData) and a --validate CI mode.
Fits with the recent "more sync1.1 compliant" commit.
2026-06-05 20:57:25 -05:00
Evan Jarrett b5495af2b6 billing bugfixes 2026-05-16 19:39:57 -05:00
Evan Jarrett 4328eda814 holds now listen for deletes and labelers for takedowns. GC will defer takedowns for a grace period in case of reversal 2026-05-02 23:31:41 -05:00
Evan Jarrett ab66028151 more labeler improvements. standardize did work between labeler and hold. improve sql race conditions on local-only db 2026-05-02 22:13:53 -05:00
Evan Jarrett f20170f595 digest page improvements 2026-03-29 13:01:40 -07:00
Evan Jarrett 7d74e76772 more billing/settings/webhook tweaks 2026-02-28 14:42:35 -06:00
Evan Jarrett 136c0a0ecc billing refactor, move billing to appview, move webhooks to appview 2026-02-26 22:28:09 -06:00
Evan Jarrett 2b9ea997ac fix tier and supporter badge assignments. normalize did:web adresses with ports. various minor fixes 2026-02-22 11:16:55 -06:00
Evan Jarrett f90a46e0a4 begin implement supporter badges, clean up lexicons, various other changes 2026-02-20 22:12:18 -06:00
Evan Jarrett 9723de0bcd migate envs to use yaml configs 2026-02-10 22:11:21 -06:00
Evan Jarrett 35f7a47af3 add simple stripe billing implementation for quotas 2026-02-03 21:52:31 -06:00
Evan Jarrett 34f342f637 lots of refactor and cleanup to allow for branding overrides 2026-02-02 22:42:15 -06:00
Evan Jarrett ca56a7c309 allow domain name and short name to be replaced by config 2026-01-22 14:52:30 -06:00
Evan Jarrett 57593a8683 remove the filesystem and buffered upload ability on the holds. going forward the only supported storage is s3. adds extra mocks and tests around uploading 2026-01-19 16:59:03 -06:00
Evan Jarrett 51f6917444 add log shipper begin envvar cleanup 2026-01-08 22:52:32 -06:00
Evan Jarrett f5979b8f08 implement a basic crew management admin panel 2026-01-05 21:30:42 -06:00
Evan Jarrett f35bf2bcde fix oauth scope mismatch 2026-01-05 20:26:41 -06:00
Evan Jarrett a9704143f0 fix 2025-12-18 13:32:05 -06:00
Evan Jarrett 5f19213e32 better open graph 2025-12-18 12:29:20 -06:00
Evan Jarrett e17600db28 slog and refactor config in appview 2025-10-25 11:00:48 -05:00
Evan Jarrett 80b65ee619 fix all the places where did used to be an endpoint 2025-10-17 20:40:04 -05:00
Evan Jarrett 70e802764b crazy refactor to start using holds embedded pds for crew/captain validation 2025-10-16 00:05:45 -05:00
Evan Jarrett 18fe0684d3 begin embedded pds with xrpc endpoints and well-known 2025-10-14 20:25:08 -05:00
Evan Jarrett a9e2a56568 fix up multipart uploads. test filesystem and s3 storage drivers work as a fallback for s3 presigned urls 2025-10-11 22:08:07 -05:00
Evan Jarrett 6080e9f0ee backfill cleanup 2025-10-09 17:24:49 -05:00
Evan Jarrett 0f867595c5 fix db migration logic 2025-10-09 10:54:03 -05:00
Evan Jarrett b1e6857381 refactor appview to use envvars. move distribution configurations to code 2025-10-08 23:29:51 -05:00
Evan Jarrett fb040a72d3 begin testing s3 2025-10-08 22:38:44 -05:00
Evan Jarrett 454298645c implement stars and pull tracking rename registry -> appview 2025-10-08 12:31:51 -05:00
Evan Jarrett 08d5fce21f move file store cache to sqlite. implement repository page 2025-10-07 21:51:53 -05:00
Evan Jarrett 5bcedac3c1 update docker credential helper to remove configure and store devices, not api keys. improve ui, fetch profile image 2025-10-07 19:52:26 -05:00
Evan Jarrett 8bf3b63428 fix backfill 2025-10-06 21:59:57 -05:00
Evan Jarrett 678a11d1b7 backfill via com.atproto.sync.listReposByCollection 2025-10-06 21:24:46 -05:00
Evan Jarrett e56634d6c8 more jetstream and ui improvements 2025-10-06 17:39:21 -05:00
Evan Jarrett 383face791 implement basic web ui 2025-10-06 16:28:58 -05:00
Evan Jarrett 13fbfe3684 oauth working 2025-10-04 21:19:49 -05:00
Evan Jarrett 31e235a2a1 cleanup oauth 2025-10-04 13:50:28 -05:00
Evan Jarrett a200e7b23b fix docker push command 2025-10-03 15:55:45 -05:00
Evan Jarrett 85d0bd2463 initial commit 2025-10-02 11:03:59 -05:00