GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Alpine APK repository proxy support by pinguinfuss · Pull Request #293 · git-pkgs/proxy

Conversation

@pinguinfuss

@pinguinfuss pinguinfuss commented Aug 29, 2026

Copy link
Copy Markdown
Contributor
  • Serve named APK repositories at /apk/{repository}/ with the official Alpine mirror as the default repository
  • Cache v2 APKINDEX.tar.gz and v3 Packages.adb indexes and detached signatures via the metadata cache, serving stored bytes unchanged so apk signature verification keeps working
  • Cache .apk packages in the shared artifact cache keyed by the full repository path, since APK filenames do not include the architecture
  • Add configurable upstream repositories via upstream.apk with validation, plus dashboard registry instructions
  • Add tests for index/signature byte fidelity, per-arch caching, cache hits, offline reads, upstream authentication, and 404 handling
  • Document apk usage in README, config example, and configuration docs

Related to #262

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
pinguinfuss and others added 2 commits August 29, 2026 18:04
@pinguinfuss
Add Alpine APK repository proxy support
9d71904
- Serve named APK repositories at /apk/{repository}/ with the official
  Alpine mirror as the default repository
- Cache v2 APKINDEX.tar.gz and v3 Packages.adb indexes and detached
  signatures via the metadata cache, serving stored bytes unchanged so
  apk signature verification keeps working
- Cache .apk packages in the shared artifact cache keyed by the full
  repository path, since APK filenames do not include the architecture
- Add configurable upstream repositories via upstream.apk with
  validation, plus dashboard registry instructions
- Add tests for index/signature byte fidelity, per-arch caching, cache
  hits, offline reads, upstream authentication, and 404 handling
- Document apk usage in README, config example, and configuration docs
@pinguinfuss
Merge branch 'main' into alpine-apk-support
7cd7cdc
@andrew
andrew requested a lite review from Copilot August 29, 2026 17:57
Copilot started reviewing on behalf of andrew August 29, 2026 17:58
View session
Copilot AI reviewed Aug 29, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds Alpine APK repository proxy support to the proxy server, enabling read-only caching and proxying of Alpine repository metadata and .apk packages via a new /apk/{repository}/... endpoint, with configurable upstream repositories.

Changes:

  • Add a new /apk handler that proxies Alpine repository paths and caches indexes/signatures (metadata cache) and packages (artifact cache).
  • Extend configuration to support upstream.apk named repositories with validation and update dashboard/README/docs accordingly.
  • Add test coverage for APK routing, cache behavior (including offline reads), per-architecture package caching, and upstream auth.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Documents APK usage and marks Alpine as supported.
internal/server/server.go Wires the new APK handler and mounts it at /apk.
internal/server/dashboard.go Adds Alpine to supported ecosystem UI and adds APK registry instructions.
internal/handler/notfound_ecosystems_test.go Extends 404 behavior coverage to APK package downloads.
internal/handler/apk.go Implements the APK proxy/caching handler (new).
internal/handler/apk_test.go Adds handler tests for parsing, caching, offline reads, auth, and collision avoidance (new).
internal/config/config.go Adds upstream.apk config and validates named upstreams.
internal/config/config_test.go Adds validation tests for APK upstream names/URLs.
docs/configuration.md Documents upstream.apk behavior and caching semantics.
config.example.yaml Adds example configuration for APK upstreams.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/handler/apk.go Outdated
if result.ContentType == "" {
result.ContentType = "application/octet-stream"
}
ServeArtifact(w, result)

@pinguinfuss pinguinfuss Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 5b0c32a. The handler now uses the method-aware serveArtifact helper (same pattern as container.go), so HEAD responses carry Content-Length but omit the body. Added a regression test.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/handler/apk.go
Comment on lines +141 to +144
func (h *APKHandler) handleMetadata(w http.ResponseWriter, r *http.Request, repository, upstreamURL, path string) {
h.proxy.ProxyCached(w, r, upstreamURL+"/"+path, apkEcosystem,
h.metadataCacheKey(repository, upstreamURL, path), "*/*")
}

@pinguinfuss pinguinfuss Aug 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mechanism is real, but it isn't specific to this PR: the code path is the shared fetchUpstreamMetadata in internal/handler/handler.go, and the debian, rpm, helm, and conda handlers go through exactly the same transport behavior for their signed/hash-pinned metadata. This handler only inherits it.

A narrow fix here would also be incomplete: explicitly setting Accept-Encoding: identity disables Go's transparent decompression, but an upstream that mislabels stored .gz objects with Content-Encoding: gzip would then have its raw gzip bytes cached and re-served without that header — the metadata cache stores a content type but no content encoding. Doing this properly means persisting/forwarding Content-Encoding in the metadata cache and fixing all ecosystems at once.

I'd prefer to track that as a separate hardening issue against the shared metadata fetch path rather than grow this PR's scope.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
pinguinfuss and others added 2 commits August 29, 2026 23:26
@pinguinfuss
Serve APK package HEAD requests without a body
5b0c32a
Use the method-aware serveArtifact helper (as container.go does) so HEAD
responses carry Content-Length but omit the body; add a regression test.
@andrew
Drop doubled blank line in docs/configuration.md
d6d93c2
andrew
andrew approved these changes Sep 2, 2026
View reviewed changes

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follows the debian/rpm/helm handler shape and covers everything in #262. Agree the transparent-gzip point is a shared fetchUpstreamMetadata concern, not this PR's — I'll track that separately. Thanks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andrew
andrew merged commit 4b9b401 into git-pkgs:main Sep 2, 2026
@andrew andrew mentioned this pull request Sep 2, 2026
Metadata cache can store transport-decompressed bytes for signed indexes #300
Closed
@pinguinfuss
pinguinfuss deleted the alpine-apk-support branch September 3, 2026 04:33
@pinguinfuss pinguinfuss mentioned this pull request Oct 4, 2026
Add Alpine APK repository proxy support #262
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@andrew andrew andrew approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@pinguinfuss @andrew
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.