Skip to content

Commit a54d8c2

Browse files
committed
feat: spilit client
1 parent f4ba526 commit a54d8c2

File tree

14 files changed

+178
-18
lines changed

14 files changed

+178
-18
lines changed

.drone.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ steps:
4242
- name: build - amd64
4343
image: golang:1.21-alpine
4444
commands:
45-
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel-amd64 cmd/*.go
45+
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel-amd64 cmd/frpp/*.go
4646
volumes:
4747
- name: gocache
4848
path: /go/pkg/mod
@@ -59,7 +59,7 @@ steps:
5959
- name: build - arm64
6060
image: golang:1.21-alpine
6161
commands:
62-
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel-arm64 cmd/*.go
62+
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel-arm64 cmd/frpp/*.go
6363
volumes:
6464
- name: gocache
6565
path: /go/pkg/mod

Dockerfile.standalone

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Stage 1: Building frontend
22
FROM node:18-alpine AS frontend
3-
WORKDIR /app
3+
WORKDIR /app/www
44
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
55
RUN apk update --no-cache && apk add --no-cache tzdata git openssh
66
RUN npm config set registry https://registry.npmmirror.com
@@ -21,7 +21,7 @@ COPY www/*.ts ./
2121
COPY www/*.yaml ./
2222
COPY www/*.json ./
2323

24-
RUN ls && npm run build
24+
RUN ls && mkdir -p ../cmd/frpp && npm run build
2525

2626
# Stage 2: Building binary
2727
FROM golang:1.21-alpine AS builder
@@ -31,9 +31,9 @@ RUN apk update --no-cache && apk add --no-cache tzdata git
3131
COPY go.mod go.sum ./
3232
RUN CGO_ENABLED=0 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go mod download
3333
COPY . .
34-
RUN rm -rf /app/cmd/out
35-
COPY --from=frontend /app/out ./cmd/out
36-
RUN CGO_ENABLED=0 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel cmd/*.go
34+
RUN rm -rf /app/cmd/frpp/out
35+
COPY --from=frontend /app/www/out ./cmd/frpp/out
36+
RUN CGO_ENABLED=0 GOPROXY=https://goproxy.cn,https://proxy.golang.org,direct go build -ldflags="-s -w" -o frp-panel cmd/frpp/*.go
3737

3838
# Stage 3: Build image
3939
FROM alpine:latest

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
## 项目使用说明
9797
frp-panel可选docker和直接运行模式部署,直接部署请到release下载文件:[release](https://github.com/VaalaCat/frp-panel/releases)
9898

99+
注意:二进制有两种,一种是仅客户端,一种是全功能可执行文件,客户端版只能执行client命令
100+
99101
启动过后默认访问地址为 http://IP:9000
100102

101103
### docker

build.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@ bash ./codegen.sh
33
mkdir -p dist
44
rm -rf dist/*
55
cd www && pnpm install && pnpm build && cd ..
6-
echo "Building frp-panel windows binaries..."
7-
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/frp-panel-amd64.exe cmd/*.go
8-
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o dist/frp-panel-arm64.exe cmd/*.go
9-
echo "Building frp-panel linux binaries..."
10-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/frp-panel-linux-amd64 cmd/*.go
11-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/frp-panel-linux-arm64 cmd/*.go
12-
echo "Building frp-panel darwin binaries..."
13-
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/frp-panel-darwin-amd64 cmd/*.go
14-
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/frp-panel-darwin-arm64 cmd/*.go
6+
echo "Building frp-panel full windows binaries..."
7+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/frp-panel-amd64.exe cmd/frpp/*.go
8+
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o dist/frp-panel-arm64.exe cmd/frpp/*.go
9+
echo "Building frp-panel full linux binaries..."
10+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/frp-panel-linux-amd64 cmd/frpp/*.go
11+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/frp-panel-linux-arm64 cmd/frpp/*.go
12+
echo "Building frp-panel full darwin binaries..."
13+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/frp-panel-darwin-amd64 cmd/frpp/*.go
14+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/frp-panel-darwin-arm64 cmd/frpp/*.go
15+
16+
echo "Building frp-panel client only windows binaries..."
17+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/frp-panel-client-amd64.exe cmd/frppc/*.go
18+
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o dist/frp-panel-client-arm64.exe cmd/frppc/*.go
19+
echo "Building frp-panel client only linux binaries..."
20+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/frp-panel-client-linux-amd64 cmd/frppc/*.go
21+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/frp-panel-client-linux-arm64 cmd/frppc/*.go
22+
echo "Building frp-panel client only darwin binaries..."
23+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/frp-panel-client-darwin-amd64 cmd/frpp/*.go
24+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/frp-panel-client-darwin-arm64 cmd/frppc/*.go
1525

1626
echo "Build Done!"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)