Commit graph

157 commits

Author SHA1 Message Date
25d5d741c3 WIP 2026-05-01 06:16:13 -04:00
Andrew Nesbitt
e2495ef0aa
Merge pull request #102 from git-pkgs/enforce-max-size-eviction
Enforce max_size config with LRU cache eviction
2026-04-30 23:26:16 +01:00
Andrew Nesbitt
461a95c518
Enforce max_size config with LRU cache eviction
Closes #99. The max_size storage config was parsed and validated but
never enforced. This adds a background eviction loop that periodically
checks total cache size and evicts least recently used artifacts when
the limit is exceeded.
2026-04-30 18:09:01 +01:00
Andrew Nesbitt
fd9b8da526
Merge pull request #97 from git-pkgs/direct-serve-presigned-urls
Add direct-serve via presigned storage URLs
2026-04-30 18:01:10 +01:00
Andrew Nesbitt
33e3a1a197
Merge pull request #101 from git-pkgs/dependabot/github_actions/goreleaser/goreleaser-action-7.1.0
Bump goreleaser/goreleaser-action from 7.0.0 to 7.1.0
2026-04-30 17:53:23 +01:00
Andrew Nesbitt
78e1e76129
Merge pull request #100 from git-pkgs/dependabot/go_modules/modernc.org/sqlite-1.49.1
Bump modernc.org/sqlite from 1.48.2 to 1.49.1
2026-04-30 17:53:16 +01:00
dependabot[bot]
96049c1f88
Bump goreleaser/goreleaser-action from 7.0.0 to 7.1.0
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](ec59f474b9...e24998b8b6)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-30 15:18:13 +00:00
dependabot[bot]
3a68ccef3e
Bump modernc.org/sqlite from 1.48.2 to 1.49.1
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.48.2 to 1.49.1.
- [Changelog](https://gitlab.com/cznic/sqlite/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.48.2...v1.49.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-version: 1.49.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-30 15:18:04 +00:00
Andrew Nesbitt
4c53c77092
Merge pull request #98 from git-pkgs/cosign-v4-bundle
Use cosign v4 bundle format for release signing
2026-04-27 22:55:28 +01:00
Andrew Nesbitt
f9f2a6ecd4
Use cosign v4 bundle format for release signing 2026-04-27 21:26:23 +01:00
Andrew Nesbitt
1ad182782d
Add storage.direct_serve_base_url to override presigned URL host
When the proxy reaches storage at an internal address (127.0.0.1, a
Docker service name) the presigned URLs it generates point there too,
which is useless to external clients. This adds an optional base URL
that replaces the scheme and host of signed URLs before they're returned,
keeping the signed path and query intact.
2026-04-27 12:14:37 +01:00
Andrew Nesbitt
c73b0a35a1
Add direct-serve via presigned storage URLs
When storage.direct_serve is enabled and the backend supports it (S3,
Azure), cached artifact downloads return a 302 redirect to a presigned
URL instead of streaming bytes through the proxy. Falls back to
streaming when the backend can't sign (fileblob, local filesystem) or
signing fails.

Adds the azureblob driver so azblob:// storage URLs work.

Cache-hit accounting already happened before io.Copy so redirects are
counted correctly; the metrics calls are pulled into a helper so both
paths share them.

Closes #96
2026-04-27 12:04:38 +01:00
Andrew Nesbitt
9d316cf937
Merge pull request #94 from git-pkgs/dependabot/go_modules/github.com/git-pkgs/registries-0.4.1
Bump github.com/git-pkgs/registries from 0.4.0 to 0.4.1
2026-04-27 11:04:56 +01:00
Andrew Nesbitt
12f79dcca8
Merge pull request #95 from git-pkgs/dependabot/github_actions/zizmorcore/zizmor-action-0.5.3
Bump zizmorcore/zizmor-action from 0.5.2 to 0.5.3
2026-04-27 08:33:35 +01:00
dependabot[bot]
34be35cafa
Bump zizmorcore/zizmor-action from 0.5.2 to 0.5.3
Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.2 to 0.5.3.
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](71321a20a9...b1d7e1fb5d)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 15:21:27 +00:00
dependabot[bot]
d9d6e8735a
Bump github.com/git-pkgs/registries from 0.4.0 to 0.4.1
Bumps [github.com/git-pkgs/registries](https://github.com/git-pkgs/registries) from 0.4.0 to 0.4.1.
- [Commits](https://github.com/git-pkgs/registries/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: github.com/git-pkgs/registries
  dependency-version: 0.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 15:21:18 +00:00
Andrew Nesbitt
f58e3552d3
Merge pull request #88 from git-pkgs/dependabot/github_actions/docker/login-action-4.1.0
Bump docker/login-action from 4.0.0 to 4.1.0
2026-04-18 20:39:56 +01:00
Andrew Nesbitt
cbec55cba4
Merge pull request #89 from git-pkgs/dependabot/github_actions/docker/build-push-action-7.1.0
Bump docker/build-push-action from 7.0.0 to 7.1.0
2026-04-18 20:39:43 +01:00
Andrew Nesbitt
da517ad8f5
Merge pull request #90 from git-pkgs/dependabot/go_modules/modernc.org/sqlite-1.48.2
Bump modernc.org/sqlite from 1.48.0 to 1.48.2
2026-04-18 20:39:32 +01:00
Andrew Nesbitt
2571b0aed5
Merge pull request #91 from git-pkgs/dependabot/go_modules/github.com/lib/pq-1.12.3
Bump github.com/lib/pq from 1.12.2 to 1.12.3
2026-04-18 20:39:20 +01:00
Andrew Nesbitt
57eb063464
Merge pull request #92 from kpfleming/apply-go-fmt
Apply 'go fmt' as suggested in CONTRIBUTING.md.
2026-04-18 20:38:05 +01:00
c655399a07 Apply 'go fmt' as suggested in CONTRIBUTING.md. 2026-04-18 07:43:22 -04:00
dependabot[bot]
59a510f3f5
Bump github.com/lib/pq from 1.12.2 to 1.12.3
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.12.2 to 1.12.3.
- [Release notes](https://github.com/lib/pq/releases)
- [Changelog](https://github.com/lib/pq/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lib/pq/compare/v1.12.2...v1.12.3)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-version: 1.12.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 15:16:53 +00:00
dependabot[bot]
35f26f4645
Bump modernc.org/sqlite from 1.48.0 to 1.48.2
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.48.0 to 1.48.2.
- [Changelog](https://gitlab.com/cznic/sqlite/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.48.0...v1.48.2)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-version: 1.48.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 15:16:42 +00:00
dependabot[bot]
a1d028696d
Bump docker/build-push-action from 7.0.0 to 7.1.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](d08e5c354a...bcafcacb16)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 15:16:37 +00:00
dependabot[bot]
78325b6bf1
Bump docker/login-action from 4.0.0 to 4.1.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](b45d80f862...4907a6ddec)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 15:16:24 +00:00
Andrew Nesbitt
e3cc5516b5
Merge pull request #85 from git-pkgs/homebrew-readme
Add Homebrew install instructions
2026-04-13 11:07:59 +01:00
Andrew Nesbitt
50772d8947
Add Homebrew install instructions 2026-04-13 11:03:59 +01:00
Andrew Nesbitt
2816ff2414
Add LICENSE 2026-04-13 10:36:34 +01:00
Andrew Nesbitt
d3d11445c6
Merge pull request #84 from git-pkgs/cosign-signing
Sign release checksums with cosign keyless
2026-04-13 09:22:29 +01:00
Andrew Nesbitt
0c02455dc9
Sign release checksums with cosign keyless 2026-04-13 09:14:33 +01:00
Andrew Nesbitt
9849ac9f16
Merge pull request #40 from git-pkgs/mirror-feature
Add mirror command and API for selective package mirroring
2026-04-13 09:07:43 +01:00
Andrew Nesbitt
7346008aa5
Add metadata TTL and stale-while-revalidate support
Cached metadata is now served directly within a configurable TTL window
(default 5m) without contacting upstream, reducing latency and upstream
load. When upstream is unreachable and the cache is past its TTL, stale
content is served with a Warning: 110 header per RFC 7234.

New config: `metadata_ttl` (YAML) / `PROXY_METADATA_TTL` (env).
Set to "0" to always revalidate with upstream.
2026-04-13 09:01:05 +01:00
Andrew Nesbitt
c01f0a5c05
Fix metadata caching, 404 propagation, mirror progress, and registry stubs
- ProxyCached now stores upstream Last-Modified in the cache and uses it
  (along with ETag) for conditional request handling, returning 304 when
  client validators match. Adds Content-Length to cached responses.

- Handlers calling FetchOrCacheMetadata (pypi, composer, pub, nuget) now
  check for ErrUpstreamNotFound and return 404 instead of 502, matching
  the existing npm and cargo behavior.

- Mirror jobs report live progress via a periodic callback while running,
  so API polls return real counts instead of zeroed progress.

- Registry mirroring removed from CLI flags, API acceptance, README, and
  docs since every enumerator was a stub returning "not yet implemented".

- Added tests for the conditional metadata path (ETag/If-None-Match,
  Last-Modified/If-Modified-Since, 304 responses, header omission).
2026-04-13 09:01:05 +01:00
Andrew Nesbitt
47681066b5
Fix review issues in mirror feature
- Fix race where runJob could overwrite canceled state set by Cancel()
- Fix Debian ecosystem name inconsistency ("deb" -> "debian")
- Stream metadata responses when caching is disabled to avoid buffering
- Add metadata_cache table to initial schema strings for consistency
- Gate mirror API behind mirror_api config flag (disabled by default)
- Fix goconst lint in metadata_cache_test.go
2026-04-13 09:01:04 +01:00
Andrew Nesbitt
02738651ab
Fix concurrency, resource, and reliability issues in mirror
- Wire job contexts to server shutdown context so jobs are canceled on
  server stop instead of running indefinitely
- Defer context cancel in runJob so completed jobs don't leak contexts
- Cap error accumulation in progressTracker to 1000 entries to prevent
  OOM on large mirror operations with many failures
- Add panic recovery in errgroup workers to prevent process crashes
- Use defer for db.Close() in runMirror CLI to ensure cleanup on all
  error paths
2026-04-13 09:01:04 +01:00
Andrew Nesbitt
d62c42b8d7
Add mirror command and API for selective package mirroring
Add a `proxy mirror` CLI command and `/api/mirror` API endpoints that
pre-populate the cache from various input sources: individual PURLs,
SBOM files (CycloneDX and SPDX), or full registry enumeration.

The mirror reuses the existing handler.Proxy.GetOrFetchArtifact()
pipeline so cached artifacts are identical to those fetched on demand.
A bounded worker pool controls download parallelism.

Metadata caching is opt-in via `cache_metadata: true` in config (or
PROXY_CACHE_METADATA=true). The mirror command always enables it. When
enabled, upstream metadata responses are stored for offline fallback
with ETag-based conditional revalidation.

New internal/mirror package with Source interface, PURLSource,
SBOMSource, RegistrySource, and async JobStore. New metadata_cache
database table for offline metadata serving.
2026-04-13 09:01:04 +01:00
Andrew Nesbitt
7985a28839
Merge pull request #79 from git-pkgs/fix-metadata-size-limit
Fix silent truncation of large npm metadata responses
2026-04-13 08:47:31 +01:00
Andrew Nesbitt
773fe55bd9
Merge pull request #80 from git-pkgs/dependabot/go_modules/github.com/git-pkgs/vulns-0.1.4
Bump github.com/git-pkgs/vulns from 0.1.3 to 0.1.4
2026-04-10 15:42:53 +01:00
Andrew Nesbitt
d919d9ce3e
Merge pull request #82 from git-pkgs/dependabot/go_modules/modernc.org/sqlite-1.48.0
Bump modernc.org/sqlite from 1.47.0 to 1.48.0
2026-04-10 10:54:00 +01:00
dependabot[bot]
73d78c28fb
Bump github.com/git-pkgs/vulns from 0.1.3 to 0.1.4
Bumps [github.com/git-pkgs/vulns](https://github.com/git-pkgs/vulns) from 0.1.3 to 0.1.4.
- [Commits](https://github.com/git-pkgs/vulns/compare/v0.1.3...v0.1.4)

---
updated-dependencies:
- dependency-name: github.com/git-pkgs/vulns
  dependency-version: 0.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-10 09:53:57 +00:00
Andrew Nesbitt
7d0ac94c6c
Merge pull request #81 from git-pkgs/dependabot/go_modules/github.com/git-pkgs/enrichment-0.2.2
Bump github.com/git-pkgs/enrichment from 0.2.1 to 0.2.2
2026-04-10 10:53:21 +01:00
Andrew Nesbitt
5c4f6f3b85
Merge pull request #83 from git-pkgs/dependabot/go_modules/github.com/lib/pq-1.12.2
Bump github.com/lib/pq from 1.12.0 to 1.12.2
2026-04-10 10:52:37 +01:00
dependabot[bot]
497afdf317
Bump github.com/lib/pq from 1.12.0 to 1.12.2
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.12.0 to 1.12.2.
- [Release notes](https://github.com/lib/pq/releases)
- [Changelog](https://github.com/lib/pq/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lib/pq/compare/v1.12.0...v1.12.2)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-version: 1.12.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-09 15:24:54 +00:00
dependabot[bot]
55db8f94fc
Bump modernc.org/sqlite from 1.47.0 to 1.48.0
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.47.0 to 1.48.0.
- [Changelog](https://gitlab.com/cznic/sqlite/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.47.0...v1.48.0)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-version: 1.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-09 15:24:50 +00:00
dependabot[bot]
d64fcb5b98
Bump github.com/git-pkgs/enrichment from 0.2.1 to 0.2.2
Bumps [github.com/git-pkgs/enrichment](https://github.com/git-pkgs/enrichment) from 0.2.1 to 0.2.2.
- [Commits](https://github.com/git-pkgs/enrichment/compare/v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: github.com/git-pkgs/enrichment
  dependency-version: 0.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-09 15:24:42 +00:00
Andrew Nesbitt
01b4e7210d
Use abbreviated npm metadata when cooldown is disabled
Request application/vnd.npm.install-v1+json from the npm registry
when cooldown filtering is not enabled. This format strips READMEs
and other bulk data, reducing drizzle-orm metadata from 92MB to 4MB.

Fall back to full metadata when cooldown is enabled since the
abbreviated format lacks the time map needed for publish-date filtering.
2026-04-08 16:12:43 +01:00
Andrew Nesbitt
8b762ffb39
Fix silent truncation of large npm metadata responses
ReadMetadata used io.LimitReader which silently truncated responses at
the size limit. For packages like drizzle-orm (~92MB metadata), this
produced invalid JSON that was served to clients.

Now returns ErrMetadataTooLarge when the limit is exceeded, and bumps
the limit from 50MB to 100MB.

Fixes #78
2026-04-08 16:02:30 +01:00
Andrew Nesbitt
94f4a7dfa6
Merge pull request #77 from kpfleming/sort-ecosystems-for-ui
Sort the ecosystems list for presentation in the UI
2026-04-07 08:45:52 +01:00
a947a7546a Sort the ecosystems list for presentation in the UI
In the page footer and the 'select' list on the packages page, the
list of ecosystems should be sorted in a predictable order.
2026-04-06 18:06:16 -04:00