Skip to content
Merged
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
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
4 changes: 2 additions & 2 deletions internal/runner/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 4 additions & 3 deletions pkg/httpserver/httpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down