041 对接 vnetpanel 教程 v2ray - Pinxz/soga GitHub Wiki
一键安装&更新
bash <(curl -Ls https://blog.sprov.xyz/soga.sh)
或者,两个都可以
bash <(curl -Ls https://raw.githubusercontent.com/sprov065/soga/master/install.sh)
同步时间(重要)
v2ray 节点需要进行时间同步,时间若与客户端相差太大则无法连接
CentOS 7
yum install -y ntp
systemctl enable ntpd
ntpdate -q 0.rhel.pool.ntp.org
systemctl restart ntpd
Debian 9 / Ubuntu 16
apt-get install -y ntp
systemctl enable ntp
systemctl restart ntp
第一步,设置节点
这个简单,在 vnetpanel 添加一个 v2ray 节点就是
第二步,配置 soga
第一次安装完成后,编辑配置文件:
配置文件位置在 /etc/soga/soga.conf
配置文件位置在 /etc/soga/soga.conf
配置文件位置在 /etc/soga/soga.conf
基础配置
type=vnetpanel # 必填这个
server_type=v2ray # 必填这个
api=webapi # webapi 或 db,表示 webapi 对接或数据库对接,数据库对接开发中
# webapi 对接
webapi_url=https://xxx.com/ # webapi url,填写面板主页地址
webapi_mukey=xxxx # webapi key
# 数据库对接,开发中
db_host=db.xxx.com # 数据库地址
db_port=3306 # 数据库端口
db_name=name # 数据库名
db_user=root # 数据库用户名
db_password=asdasdasd # 数据库密码
node_id=1 # 节点id
soga_key= # 授权key,社区版无需填写,最多支持88用户,商业版无限制
check_interval=100 # 同步前端用户、上报服务器信息等间隔时间(秒),近似值
force_close_ssl=false # 设为true可强制关闭tls,即使前端开启tls,soga也不会开启tls,方便用户自行使用nginx、caddy等反代
forbidden_bit_torrent=true # 设为true可禁用bt下载
default_dns=8.8.8.8,1.1.1.1 # 配置默认dns,可在此配置流媒体解锁的dns,以逗号分隔
dns_cache_time=10 # 自定义dns缓存时间,单位分钟,仅在设置了default_dns时有效,或者v2board设置了dns规则时也有效
v2ray_reduce_memory=false # v2ray配置,在已降低内存的基础上进一步降低内存使用,启用后客户端时间误差要求不超过15秒
配置证书
若未开启 tls,则无需配置证书
soga 支持三种方式配置证书,任选其一即可
① 手动指定证书路径
- 以 / 开头的绝对路径
cert_file= # 手动指定证书路径
key_file= # 手动指定密钥路径
② http 模式自动申请证书(推荐)
- 确保服务器中没有其它程序占用 80 端口,申请和续签时需要临时使用
- 确保域名已解析到本服务器的IP
- 若开启CDN,则必须确保CDN不会跳转https,否则推荐dns验证
cert_domain=xxx.com # 申请证书的域名
cert_mode=http # 申请模式
cert_key_length=ec-256 # 留空则申请RSA证书,填写ec-256或ec-384则申请ECC证书
③ dns 模式自动申请证书
- 支持一百多种 DNS 服务商
- 此配置方式较复杂,但最通用
- 该页面列出了所有支持的 DNS 服务商:https://github.com/acmesh-official/acme.sh/wiki/dnsapi
CloudFlare 配置示例
cert_domain=xxx.com # 申请证书的域名
cert_mode=dns # 申请模式
cert_key_length=ec-256 # 留空则申请RSA证书,填写ec-256或ec-384则申请ECC证书
dns_provider=dns_cf # DNS 提供商
[email protected] # CF 邮箱
DNS_CF_Key=xxxxx # CF API 密钥
DNSPod 配置示例
cert_domain=xxx.com # 申请证书的域名
cert_mode=dns # 申请模式
cert_key_length=ec-256 # 留空则申请RSA证书,填写ec-256或ec-384则申请ECC证书
dns_provider=dns_dp # DNS 提供商
DNS_DP_Id=111 # DNSPod 用户 id
DNS_DP_Key=xxxxx # DNSPod API 密钥
其它的 DNS 服务商都能在这个页面找到:https://github.com/acmesh-official/acme.sh/wiki/dnsapi
配置要点:
- 找到 DNS 提供商的名称,以 dns_ 开头,后面跟提供商的缩写
- 找到 DNS 提供商所需要配置的内容,区分大小写,一般都是 API 密钥之类的,注意要在 soga 配置中加上 DNS_ 前缀,防止配置冲突
第三步、启动 soga
soga start
若出现启动失败的情况,使用 soga log 查看错误信息
加入我们:Telegram群组
购买商业版:联系sprov