mirror of
https://github.com/hacdias/webdav.git
synced 2024-04-21 12:32:06 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c5420aa5a | ||
|
|
30c210d097 | ||
|
|
f408f7aa6f | ||
|
|
e9cd29578e | ||
|
|
e0020e8110 | ||
|
|
2078312ec8 | ||
|
|
05e995b11b | ||
|
|
c4d4734095 | ||
|
|
cf267c1006 |
@@ -2,25 +2,26 @@ version: 2
|
||||
jobs:
|
||||
lint:
|
||||
docker:
|
||||
- image: golangci/golangci-lint:v1.16
|
||||
- image: golangci/golangci-lint:v1.30
|
||||
steps:
|
||||
- checkout
|
||||
- run: golangci-lint run -v
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/golang:1.12
|
||||
- image: circleci/golang:1.14
|
||||
steps:
|
||||
- checkout
|
||||
- run: go build main.go
|
||||
release:
|
||||
docker:
|
||||
- image: circleci/golang:1.12
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker
|
||||
- go/install
|
||||
- run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||
- run: curl -sL https://git.io/goreleaser | bash
|
||||
- run: docker logout
|
||||
orbs:
|
||||
go: circleci/go@1.14
|
||||
workflows:
|
||||
version: 2
|
||||
build-workflow:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
- CGO_ENABLED=0
|
||||
|
||||
before:
|
||||
hooks:
|
||||
|
||||
+11
-2
@@ -1,11 +1,20 @@
|
||||
FROM alpine:latest as certs
|
||||
RUN apk --update add ca-certificates
|
||||
|
||||
FROM golang:alpine as build
|
||||
WORKDIR /app/
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go build -v
|
||||
|
||||
FROM scratch
|
||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=build /app/webdav /webdav
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
COPY webdav /webdav
|
||||
|
||||
ENTRYPOINT [ "/webdav" ]
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
[](https://circleci.com/gh/hacdias/webdav)
|
||||
[](https://goreportcard.com/report/hacdias/webdav)
|
||||
[](https://github.com/hacdias/webdav/releases/latest)
|
||||
[](https://hub.docker.com/r/hacdias/webdav)
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
+2
-2
@@ -127,8 +127,8 @@ func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// the collection, or something else altogether.
|
||||
//
|
||||
// Get, when applied to collection, will return the same as PROPFIND method.
|
||||
if r.Method == "GET" {
|
||||
info, err := u.Handler.FileSystem.Stat(context.TODO(), r.URL.Path)
|
||||
if r.Method == "GET" && strings.HasPrefix(r.URL.Path, u.Handler.Prefix) {
|
||||
info, err := u.Handler.FileSystem.Stat(context.TODO(), strings.TrimPrefix(r.URL.Path, u.Handler.Prefix))
|
||||
if err == nil && info.IsDir() {
|
||||
r.Method = "PROPFIND"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user