Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
caddyproxy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
caddyproxy
Commits
52db8d1c
Commit
52db8d1c
authored
Oct 04, 2024
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add deploy
parent
5532c088
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
4 deletions
+94
-4
Dockerfile
Dockerfile
+21
-0
Makefile
Makefile
+6
-4
Caddyfile
deploy/Caddyfile
+38
-0
docker-compose.yml
docker-compose.yml
+29
-0
No files found.
Dockerfile
0 → 100644
View file @
52db8d1c
FROM
golang:1.21-alpine AS build
# Install dependencies
RUN
apk update
&&
\
apk upgrade
&&
\
apk add
--no-cache
bash git openssh make build-base
WORKDIR
/build
ADD
. /build/caddyproxy
RUN
cd
/build/caddyproxy
&&
make
&&
cp
build/bin/caddyproxy /caddyproxy
FROM
alpine
WORKDIR
/root
COPY
--from=build /caddyproxy /usr/bin/caddyproxy
#COPY ./app.json /root/app.json
ENTRYPOINT
[ "caddyproxy" ]
\ No newline at end of file
Makefile
View file @
52db8d1c
.PHONY
:
default caddyproxy
.PHONY
:
default caddyproxy
docker
GOBIN
=
$(
shell
pwd
)
/build/bin
GO
?=
latest
GOFILES_NOVENDOR
:=
$(
shell
go list
-f
"{{.Dir}}"
./...
)
TAG
=
latest
default
:
caddyproxy
all
:
caddyproxy
#CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o=${GOBIN}/$@ -gcflags "all=-N -l" .
all
:
caddyproxy docker
caddyproxy
:
go build
-o
=
${
GOBIN
}
/
$@
-gcflags
"all=-N -l"
.
@
echo
"Done building."
docker
:
docker build
-t
caddyproxy:
${
TAG
}
.
clean
:
rm
-fr
build/
*
deploy/Caddyfile
0 → 100644
View file @
52db8d1c
(LOG) {
log {
format formatted "[{ts}] {request>remote_addr} {request>proto} {request>method} <- {status} -> {request>host} {request>uri} {request>headers>User-Agent>[0]}" {
time_format "iso8601"
}
output file "{args.0}" {
roll_size 100mb
roll_keep 3
roll_keep_for 7d
}
}
}
(TLS) {
# TLS 配置采用 https://mozilla.github.io/server-side-tls/ssl-config-generator/ 生成,SSL Labs 评分 A+
protocols tls1.2 tls1.3
ciphers TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
}
(HSTS) {
# HSTS (63072000 seconds)
header / Strict-Transport-Security "max-age=63072000"
}
# 聚合上面的配置片段为新的片段
(COMMON_CONFIG) {
encode zstd gzip
tls {
import TLS
}
import HSTS
}
import /srv/*.caddy
docker-compose.yml
0 → 100644
View file @
52db8d1c
services
:
caddy
:
image
:
caddy:latest
restart
:
unless-stopped
environment
:
-
XDG_CONFIG_HOME=/config
-
XDG_DATA_HOME=/data
-
CADDY_ADMIN=0.0.0.0:2019
ports
:
-
"
10080:80"
-
"
10443:443"
volumes
:
-
./deploy/Caddyfile:/etc/caddy/Caddyfile
-
./deploy/data:/data
-
./deploy/config:/config
-
caddy_root:/srv
caddyproxy
:
image
:
caddyproxy:latest
restart
:
unless-stopped
entrypoint
:
caddyproxy run --caddy-root /srv --caddy-url http://caddy:2019 --download-dir /tmp/download --log /root/d.log --port
9000
ports
:
-
"
9000:9000"
volumes
:
-
./deploy/d.log:/root/d.log
-
./deploy/download:/tmp/download
-
caddy_root:/srv
volumes
:
caddy_root
:
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment