Compare commits

..

2 Commits

Author SHA1 Message Date
hgw
579a2ac26b
Improve Dockerfile 2023-12-10 05:21:33 +00:00
hgw
a1e18fa2e9
Set shred time back to 24 hours 2023-12-10 05:19:35 +00:00
3 changed files with 8 additions and 3 deletions

View File

@ -1,8 +1,12 @@
FROM golang:1.21-alpine
WORKDIR /app
FROM golang:1.21-alpine as builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -o hardfiles main.go
FROM golang:1.21-alpine as app
WORKDIR /app
COPY --from=builder /build/hardfiles .
RUN mkdir files
CMD ["./hardfiles"]

View File

@ -2,6 +2,7 @@ services:
hardfiles:
container_name: hardfiles
image: git.supernets.org/supernets/hardfiles:latest
build: .
volumes:
- "$PWD/files:/app/files"
- "$PWD/www:/app/www"

View File

@ -120,7 +120,7 @@ func CheckFile(name string) bool { // false if doesn't exist, true if exists
func UploadHandler(w http.ResponseWriter, r *http.Request) {
// expiry sanitize
twentyfour := int64(10)
twentyfour := int64(86400)
file, _, err := r.FormFile("file")
if err != nil {