Soga 后端对接
- 安装脚本
bash <(curl -Ls https://github.com/sprov065/soga/raw/master/soga.sh)- 同步时间
apt-get install -y ntp
systemctl enable ntp
systemctl restart ntp- 编辑配置文件 /etc/soga/soga.conf
- 证书所有支持的 DNS 服务商:https://github.com/acmesh-official/acme.sh/wiki/dnsapi
CloudFlare 配置示例
cert_domain=xxx.com # 申请证书的域名
cert_mode=dns # 申请模式
dns_provider=dns_cf # DNS 提供商
DNS_CF_Email=xxx@xx.com # CF 邮箱,注意加 DNS_ 前缀
DNS_CF_Key=xxxxx # CF API 密钥,注意加 DNS_ 前缀
docker版本
mkdir /root/soga
cd /root/soga
touch docker-compose.yml
version: "3"
services:
soga:
image: sprov065/soga:latest
restart: on-failure
ports:
- "80:80"
- "443:443"
environment:
type: v2board
server_type: trojan
api: webapi
webapi_url: https://v2b.vpc123.xyz/
webapi_mukey: 12345678901qazxs
node_id: 8
cert_domain: soga002.vpc123.xyz
cert_mode: http
force_close_ssl: 'false' # 填写 false 或 true 参数值时需要加引号
forbidden_bit_torrent: 'true' # 填写 false 或 true 参数值时需要加引号
volumes:
- "/etc/soga/:/etc/soga/"编辑配置文件
mkdir /etc/soga
touch /etc/soga/soga.config
type=v2board
server_type=trojan
api=webapi
webapi_url=https://v2b.vpc123.xyz/
webapi_mukey=xxxxxxxxxx
db_host=107.148.xxx.xxx
db_port=33306
db_name=soga002
db_user=root
db_password=lys!QAZ1qaz
node_id=8
soga_key=
user_conn_limit=0
user_speed_limit=0
check_interval=100
cert_mode=http
cert_domain=soga002.vpc123.xyz
dns_provider=8.8.8.8,1.1.1.1
force_close_ssl=false
forbidden_bit_torrent=false
dns_cache_time=10
auto_update=false基础配置(必填)
| 参数名 | 默认值 | 说明 |
|---|---|---|
| type | sspanel-uim | sspanel-uim,v2board,whmcs,proxypanel |
| server_type | v2ray | v2ray,trojan,ss,ssr |
| node_id | 无 | 节点 id,可配置多个(v2.7.1+),以逗号分隔: 1,2,3 |
| soga_key | 无 | 授权码,社区版无需填写 |
| api | webapi | 对接方式,weapi 或 db,任选一个,推荐 webapi |
对接配置(必填)
webapi 和 db 对接信息只需填一方的信息
| 参数名 | 默认值 | 说明 |
|---|---|---|
| webapi_url | 无 | 面板 webapi 地址,一般就是主页地址 |
| webapi_mukey | 无 | webapi 通信密钥,不推荐使用,请使用webapi_key |
| webapi_key | 无 | webapi 通信密钥 |
| - | ||
| db_host | 无 | 数据库地址 |
| db_port | 3306 | 数据库端口 |
| db_name | 无 | 数据库名 |
| db_user | root | 数据库用户名 |
| db_password | 无 | 数据库密码 |
| db_max_idle_time | 480 | 连接最多空闲时间,单位分钟 |
| db_max_idle_conn | 4 | 最大空闲连接数 |
| db_max_conn | 4 | 最大连接数 |
dns 配置(可选)
| 参数名 | 默认值 | 说明 |
|---|---|---|
| default_dns | 无 | 要使用的 dns 地址,以逗号分隔,也支持域名 dns,不填则使用系统 dns 解析 |
| dns_cache_time | 10 | dns 缓存时间,单位分钟 |
| dns_strategy | ipv4_first | dns 解析策略,可选:ipv4_first、ipv4_only、ipv6_first、ipv6_only |
v2ray 特殊配置(可选)
| 参数名 | 默认值 | 说明 |
|---|---|---|
| v2ray_reduce_memory | false | VMessMd5 下有效,大幅降低内存使用,启用后客户端时间误差建议不超过15秒,最多不超过25秒 |
| vless | false | 是否启用 vless 协议 |
| vless_flow | 无 | vless 流控,具体请参考 v2ray 官方文档 |
| v2ray_fallback_addr | 无 | v2ray 回落地址,vless+tcp+tls 或 vmess+tcp+tls 下有效,若开启,则同时需设置 tls_alpn=http/1.1 |
| v2ray_fallback_port | 无 | v2ray 回落端口,vless+tcp+tls 或 vmess+tcp+tls 下有效 |
| force_vmess_aead | false | v2.7.2+,是否强制启用 VMessAEAD,强制启用后,alterId 将被忽略,用户只能使用 VMessAEAD 进行连接 |
trojan 特殊配置(可选)
| 参数名 | 默认值 | 说明 |
|---|---|---|
| trojan_remote_addr | 无 | trojan 回落地址,若开启,则同时需设置 tls_alpn=http/1.1 |
| trojan_remote_port | 无 | trojan 回落端口 |
tls 配置(可选)
| 参数名 | 默认值 | 说明 |
|---|---|---|
| tls_alpn | h2,http/1.1 | TLS ALPN 配置,不懂的话保持默认即可,多协议以逗号分隔 |
| xtls | false | 设为 true 即可开启 xtls,目前仅在 vless+tcp+tls 时有效,开启 xtls 后同时需要设置 vless_flow=xtls-rprx-direct |
| tls_min_version | 空 | tls 最低版本,可选:1.0,1.1,1.2,1.3 |
| tls_max_version | 空 | tls 最高版本,可选:1.0,1.1,1.2,1.3 |
| tls_prefer_server_cipher_suites | true | 如果为 true 则为使用服务器的最优选的密码套件 |
| tls_cipher_suites | 空 | 配置加密套件,参考 tls 加密套件配置 |