Skip to content

Add registry provider as sync source for Docker Registry V2 API#11

Merged
BadgerOps merged 2 commits into
masterfrom
claude/review-next-tasks-ZvJfq
Feb 27, 2026
Merged

Add registry provider as sync source for Docker Registry V2 API#11
BadgerOps merged 2 commits into
masterfrom
claude/review-next-tasks-ZvJfq

Conversation

@BadgerOps

Copy link
Copy Markdown
Owner

Summary

This PR adds support for using the registry provider type as a sync source, enabling airgap to enumerate repository tags via the Docker Registry V2 API and download container image manifests and blobs locally. Previously, the registry provider only supported push operations.

Key Changes

  • New Registry Sync Provider (internal/provider/registry/provider.go):

    • Implements Provider interface for syncing container images from remote registries
    • Supports Docker Registry V2 API for tag enumeration and manifest/blob fetching
    • Handles bearer token authentication and basic auth for private registries
    • Implements manifest parsing for both OCI and Docker image formats (indexes and manifests)
    • Validates downloaded artifacts using SHA256 checksums
    • Supports tag filtering via glob patterns
    • Deduplicates and normalizes repository names
  • Configuration Updates (internal/config/config.go):

    • Extended RegistryProviderConfig to support sync source mode with:
      • Repositories: list of repositories to enumerate
      • Tags: optional glob patterns for tag filtering
      • OutputDir: directory for storing downloaded manifests/blobs
    • Maintains backward compatibility for push-only mode when Repositories is empty
  • UI Enhancements (internal/server/templates/providers.html):

    • Updated registry provider configuration form to support both sync source and push target modes
    • Added textarea for multi-line repository input
    • Added tag filter configuration
    • Clarified dual-purpose nature of registry provider
  • Provider Registration (cmd/airgap/root.go):

    • Registered new registry sync provider in the provider registry
  • Testing (internal/provider/registry/provider_test.go):

    • Comprehensive test suite covering configuration, tag filtering, manifest parsing, validation, and sync operations
    • Mock HTTP server tests for registry API interactions
  • Documentation Updates:

    • Updated AGENTS.md to reflect registry provider's dual role
    • Updated CHANGELOG.md with v0.4.0 release notes
  • UI Improvements:

    • Added sync history display in provider detail view
    • Added version display in sidebar
    • Added empty state message on dashboard

Implementation Details

  • Registry V2 API Support: Implements standard Docker Registry V2 API endpoints for tag listing, manifest fetching, and blob downloading
  • Authentication: Supports both bearer token (OAuth2) and basic authentication flows
  • Manifest Handling: Recursively processes image indexes and manifests to discover all dependent blobs
  • Checksum Validation: Validates downloaded artifacts against SHA256 digests from registry responses
  • Path Safety: Uses safety utilities to prevent directory traversal attacks
  • Resource Limits: Enforces size limits on HTTP responses to prevent memory exhaustion

https://claude.ai/code/session_01SdEa9sX3wtA8Haq92LiCry

Implement the registry provider as a sync source that enumerates
repository tags via the Docker Registry V2 API and downloads manifests
and blobs locally. The provider supports bearer token auth, tag glob
filtering, and checksum-based skip/update logic.

UI/UX improvements:
- Dashboard shows empty state with "Get Started" prompt when no providers exist
- Provider detail page displays sync history table (last 10 runs)
- Sidebar version is now dynamic (from build-time ldflags, not hardcoded)
- Registry provider form split into sync source and push target sections

https://claude.ai/code/session_01SdEa9sX3wtA8Haq92LiCry
Suppress unchecked error returns from json.Encode, w.Write, and
fmt.Fprint in test HTTP handlers to satisfy golangci-lint errcheck.

https://claude.ai/code/session_01SdEa9sX3wtA8Haq92LiCry
@BadgerOps BadgerOps merged commit 05c1059 into master Feb 27, 2026
3 checks passed
@BadgerOps BadgerOps deleted the claude/review-next-tasks-ZvJfq branch February 27, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants