diff --git a/Dockerfile b/Dockerfile index ebec407..806904b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,7 @@ -FROM golang:1.16-alpine AS builder -RUN apk add --no-cache git +FROM golang:1.16-alpine as build-env RUN GO111MODULE=on go get -v github.com/projectdiscovery/simplehttpserver/cmd/simplehttpserver FROM alpine:latest RUN apk add --no-cache bind-tools ca-certificates -COPY --from=builder /go/bin/simplehttpserver /usr/local/bin/ - -ENTRYPOINT ["simplehttpserver"] +COPY --from=build-env /go/bin/simplehttpserver /usr/local/bin/simplehttpserver +ENTRYPOINT ["simplehttpserver"] \ No newline at end of file diff --git a/internal/runner/banner.go b/internal/runner/banner.go index f727190..a6b729d 100644 --- a/internal/runner/banner.go +++ b/internal/runner/banner.go @@ -8,11 +8,11 @@ const banner = ` \__ \/ / __ -__ \/ __ \/ / _ \/ /_/ / / / / / / /_/ / ___/ _ \/ ___/ | / / _ \/ ___/ ___/ / / / / / / / /_/ / / __/ __ / / / / / / ____(__ ) __/ / | |/ / __/ / /____/_/_/ /_/ /_/ .___/_/\___/_/ /_/ /_/ /_/ /_/ /____/\___/_/ |___/\___/_/ - /_/ - v0.0.2 + /_/ - v0.0.3 ` // Version is the current version -const Version = `0.0.2` +const Version = `0.0.3` // showBanner is used to show the banner to the user func showBanner() { diff --git a/pkg/httpserver/httpserver.go b/pkg/httpserver/httpserver.go index 1747017..d516caf 100644 --- a/pkg/httpserver/httpserver.go +++ b/pkg/httpserver/httpserver.go @@ -32,12 +32,13 @@ func New(options *Options) (*HTTPServer, error) { var h HTTPServer EnableUpload = options.EnableUpload EnableVerbose = options.Verbose - layers := h.loglayer(http.FileServer(http.Dir(options.Folder))) + h.layers = h.loglayer(http.FileServer(http.Dir(options.Folder))) if options.BasicAuthUsername != "" || options.BasicAuthPassword != "" { - layers = h.loglayer(h.basicauthlayer(http.FileServer(http.Dir(options.Folder)))) + h.layers = h.loglayer(h.basicauthlayer(http.FileServer(http.Dir(options.Folder)))) } + h.options = options - return &HTTPServer{options: options, layers: layers}, nil + return &h, nil } // ListenAndServe requests over http