update default config

This commit is contained in:
guochao 2024-12-28 22:27:09 +08:00
parent 593cb02d3f
commit 89da9e0bcb
2 changed files with 40 additions and 2 deletions

View File

@ -1,11 +1,11 @@
FROM golang:1.23-alpine FROM docker.io/library/golang:1.23-alpine
WORKDIR /src WORKDIR /src
COPY go.mod go.sum ./ COPY go.mod go.sum ./
RUN go mod download RUN go mod download
ADD . /src ADD . /src
RUN go build -o /cache-proxy ./cmd/proxy RUN go build -o /cache-proxy ./cmd/proxy
FROM alpine:3.21 as runtime FROM docker.io/library/alpine:3.21 as runtime
COPY --from=0 /cache-proxy /bin/cache-proxy COPY --from=0 /cache-proxy /bin/cache-proxy
WORKDIR /etc/ WORKDIR /etc/
VOLUME /data VOLUME /data

View File

@ -15,6 +15,10 @@ upstream:
match: match:
match: /microsoft-code(.*) match: /microsoft-code(.*)
replace: '$1' replace: '$1'
- server: https://archive.ubuntu.com
match:
match: /ubuntu/(.*)
replace: /$1
- server: http://releases.ubuntu.com/ - server: http://releases.ubuntu.com/
match: match:
match: /ubuntu-releases/(.*) match: /ubuntu-releases/(.*)
@ -23,6 +27,10 @@ upstream:
match: match:
match: /hashicorp-deb/(.*) match: /hashicorp-deb/(.*)
replace: /$1 replace: /$1
- server: https://rpm.releases.hashicorp.com
match:
match: /hashicorp-rpm/(.*)
replace: /$1
- server: https://dl.google.com/linux/chrome - server: https://dl.google.com/linux/chrome
match: match:
match: /google-chrome/(.*) match: /google-chrome/(.*)
@ -35,6 +43,34 @@ upstream:
match: match:
match: /kylinlinux/(.*) match: /kylinlinux/(.*)
replace: /$1 replace: /$1
- server: http://cdn.jsdelivr.net
match:
match: /jsdelivr/(.*)
replace: /$1
- server: https://dl-cdn.alpinelinux.org
match:
match: /alpine/(.*)
replace: /$1
- server: https://deb.debian.org/debian
match:
match: /debian/(.*)
replace: /$1
- server: https://repo.almalinux.org
match:
match: /almalinux/(.*)
replace: /almalinux/$1
- server: https://dl.rockylinux.org/pub/rocky
match:
match: /rocky/(.*)
replace: /$1
- server: https://dl.fedoraproject.org/pub/epel
match:
match: /epel/(.*)
replace: /$1
- server: http://deb.debian.org
match:
match: /(debian|debian-security)/(.*)
replace: /$1/$2
misc: misc:
first-chunk-bytes: 31457280 # 1024*1024*30, all upstreams with 200 response will wait for the first chunks to select a upstream by bandwidth, instead of by latency. defaults to 50M first-chunk-bytes: 31457280 # 1024*1024*30, all upstreams with 200 response will wait for the first chunks to select a upstream by bandwidth, instead of by latency. defaults to 50M
@ -45,6 +81,8 @@ cache:
policies: policies:
- match: '.*\.(rpm|deb)$' - match: '.*\.(rpm|deb)$'
refresh-after: never refresh-after: never
- match: '^/.*-security/.*'
refresh-after: 1h
storage: storage:
type: local # ignored type: local # ignored