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