Commit Graph

40 Commits

Author SHA1 Message Date
Evan Jarrett
fcc5fa78bc rebuild repomgr into a custom repo operator. up to 2x faster 2026-02-28 22:24:31 -06:00
Evan Jarrett
27cf78158b vuln scanner fixes, major refactor of the credential helper. 2026-02-17 22:38:25 -06:00
Evan Jarrett
e3843db9d8 Implement did:plc support for holds with the ability to import/export CARs.
did:plc Identity Support (pkg/hold/pds/did.go, pkg/hold/config.go, pkg/hold/server.go)

  The big feature — holds can now use did:plc identities instead of only did:web. This adds:
  - LoadOrCreateDID() — resolves hold DID by priority: config DID > did.txt on disk > create new
  - CreatePLCIdentity() — builds a genesis operation, signs with rotation key, submits to PLC directory
  - EnsurePLCCurrent() — on boot, compares local signing key + URL against PLC directory and auto-updates if they've drifted (requires rotation key)
  - New config fields: did_method (web/plc), did, plc_directory_url, rotation_key_path
  - GenerateDIDDocument() now uses the stored DID instead of always deriving did:web from URL
  - NewHoldServer wired up to call LoadOrCreateDID instead of GenerateDIDFromURL

  CAR Export/Import (pkg/hold/pds/export.go, pkg/hold/pds/import.go, cmd/hold/repo.go)

  New CLI subcommands for repo backup/restore:
  - atcr-hold repo export — streams the hold's repo as a CAR file to stdout
  - atcr-hold repo import <file>... — reads CAR files, upserts all records in a single atomic commit. Uses a bulkImportRecords method that opens a delta session, checks each record for
  create vs update, commits once, and fires repo events.
  - openHoldPDS() helper to spin up a HoldPDS from config for offline CLI operations

  Admin UI Fixes (pkg/hold/admin/)

  - Logout changed from GET to POST — nav template now uses a <form method=POST> instead of an <a> link (prevents CSRF on logout)
  - Removed return_to parameter from login flow — simplified redirect logic, auth middleware now redirects to /admin/auth/login without query params

  Config/Deploy

  - config-hold.example.yaml and deploy/upcloud/configs/hold.yaml.tmpl updated with the four new did:plc config fields
  - go.mod / go.sum — added github.com/did-method-plc/go-didplc dependency
2026-02-14 15:17:53 -06:00
Evan Jarrett
de02e1f046 remove distribution from hold, add vulnerability scanning in appview.
1. Removing distribution/distribution from the Hold Service (biggest change)
  The hold service previously used distribution's StorageDriver interface for all blob operations. This replaces it with direct AWS SDK v2 calls through ATCR's own pkg/s3.S3Service:
  - New S3Service methods: Stat(), PutBytes(), Move(), Delete(), WalkBlobs(), ListPrefix() added to pkg/s3/types.go
  - Pull zone fix: Presigned URLs are now generated against the real S3 endpoint, then the host is swapped to the CDN URL post-signing (previously the CDN URL was set as the endpoint, which
  broke SigV4 signatures)
  - All hold subsystems migrated: GC, OCI uploads, XRPC handlers, profile uploads, scan broadcaster, manifest posts — all now use *s3.S3Service instead of storagedriver.StorageDriver
  - Config simplified: Removed configuration.Storage type and buildStorageConfigFromFields(); replaced with a simple S3Params() method
  - Mock expanded: MockS3Client gains an in-memory object store + 5 new methods, replacing duplicate mockStorageDriver implementations in tests (~160 lines deleted from each test file)
2. Vulnerability Scan UI in AppView (new feature)
  Displays scan results from the hold's PDS on the repository page:
  - New lexicon: io/atcr/hold/scan.json with vulnReportBlob field for storing full Grype reports
  - Two new HTMX endpoints: /api/scan-result (badge) and /api/vuln-details (modal with CVE table)
  - New templates: vuln-badge.html (severity count chips) and vuln-details.html (full CVE table with NVD/GHSA links)
  - Repository page: Lazy-loads scan badges per manifest via HTMX
  - Tests: ~590 lines of test coverage for both handlers
3. S3 Diagnostic Tool
  New cmd/s3-test/main.go (418 lines) — tests S3 connectivity with both SDK v1 and v2, including presigned URL generation, pull zone host swapping, and verbose signing debug output.
4. Deployment Tooling
  - New syncServiceUnit() for comparing/updating systemd units on servers
  - Update command now syncs config keys (adds missing keys from template) and service units with daemon-reload
5. DB Migration
  0011_fix_captain_successor_column.yaml — rebuilds hold_captain_records to add the successor column that was missed in a previous migration.
6. Documentation
  - APPVIEW-UI-FUTURE.md rewritten as a status-tracked feature inventory
  - DISTRIBUTION.md renamed to CREDENTIAL_HELPER.md
  - New REMOVING_DISTRIBUTION.md — 480-line analysis of fully removing distribution from the appview side
7. go.mod
  aws-sdk-go v1 moved from indirect to direct (needed by cmd/s3-test).
2026-02-13 15:26:24 -06:00
Evan Jarrett
c0cf3fb94f update dependencies 2026-02-12 20:28:00 -06:00
Evan Jarrett
cd47945301 add new upcloud cli deploy 2026-02-07 22:45:10 -06:00
Evan Jarrett
834bb8d36c libsql instead of sqlite for turso/bunnydb replicated sqlite 2026-02-05 20:43:04 -06:00
Evan Jarrett
d6114cf549 implementation of syft/grype scanner as a separate binary 2026-02-04 09:53:04 -06:00
Evan Jarrett
5d3b6c2047 begin billing 2026-02-03 20:54:35 -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
b1767cfb6b publish xrpc endpoint lexicons. fix backfill and jetstream to actually validate records match schema 2026-01-12 21:11:55 -06:00
Evan Jarrett
9704fe091d use chi/render to simplify returned json 2026-01-06 22:47:21 -06:00
Evan Jarrett
104eb86c04 fix go version 2025-12-20 10:49:37 -06:00
Evan Jarrett
509a1c0306 some lexicon json cleanup. code formatting 2025-12-20 10:46:40 -06:00
Evan Jarrett
5f19213e32 better open graph 2025-12-18 12:29:20 -06:00
Evan Jarrett
270fe15e1e more workflow fixes. update indigo, fix ensure crew logic on oauth 2025-11-04 12:40:30 -06:00
Evan Jarrett
b0799cd94d unit tests 2025-10-28 17:40:11 -05:00
Evan Jarrett
0b22082f89 lower cached plc hits to 8 hours 2025-10-26 22:50:42 -05:00
Evan Jarrett
d75a27557a use chi for routes in appview. refactor routes outside of serve.go 2025-10-25 14:20:23 -05:00
Evan Jarrett
30ea5256f3 try and add cursor=0 to subscribe 2025-10-22 22:20:23 -05:00
Evan Jarrett
aff5d7248c try and implement getsession and app-password 2025-10-22 21:20:40 -05:00
Evan Jarrett
1f72d90726 fix issue with mismatched scopes locally 2025-10-21 10:49:06 -05:00
Evan Jarrett
abf48407cc clean up db migrations and schema. implement a way to fetch readmes for documentation 2025-10-21 10:28:48 -05:00
Evan Jarrett
7228b532ba bug fixes, code cleanup, tests. trying to get multipart uploads working for the 12th time 2025-10-19 20:55:18 -05:00
Evan Jarrett
1b3a4eea47 refactor hold pkg to separate oci image endpoints 2025-10-19 17:23:46 -05:00
Evan Jarrett
50d5eea4a5 add oci manifest scope 2025-10-17 09:56:26 -05:00
Evan Jarrett
0dc2294c87 user repomgr for record management
tests

vendor repomgr
2025-10-16 13:08:19 -05:00
Evan Jarrett
8a3f88a104 try implement sync.GetRecord 2025-10-15 11:08:59 -05:00
Evan Jarrett
4c930e8ae5 update indigo repo, fix pds carstore 2025-10-14 23:18:01 -05:00
Evan Jarrett
21e6d08f75 cbor_gen crew 2025-10-14 22:11:00 -05:00
Evan Jarrett
18fe0684d3 begin embedded pds with xrpc endpoints and well-known 2025-10-14 20:25:08 -05:00
Evan Jarrett
3fad473910 use presigned urls for s3 to avoid hold bandwidth 2025-10-10 09:43:26 -05:00
Evan Jarrett
6b3223cf04 bugfixes for stars. implement migration schema 2025-10-08 14:49:30 -05:00
Evan Jarrett
336dd5f99a tidy and fmt 2025-10-07 10:59:14 -05:00
Evan Jarrett
2d16bbfee3 cleanup more auth 2025-10-07 10:58:11 -05:00
Evan Jarrett
5b18538a8b refactor oauth to use indigo 2025-10-06 22:24:19 -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
85d0bd2463 initial commit 2025-10-02 11:03:59 -05:00