Skip to content

Commit

Permalink
fix for validating foreign blobs
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Martin <adam.martin@rancherfederal.com>
  • Loading branch information
amartin120 committed Dec 18, 2023
1 parent 7751b12 commit 4dbff83
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 4dbff83

Please sign in to comment.