Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmd/api/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ type Config struct {
// Build system configuration
MaxConcurrentSourceBuilds int // Max concurrent source-to-image builds
BuilderImage string // OCI image for builder VMs
RegistryURL string // URL of registry for built images
RegistryURL string // URL of registry for built images (http:// or https://)
RegistryInsecure bool // Skip TLS verification for HTTPS registries (for self-signed certs)
RegistryCACertFile string // Path to CA cert file for registry (enables TLS + auth with self-signed certs)
BuildTimeout int // Default build timeout in seconds
BuildSecretsDir string // Directory containing build secrets (optional)

Expand Down Expand Up @@ -209,6 +211,8 @@ func Load() *Config {
MaxConcurrentSourceBuilds: getEnvInt("MAX_CONCURRENT_SOURCE_BUILDS", 2),
BuilderImage: getEnv("BUILDER_IMAGE", "hypeman/builder:latest"),
RegistryURL: getEnv("REGISTRY_URL", "localhost:8080"),
RegistryInsecure: getEnvBool("REGISTRY_INSECURE", false), // Set true for self-signed certs
RegistryCACertFile: getEnv("REGISTRY_CA_CERT_FILE", ""), // Path to CA cert for self-signed registry
BuildTimeout: getEnvInt("BUILD_TIMEOUT", 600),
BuildSecretsDir: getEnv("BUILD_SECRETS_DIR", ""), // Optional: path to directory with build secrets

Expand Down
6 changes: 6 additions & 0 deletions cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,13 @@ func run() error {
r.Use(middleware.RealIP)
r.Use(middleware.Logger)
r.Use(middleware.Recoverer)
r.Use(mw.InjectLogger(logger)) // Inject logger for debug logging in JwtAuth
r.Use(mw.JwtAuth(app.Config.JwtSecret))

// Token endpoint for Docker registry authentication
// This is handled by JwtAuth middleware as unauthenticated
r.Handle("/token", app.TokenHandler)

r.Mount("/", app.Registry.Handler())
})

Expand Down
2 changes: 2 additions & 0 deletions cmd/api/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type application struct {
ResourceManager *resources.Manager
VMMetricsManager *vm_metrics.Manager
Registry *registry.Registry
TokenHandler *registry.TokenHandler
ApiService *api.ApiService
}

Expand All @@ -60,6 +61,7 @@ func initializeApp() (*application, func(), error) {
providers.ProvideResourceManager,
providers.ProvideVMMetricsManager,
providers.ProvideRegistry,
providers.ProvideTokenHandler,
api.New,
wire.Struct(new(application), "*"),
))
Expand Down
3 changes: 3 additions & 0 deletions cmd/api/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ require (
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-test/deep v1.1.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/subcommands v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/go-containerregistry v0.20.6 h1:cvWX87UxxLgaH76b4hIvya6Dzz9qHB31qAwjAohdSTU=
github.com/google/go-containerregistry v0.20.6/go.mod h1:T0x8MuoAoKX/873bkeSfLD2FAkwCDf9/HZgsFJ02E2Y=
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down
Loading