Watch
1
0
Fork
You've already forked pkg-proxy
1
mirror of https://github.com/git-pkgs/proxy.git synced 2026-11-11 16:49:17 -05:00
Commit graph pkg-proxy/internal/server
Author SHA1 Message Date
Andrew Nesbitt
a41b8df685
Merge pull request #675 from simonchrz/feat/git-cache-ui
List cached Git repositories in the UI and metrics
2026-11-11 14:38:52 +00:00
Simon Chrzanowski
4a317730da Keep a repository's state until its refs are written
The state shown on the git page was read again after every check of the
upstream, and a check runs on every client info/refs. On a busy proxy
each view then read the same repositories again and never got past what
fits in two seconds.

The state is now kept until the repository's refs or HEAD are written: by
a clone, a fetch, a fetch of wanted commits, or a change of the default
branch. A check that finds nothing new leaves it in place.

A state that fails to read for another reason than the view's deadline is
now logged at warn with the repository key.
2026-11-10 17:47:20 +01:00
Andrew Nesbitt
69a5e15a9b
Merge pull request #671 from milas/milas/s3-fixes
fix(s3): valid direct serve pre-signed URLs for alternate hosts
2026-11-10 16:42:23 +00:00
Andrew Nesbitt
4446438571
Merge pull request #701 from simonchrz/feat/retention-keep-latest
Add storage.retention.keep_latest to keep the newest versions
2026-11-10 16:32:10 +00:00
Andrew Nesbitt
bb6fb2bb37
Document public-host signing for direct_serve_base_url
Also marks the AWS modules as direct dependencies and drops comments that restate function names.
2026-11-10 16:26:30 +00:00
Andrew Nesbitt
fa38de81de
Merge remote-tracking branch 'origin/main' into pr-671
# Conflicts:
#	internal/storage/blob.go
2026-11-10 16:26:30 +00:00
Andrew Nesbitt
0f85f6daba
Merge pull request #690 from simonchrz/fix/debian-conan-cache-keys
Key Debian and Conan archives by their whole path
2026-11-10 16:24:41 +00:00
Simon Chrzanowski
b731648123 Add storage.retention.keep_latest to keep the newest versions
Retention evicts every file that has not been served for the configured
time, also the newest version of a package. keep_latest: N holds back
the files of the N highest cached versions of each package from
eviction by age. Versions are ordered by the ecosystem's version rules.

It applies to cargo, golang, npm and pypi, where the cache stores a
release under its version. Other ecosystems ignore it for now.
2026-11-10 16:33:21 +01:00
Andrew Nesbitt
560ad5cda2
Merge pull request #645 from simonchrz/feat/mirror-refresh
Refresh the most used packages in the background
2026-11-10 12:11:31 +00:00
Simon Chrzanowski
c878b0c090 Bound what a view of the git page spends on reading repositories
A view ran four git processes for each repository whose state wasn't
cached, with no limit, and each concurrent view did the same.

RepositoryState now runs one read at a time and gives up with its
context. The page reads for at most two seconds, lists the rest without
branches and commits, and says how many are left; the cache keeps what
was read, so each reload reads more.

Also test that an upstream, a repos pattern and a repository with
uppercase letters are listed as spelled, and correct two comments.
2026-11-10 07:00:03 +01:00
Simon Chrzanowski
4c3c925cd1 Key Debian and Conan archives by their whole path
A Debian package was cached under its repository and file name, but
fetched from its full path. Docker's apt repository has a pool under each
suite with the same file names, so a bookworm client could get the
bullseye build that was fetched first, and fail its hash check. Packages
are now cached under their path.

Conan joined revision, package reference, package revision and file name
with underscores, which revisions can contain, so a recipe file and a
package file could share a cache entry. The parts are now joined with
slashes.

Entries cached under the old names are still served, but only for the
URL they were fetched from, so warm caches keep working.
2026-11-09 17:44:19 +01:00
Simon Chrzanowski
e6c3b1e64e Keep the git page to what /git serves
Since main gained the repos allowlist and the refusal of repositories the
upstream refused, the page could still list a repository the allowlist no
longer allows and show the cached commit of one the upstream refused.
Repositories now reports Refused, and the page leaves out what the
allowlist doesn't allow and shows no cached state for a refused one.
2026-11-09 10:44:47 +01:00
Simon Chrzanowski
314c23b46e Merge remote-tracking branch 'origin/main' into feat/git-cache-ui
# Conflicts:
#	docs/configuration.md
2026-11-09 10:17:51 +01:00
Simon Chrzanowski
64eb09e674 Warn when mirror.refresh runs without cache_metadata
The docs say refreshing Debian, Alpine and RPM packages needs
cache_metadata, but nothing said so when it was off. Rejecting the
setting would also stop the refresh of every other ecosystem, so the
server logs a warning from the new Config.Warnings at startup.
2026-11-08 10:12:37 +01:00
Simon Chrzanowski
38db7d1c0a Escape the git page's clone URLs
Repository paths can hold spaces, '#', '?' or '%', as Azure DevOps
project and repository names do, so each segment is escaped as the LFS
URLs are. The requests label also uses plural() now.
2026-11-08 10:08:41 +01:00
Simon Chrzanowski
abdda9857f Report the git cache under gauges of its own
Git LFS objects are artifacts under ecosystem git, so adding the
repositories to the per-ecosystem gauges mixed the two and broke the
per-ecosystem figures adding up to the totals. The git cache now has
proxy_git_cache_size_bytes and proxy_git_cached_repositories, updated
on each tick apart from the database gauges so a failed stats query
leaves them current.
2026-11-08 10:08:10 +01:00
Simon Chrzanowski
cbbeed423b Cache RPM packages under their full path
RPM packages were cached under their bare filename. With upstream.rpm
pointing at a mirror root that serves several distributions, Rocky and
Alma both publish bash-5.1.8-9.el9.x86_64.rpm with different bytes, and
whichever was fetched first was served for both, so dnf failed the
checksum or signature check.

Use the path under the upstream as the cache filename, as the APK and
Arch handlers do. Packages cached before this change are no longer
found and are fetched again once; retention still matches them by
package name.
2026-11-08 07:56:52 +01:00
Milas Bowman
163665f4dc
Merge remote-tracking branch 'upstream/main' into milas/s3-fixes 2026-11-07 17:09:37 -05:00
Milas Bowman
dadc94dd62
chore: add some godoc on modified complex funcs 2026-11-07 17:06:44 -05:00
Milas Bowman
e4bc1f5f11
fix: do not prepend host on signing 2026-11-07 16:50:24 -05:00
Simon Chrzanowski
2b525dc442 Count the git page's summary from its rows, and keep failed state reads
The summary said "1 repositories" and counted the size of repositories it
didn't list. A repository whose state can't be read is no longer read on
every page view, only after its next upstream check.
2026-11-07 17:57:07 +01:00
Simon Chrzanowski
f867f3d5a1 List cached Git repositories in the UI and the ecosystem gauges
/ui/git lists the git cache's repositories with their upstream, clone URL,
size, last check and use, requests served and the last refresh error. The
per-ecosystem cache size and artifact gauges report the git cache as
ecosystem="git".
2026-11-07 17:43:20 +01:00
Simon Chrzanowski
c0ae2e98b3 Merge remote-tracking branch 'origin/main' into feat/mirror-refresh
# Conflicts:
#	internal/database/schema.go
2026-11-07 17:01:32 +01:00
Andrew Nesbitt
72aa8fdc43
Merge pull request #667 from simonchrz/feat/mirror-git
Mirror pkg:git commits into the git cache
2026-11-07 14:58:02 +00:00
Andrew Nesbitt
f153a83b3a
Cover Fedora updates and Conda defaults in setup docs 2026-11-07 09:46:54 +00:00
Milas Bowman
909e2e464a
fix(s3): signatures for alternate hosts 2026-11-06 19:28:45 -05:00
Andrew Nesbitt
292ecc1488
Correct package manager configuration examples 2026-11-06 22:36:47 +00:00
Andrew Nesbitt
563f58e5cc
Merge pull request #666 from git-pkgs/cooldown-profiles
Add cooldown profiles selected by registry URL
2026-11-06 09:59:37 +00:00
Andrew Nesbitt
0ed91b5872
Redact storage passwords in startup logs 2026-11-06 09:20:43 +00:00
Simon Chrzanowski
03be03b8fe Mirror pkg:git commits into the git cache
proxy mirror, mirror API jobs and SBOMs take pkg:git/{host}/{path}@{commit}
and cache the repository and commit in the cache /git serves, so a later
clone is a cache hit, also with the upstream down. Part of #403.
2026-11-06 07:48:51 +01:00
Andrew Nesbitt
79be33049a
Add cooldown profiles selected by registry URL 2026-11-05 21:42:44 +00:00
Andrew Nesbitt
308cc133ab
Remove connection details from stats response 2026-11-05 15:09:16 +00:00
Simon Chrzanowski
6f3e8c6f7e Merge remote-tracking branch 'origin/main' into feat/mirror-refresh
# Conflicts:
#	internal/database/schema.go
2026-11-05 13:50:08 +01:00
Simon Chrzanowski
903fd94df9 Test that apk index errors leave out the URL 2026-11-05 12:34:32 +01:00
Simon Chrzanowski
5c46a39b2d Merge remote-tracking branch 'origin/main' into feat/mirror-refresh
# Conflicts:
#	internal/database/schema.go
2026-11-05 12:21:49 +01:00
Simon Chrzanowski
4d70793351 Name the apk repository in mirror errors 2026-11-05 11:56:42 +01:00
Simon Chrzanowski
1e916bf334 Merge remote-tracking branch 'origin/main' into feat/project-inventory 2026-11-05 10:47:14 +01:00
Simon Chrzanowski
7095ab67ef Keep the Projects link on an empty projects page
ProjectsListData.Projects hid Layout.Projects, so the header left the
link out when no project had been uploaded.
2026-11-04 16:16:35 +01:00
Simon Chrzanowski
4e25396331 Refuse distro qualifiers that aren't an Alpine release 2026-11-04 16:09:00 +01:00
Simon Chrzanowski
adcda6ca8b Read APKINDEX.tar.gz also where Packages.adb is served beside it 2026-11-04 15:54:10 +01:00
Simon Chrzanowski
3e2a84a88a Mirror Alpine packages
The PURL namespace names the upstream.apk repository, and the distro and
arch qualifiers syft writes give the release and architecture. The package
is looked up in the main and community indexes of that release and cached
under the path the APK handler serves it from.
2026-11-04 15:44:01 +01:00
Simon Chrzanowski
e358666482 Merge remote-tracking branch 'origin/main' into feat/project-inventory
# Conflicts:
#	internal/database/database_test.go
#	internal/database/schema.go
#	internal/server/server.go
2026-11-04 13:19:09 +01:00
Andrew Nesbitt
5b10559636
Merge pull request #639 from simonchrz/feat/cooldown-withheld-versions
Show versions held back by cooldown on the package page and in the API
2026-11-04 12:01:24 +00:00
Simon Chrzanowski
683455aecb Test available_at through the API and drop FillVersionPublishedAt
The API handler takes the enrichment calls it uses as an interface, so
the test can answer them without reaching a registry.

Remove FillVersionPublishedAt until the shared cooldown filter calls it.
2026-11-03 14:39:36 +01:00
Simon Chrzanowski
8aebf94f5d Merge remote-tracking branch 'origin/main' into feat/change-feeds
# Conflicts:
#	go.mod
#	go.sum
2026-11-03 11:23:40 +01:00
Simon Chrzanowski
83524b7485 Merge remote-tracking branch 'origin/main' into feat/cooldown-withheld-versions 2026-11-03 11:23:22 +01:00
Andrew Nesbitt
c1a1149bd8
Merge pull request #622 from simonchrz/feat/apk-snapshots
Serve dated snapshots of Alpine APK indexes
2026-11-03 09:36:40 +00:00
Simon Chrzanowski
98ff4fd4a2 Merge remote-tracking branch 'origin/main' into feat/npm-stream-rewrite
# Conflicts:
#	cmd/proxy/main.go
2026-11-01 12:54:47 +01:00
Simon Chrzanowski
b08cebf9e4 Cap npm packuments streamed into storage
metadata_max_size bounds what is read into memory, but a packument
streamed from upstream into storage had no limit, and with cooldown was
stored twice. It is now capped by metadata_stream_max_size, 1 GB by
default. A document over the cap fails as an upstream failure: nothing is
stored, and the stored copy, if any, is served instead.

The metadata settings move into configureMetadata to keep serve under
the maintidx limit.
2026-11-01 12:53:00 +01:00
Simon Chrzanowski
7b91897fbb Merge remote-tracking branch 'origin/main' into feat/apk-snapshots
# Conflicts:
#	internal/server/server.go
2026-11-01 12:44:35 +01:00