mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 08:57:55 +00:00
Merge branch 'main' into std-http
This commit is contained in:
commit
22ced5cb37
3 changed files with 27 additions and 1 deletions
|
@ -26,6 +26,17 @@ pipeline:
|
||||||
when:
|
when:
|
||||||
event: [ "pull_request", "push" ]
|
event: [ "pull_request", "push" ]
|
||||||
|
|
||||||
|
build-docker:
|
||||||
|
image: plugins/kaniko
|
||||||
|
settings:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
no_push: true
|
||||||
|
repo: Codeberg/pages-server
|
||||||
|
tags: latest
|
||||||
|
when:
|
||||||
|
event: [ "pull_request", "push" ]
|
||||||
|
path: Dockerfile
|
||||||
|
|
||||||
build-tag:
|
build-tag:
|
||||||
group: compliant
|
group: compliant
|
||||||
image: a6543/golang_just
|
image: a6543/golang_just
|
||||||
|
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
FROM golang:alpine as build
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
RUN apk add ca-certificates
|
||||||
|
COPY . .
|
||||||
|
RUN CGO_ENABLED=0 go build .
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=build /workspace/pages /pages
|
||||||
|
COPY --from=build \
|
||||||
|
/etc/ssl/certs/ca-certificates.crt \
|
||||||
|
/etc/ssl/certs/ca-certificates.crt
|
||||||
|
|
||||||
|
ENTRYPOINT ["/pages"]
|
|
@ -199,7 +199,7 @@ func (o *Options) Upstream(ctx *fasthttp.RequestCtx, giteaClient *gitea.Client,
|
||||||
}
|
}
|
||||||
log.Debug().Msg("response")
|
log.Debug().Msg("response")
|
||||||
|
|
||||||
if res != nil && res.Header.ContentLength() > fileCacheSizeLimit && ctx.Err() == nil {
|
if res != nil && res.Header.ContentLength() <= fileCacheSizeLimit && ctx.Err() == nil {
|
||||||
cachedResponse.Exists = true
|
cachedResponse.Exists = true
|
||||||
cachedResponse.MimeType = mimeType
|
cachedResponse.MimeType = mimeType
|
||||||
cachedResponse.Body = cacheBodyWriter.Bytes()
|
cachedResponse.Body = cacheBodyWriter.Bytes()
|
||||||
|
|
Loading…
Reference in a new issue