Skip to content

Commit

Permalink
Merge pull request #149 from amartin120/registry-serve-fix
Browse files Browse the repository at this point in the history
fix for validating foreign blobs
  • Loading branch information
amartin120 authored Dec 18, 2023
2 parents f129484 + 4dbff83 commit 8cfe443
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/hauler/cli/store/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ func (o *ServeOpts) defaultConfig() *configuration.Configuration {
// "maintenance": configuration.Parameters{"readonly.enabled": false},
},
}

// Add validation configuration
cfg.Validation.Manifests.URLs.Allow = []string{".+"}

cfg.Log.Level = "info"
cfg.HTTP.Addr = fmt.Sprintf(":%d", o.Port)
cfg.HTTP.Headers = http.Header{
Expand Down
3 changes: 3 additions & 0 deletions internal/server/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func NewTempRegistry(ctx context.Context, root string) *tmpRegistryServer {
"filesystem": configuration.Parameters{"rootdirectory": root},
},
}
// Add validation configuration
cfg.Validation.Manifests.URLs.Allow = []string{".+"}

cfg.Log.Level = "error"
cfg.HTTP.Headers = http.Header{
"X-Content-Type-Options": []string{"nosniff"},
Expand Down

0 comments on commit 8cfe443

Please # to comment.