feat: stand-alone port s3 server (#6242)

* feat: single port s3 server

* fix: unable to PUT files if not in root dir
This commit is contained in:
itsHenry
2024-03-24 15:16:00 +08:00
committed by GitHub
parent 022e0ca292
commit 9c84b6596f
9 changed files with 70 additions and 21 deletions

View File

@ -11,7 +11,7 @@ import (
)
// Make a new S3 Server to serve the remote
func NewServer(ctx context.Context, authpair []string) (h http.Handler, err error) {
func NewServer(ctx context.Context) (h http.Handler, err error) {
var newLogger logger
faker := gofakes3.New(
newBackend(),
@ -19,7 +19,7 @@ func NewServer(ctx context.Context, authpair []string) (h http.Handler, err erro
gofakes3.WithLogger(newLogger),
gofakes3.WithRequestID(rand.Uint64()),
gofakes3.WithoutVersioning(),
gofakes3.WithV4Auth(authlistResolver(authpair)),
gofakes3.WithV4Auth(authlistResolver()),
gofakes3.WithIntegrityCheck(true), // Check Content-MD5 if supplied
)