feat: add goose

This commit is contained in:
Sun-ZhenXing
2026-01-02 22:06:24 +08:00
parent ab07facdb1
commit 25c618aa2e
17 changed files with 1241 additions and 150 deletions

View File

@@ -1,15 +1,31 @@
# Global registry prefix for pulling images (optional)
# GLOBAL_REGISTRY=
# Timezone setting (default: UTC)
TZ=UTC
# FRP Server Version
FRPS_VERSION=0.64.0
FRPS_VERSION=0.65.0
# FRP server configuration
FRP_SERVER_TOKEN=your_token_here
FRP_SERVER_PORT=9870
FRP_ADMIN_PORT=7890
# Authentication settings
FRP_AUTH_METHOD=token
FRP_SERVER_TOKEN=server_token
# Admin credentials
# Server port configuration
FRP_SERVER_PORT=7000
# Admin dashboard configuration
FRP_ADMIN_ADDR=0.0.0.0
FRP_ADMIN_PORT=7500
FRP_ADMIN_USER=admin
FRP_ADMIN_PASS=password
FRP_ADMIN_PASSWORD=password
# Port overrides
FRP_PORT_OVERRIDE_SERVER=9870
FRP_PORT_OVERRIDE_ADMIN=7890
# Port overrides (host ports to map to container ports)
FRP_PORT_OVERRIDE_SERVER=7000
FRP_PORT_OVERRIDE_ADMIN=7500
# Resource limits
FRPS_CPU_LIMIT=0.5
FRPS_MEMORY_LIMIT=128M
FRPS_CPU_RESERVATION=0.1
FRPS_MEMORY_RESERVATION=64M

View File

@@ -1,34 +1,63 @@
# FRPS (Intranet Penetration Server)
# FRPS (FRP Server)
[English](./README.md) | [中文](./README.zh.md)
This is an FRPS (Intranet Penetration Server) service.
FRPS is a fast reverse proxy server that helps expose local servers behind NAT and firewalls to the internet. This is the server component of the FRP (Fast Reverse Proxy) tool.
## Example
## Quick Start
Create a new `frps.toml` configuration file with the following content:
1. Create a `.env` file from `.env.example`:
```bash
cp .env.example .env
```
2. Edit the `.env` file and configure authentication credentials:
```properties
FRP_SERVER_TOKEN=your_secure_token_here
FRP_ADMIN_USER=your_admin_username
FRP_ADMIN_PASSWORD=your_secure_password
```
3. Create a `frps.toml` configuration file or use the provided template.
4. Start the service:
```bash
docker compose up -d
```
The server will be accessible on:
- FRP server port: `7000` (default)
- Admin dashboard: `http://localhost:7500` (default)
## Configuration File
Example `frps.toml`:
```toml
bindPort = {{ .Envs.FRP_SERVER_PORT }}
auth.method = "{{ .Envs.FRP_AUTH_METHOD }}"
auth.token = "{{ .Envs.FRP_SERVER_TOKEN }}"
webServer.addr = "0.0.0.0"
webServer.addr = "{{ .Envs.FRP_ADMIN_ADDR }}"
webServer.port = {{ .Envs.FRP_ADMIN_PORT }}
webServer.user = "{{ .Envs.FRP_ADMIN_USER }}"
webServer.password = "{{ .Envs.FRP_ADMIN_PASS }}"
webServer.password = "{{ .Envs.FRP_ADMIN_PASSWORD }}"
```
Configure secrets and other information in the `.env` file:
## Network Modes
```properties
FRP_SERVER_TOKEN=token
FRP_ADMIN_USER=admin
FRP_ADMIN_PASS=password
```
### Standard Mode (Default)
Start the service to proxy client requests. Note that you need to map the client's port. You can share the service through HOST network or shared network.
Uses port mapping as configured in `docker-compose.yaml`.
To enable HOST mode, use the following method:
### Host Network Mode
For better performance and access to all ports, use host network mode:
```yaml
services:
@@ -37,21 +66,61 @@ services:
network_mode: host
```
## Services
**Note**: When using host network mode, the `ports` section is ignored and the service directly uses host ports.
- `frps`: The FRPS server service.
## Environment Variables
## Configuration
### Image Configuration
- `FRPS_VERSION`: The version of the FRPS image, default is `0.64.0`.
- `FRP_SERVER_PORT`: The port for the FRPS server, default is `9870`.
- `FRP_ADMIN_PORT`: The port for the FRPS admin dashboard, default is `7890`.
- `FRP_PORT_OVERRIDE_SERVER`: The host port to map to the FRPS server port.
- `FRP_PORT_OVERRIDE_ADMIN`: The host port to map to the FRPS admin port.
- `FRP_SERVER_TOKEN`: The token for authenticating clients.
- `FRP_ADMIN_USER`: The username for the admin dashboard, default is `admin`.
- `FRP_ADMIN_PASS`: The password for the admin dashboard, default is `password`.
- `GLOBAL_REGISTRY`: Optional global registry prefix for pulling images
- `FRPS_VERSION`: FRPS image version (default: `0.65.0`)
- `TZ`: Timezone setting (default: `UTC`)
### Server Configuration
- `FRP_AUTH_METHOD`: Authentication method (default: `token`)
- `FRP_SERVER_TOKEN`: Token for client authentication (**change this for security**)
- `FRP_SERVER_PORT`: FRP server port (default: `7000`)
### Admin Dashboard
- `FRP_ADMIN_ADDR`: Admin dashboard bind address (default: `0.0.0.0`)
- `FRP_ADMIN_PORT`: Admin dashboard port (default: `7500`)
- `FRP_ADMIN_USER`: Admin dashboard username (default: `admin`)
- `FRP_ADMIN_PASSWORD`: Admin dashboard password (**change this for security**)
### Port Overrides
- `FRP_PORT_OVERRIDE_SERVER`: Host port to map to FRP server port (default: `7000`)
- `FRP_PORT_OVERRIDE_ADMIN`: Host port to map to admin dashboard (default: `7500`)
### Resource Limits
- `FRPS_CPU_LIMIT`: CPU limit (default: `0.5`)
- `FRPS_MEMORY_LIMIT`: Memory limit (default: `128M`)
- `FRPS_CPU_RESERVATION`: CPU reservation (default: `0.1`)
- `FRPS_MEMORY_RESERVATION`: Memory reservation (default: `64M`)
## Volumes
- `frps.toml`: The configuration file for FRPS.
- `./frps.toml:/etc/frp/frps.toml`: FRPS configuration file
## Security Notes
1. **Change default credentials**: Always change `FRP_SERVER_TOKEN`, `FRP_ADMIN_USER`, and `FRP_ADMIN_PASSWORD` from their default values
2. **Use strong passwords**: Use complex, randomly generated passwords and tokens
3. **Firewall rules**: Consider limiting access to the admin dashboard to trusted IP addresses
4. **TLS/SSL**: For production use, consider setting up TLS encryption in the FRP configuration
## Health Check
The service includes a health check that verifies the admin dashboard is accessible. The health check:
- Runs every 30 seconds
- Has a 10-second timeout
- Retries up to 3 times
- Waits 10 seconds before the first check after startup
## License
FRP is licensed under the Apache License 2.0. See the [FRP GitHub repository](https://github.com/fatedier/frp) for more details.

View File

@@ -1,34 +1,63 @@
# FRPS (内网穿透服务端)
# FRPSFRP 服务端
[English](./README.md) | [中文](./README.zh.md)
这是一个 FRPS内网穿透服务端服务
FRPS 是一个快速反向代理服务器,可以帮助将 NAT 和防火墙后面的本地服务器暴露到互联网。这是 FRPFast Reverse Proxy工具的服务端组件
## 示例
## 快速开始
新建 `frps.toml` 配置文件,内容如下
1.`.env.example` 创建 `.env` 文件
```bash
cp .env.example .env
```
2. 编辑 `.env` 文件并配置认证凭据:
```properties
FRP_SERVER_TOKEN=your_secure_token_here
FRP_ADMIN_USER=your_admin_username
FRP_ADMIN_PASSWORD=your_secure_password
```
3. 创建 `frps.toml` 配置文件或使用提供的模板。
4. 启动服务:
```bash
docker compose up -d
```
服务将在以下位置可访问:
- FRP 服务端口:`7000`(默认)
- 管理面板:`http://localhost:7500`(默认)
## 配置文件
示例 `frps.toml`
```toml
bindPort = {{ .Envs.FRP_SERVER_PORT }}
auth.method = "{{ .Envs.FRP_AUTH_METHOD }}"
auth.token = "{{ .Envs.FRP_SERVER_TOKEN }}"
webServer.addr = "0.0.0.0"
webServer.addr = "{{ .Envs.FRP_ADMIN_ADDR }}"
webServer.port = {{ .Envs.FRP_ADMIN_PORT }}
webServer.user = "{{ .Envs.FRP_ADMIN_USER }}"
webServer.password = "{{ .Envs.FRP_ADMIN_PASS }}"
webServer.password = "{{ .Envs.FRP_ADMIN_PASSWORD }}"
```
配置密钥等信息到 `.env` 文件中:
## 网络模式
```properties
FRP_SERVER_TOKEN=token
FRP_ADMIN_USER=admin
FRP_ADMIN_PASS=password
```
### 标准模式(默认)
启动服务,即可代理客户端请求,注意需要将客户端的端口映射出来。可以通过 HOST 网络或共享网络的方式共享服务
使用 `docker-compose.yaml` 中配置的端口映射
使用如下方法启用 HOST 模式
### Host 网络模式
为了获得更好的性能和访问所有端口,可以使用 host 网络模式:
```yaml
services:
@@ -37,21 +66,61 @@ services:
network_mode: host
```
## 服务
**注意**:使用 host 网络模式时,`ports` 部分将被忽略,服务直接使用主机端口。
- `frps`: FRPS 服务端服务。
## 环境变量
## 配置
### 镜像配置
- `FRPS_VERSION`: FRPS 镜像的版本,默认为 `0.64.0`
- `FRP_SERVER_PORT`: FRPS 服务端口,默认为 `9870`
- `FRP_ADMIN_PORT`: FRPS 管理面板端口,默认为 `7890`
- `FRP_PORT_OVERRIDE_SERVER`: 映射到 FRPS 服务端口的主机端口。
- `FRP_PORT_OVERRIDE_ADMIN`: 映射到 FRPS 管理面板端口的主机端口。
- `FRP_SERVER_TOKEN`: 用于认证客户端的令牌。
- `FRP_ADMIN_USER`: 管理面板的用户名,默认为 `admin`
- `FRP_ADMIN_PASS`: 管理面板的密码,默认为 `password`
- `GLOBAL_REGISTRY`:可选的全局镜像仓库前缀
- `FRPS_VERSION`FRPS 镜像版本(默认:`0.65.0`
- `TZ`:时区设置(默认:`UTC`
### 服务器配置
- `FRP_AUTH_METHOD`:认证方法(默认:`token`
- `FRP_SERVER_TOKEN`:客户端认证令牌(**请修改以确保安全**
- `FRP_SERVER_PORT`FRP 服务端口(默认:`7000`
### 管理面板
- `FRP_ADMIN_ADDR`:管理面板绑定地址(默认:`0.0.0.0`
- `FRP_ADMIN_PORT`:管理面板端口(默认:`7500`
- `FRP_ADMIN_USER`:管理面板用户名(默认:`admin`
- `FRP_ADMIN_PASSWORD`:管理面板密码(**请修改以确保安全**
### 端口覆盖
- `FRP_PORT_OVERRIDE_SERVER`:映射到 FRP 服务端口的主机端口(默认:`7000`
- `FRP_PORT_OVERRIDE_ADMIN`:映射到管理面板的主机端口(默认:`7500`
### 资源限制
- `FRPS_CPU_LIMIT`CPU 限制(默认:`0.5`
- `FRPS_MEMORY_LIMIT`:内存限制(默认:`128M`
- `FRPS_CPU_RESERVATION`CPU 预留(默认:`0.1`
- `FRPS_MEMORY_RESERVATION`:内存预留(默认:`64M`
## 卷
- `frps.toml`: FRPS 配置文件
- `./frps.toml:/etc/frp/frps.toml`FRPS 配置文件
## 安全注意事项
1. **修改默认凭据**:务必修改 `FRP_SERVER_TOKEN`、`FRP_ADMIN_USER` 和 `FRP_ADMIN_PASSWORD` 的默认值
2. **使用强密码**:使用复杂的随机生成的密码和令牌
3. **防火墙规则**:考虑将管理面板的访问限制在受信任的 IP 地址
4. **TLS/SSL**:在生产环境中,考虑在 FRP 配置中设置 TLS 加密
## 健康检查
服务包含一个健康检查,用于验证管理面板是否可访问。健康检查:
- 每 30 秒运行一次
- 超时时间为 10 秒
- 最多重试 3 次
- 启动后等待 10 秒再进行第一次检查
## 许可证
FRP 采用 Apache License 2.0 许可证。详情请参阅 [FRP GitHub 仓库](https://github.com/fatedier/frp)。

View File

@@ -9,19 +9,24 @@ x-defaults: &defaults
services:
frps:
<<: *defaults
image: ${GLOBAL_REGISTRY:-}snowdreamtech/frps:${FRPS_VERSION:-0.64.0}
image: ${GLOBAL_REGISTRY:-}snowdreamtech/frps:${FRPS_VERSION:-0.65.0}
volumes:
- ./frps.toml:/etc/frp/frps.toml:ro
- ./frps.toml:/etc/frp/frps.toml
ports:
- ${FRP_PORT_OVERRIDE_SERVER:-9870}:${FRP_SERVER_PORT:-9870}
- ${FRP_PORT_OVERRIDE_ADMIN:-7890}:${FRP_ADMIN_PORT:-7890}
- ${FRP_PORT_OVERRIDE_SERVER:-7000}:${FRP_SERVER_PORT:-7000}/tcp
- ${FRP_PORT_OVERRIDE_SERVER:-7000}:${FRP_SERVER_PORT:-7000}/udp
- ${FRP_PORT_OVERRIDE_ADMIN:-7500}:${FRP_ADMIN_PORT:-7500}
environment:
TZ: ${TZ:-UTC}
FRP_SERVER_TOKEN: ${FRP_SERVER_TOKEN}
FRP_SERVER_PORT: ${FRP_SERVER_PORT:-9870}
FRP_ADMIN_PORT: ${FRP_ADMIN_PORT:-7890}
FRP_AUTH_METHOD: ${FRP_AUTH_METHOD:-token}
FRP_SERVER_TOKEN: ${FRP_SERVER_TOKEN:-server_token}
FRP_SERVER_PORT: ${FRP_SERVER_PORT:-7000}
FRP_ADMIN_ADDR: ${FRP_ADMIN_ADDR:-0.0.0.0}
FRP_ADMIN_PORT: ${FRP_ADMIN_PORT:-7500}
FRP_ADMIN_USER: ${FRP_ADMIN_USER:-admin}
FRP_ADMIN_PASS: ${FRP_ADMIN_PASS:-password}
FRP_ADMIN_PASSWORD: ${FRP_ADMIN_PASSWORD:-password}
extra_hosts:
- "host.docker.internal:host-gateway"
deploy:
resources:
limits:
@@ -31,7 +36,7 @@ services:
cpus: ${FRPS_CPU_RESERVATION:-0.1}
memory: ${FRPS_MEMORY_RESERVATION:-64M}
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${FRP_ADMIN_PORT:-7890}/"]
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${FRP_ADMIN_PORT:-7500}/"]
interval: 30s
timeout: 10s
retries: 3

View File

@@ -1,8 +1,15 @@
[common]
bind_port = {{ .Envs.FRP_SERVER_PORT }}
token = {{ .Envs.FRP_SERVER_TOKEN }}
bindPort = {{ .Envs.FRP_SERVER_PORT }}
kcpBindPort = {{ .Envs.FRP_SERVER_PORT }}
dashboard_addr = 0.0.0.0
dashboard_port = {{ .Envs.FRP_ADMIN_PORT }}
dashboard_user = {{ .Envs.FRP_ADMIN_USER }}
dashboard_pwd = {{ .Envs.FRP_ADMIN_PASS }}
[auth]
method = "{{ .Envs.FRP_AUTH_METHOD }}"
token = "{{ .Envs.FRP_SERVER_TOKEN }}"
[transport]
maxPoolCount = 20
[webServer]
addr = "{{ .Envs.FRP_ADMIN_ADDR }}"
port = {{ .Envs.FRP_ADMIN_PORT }}
user = "{{ .Envs.FRP_ADMIN_USER }}"
password = "{{ .Envs.FRP_ADMIN_PASSWORD }}"