项目地址:https://github.com/Netflixxp/XrayR
目前XrayR原作者已跑路,该项目已无人维护,可考虑更换类似的后端,如:crossfw
项目地址:https://github.com/crossfw/Air-Universe
apt-get update && apt-get install wget curl git vim -y
curl -fsSL https://get.docker.com | bash -s docker
curl -L "https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
添加v2ray节点,传输协议选ws,编辑配置:
{
"path":"/f7d89asd09f7df6g7fdjhjkhj5k"
}
请注意指定config.yml目录。
docker pull crackair/xrayr:latest && docker run --restart=always --name xrayr -d -v ${PATH_TO_CONFIG}/config.yml:/etc/XrayR/config.yml --network=host crackair/xrayr:latest
docker-compose仅需两条简单通用的命令即可实现更新、删除容器并重启。更新软件后config.yml不会被更新覆盖。
注意在 docker-compose.yml 所在的目录下执行:
docker-compose pull
docker-compose up -d
使用宝塔面板,nginx 申请 Let's Encrypt SSL证书,在启动docker-compose时,可能会报错:
可以看到报错x509,证书验证错误,这个问题产生的原因是v2board部署的那台机器,nginx 申请 Let's Encrypt SSL证书的中间证书缺失,可以使用检测网站查看到:
缺失中间证书R3
检测地址:https://www.myssl.cn/tools/check-server-cert.html
Nginx相关配置:
server {
listen 443 ssl http2 default_server;
server_name zzzmh.cn;
ssl_certificate /root/ssl/fullchain.pem;
ssl_certificate_key /root/ssl/privkey.pem;
ssl_trusted_certificate /root/ssl/chain.pem;
...
}
关键问题是在 fullchain.pem
根据调查 Nginx 不像是 Apache 有专门的参数配置中间证书 Nginx 需要全部配置在 fullchain.pem 中
顾正确的格式是分为三段
分别代表 服务器层 中间层 root层
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
而实际上一般 Let's Encrypt 生成的证书 fullchain.pem 默认都是两段
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
解决方案:
其实具体缺失中间证书是不是一个问题,有什么后果,都尚未可知。只是抱着能解决就解决的心态去调查解决的。
#首先先找到 Let's Encrypt 生成的fullchain.pem
[root@server ~]# find / -name fullchain.pem
/www/server/panel/vhost/cert/dosg1.cnbbq.xyz/fullchain.pem
/www/server/panel/vhost/ssl/dosg1.cnbbq.xyz/fullchain.pem
/www/server/panel/vhost/letsencrypt/dosg1.cnbbq.xyz/fullchain.pem
#依次查看三个fullchain.pem,发现只有letsencrypt目录下的fullchain.pem是完整的三段证书,其余两个fullchain.pem都只有一段。
[root@server ~]# cd /www/server/panel/vhost/letsencrypt/dosg1.cnbbq.xyz
[root@server dosg1.cnbbq.xyz]# ls
cert.csr Description.txt fullchain.pem fullchain.pfx privkey.pem root_cert.csr
[root@server dosg1.cnbbq.xyz]# vim fullchain.pem
[root@server dosg1.cnbbq.xyz]# cd /www/server/panel/vhost/ssl/dosg1.cnbbq.xyz
[root@server dosg1.cnbbq.xyz]# ls
fullchain.pem info.json privkey.pem
[root@server dosg1.cnbbq.xyz]# vim fullchain.pem
[root@server dosg1.cnbbq.xyz]# pwd
/www/server/panel/vhost/ssl/dosg1.cnbbq.xyz
[root@server dosg1.cnbbq.xyz]# cd /www/server/panel/vhost/cert/
[root@server cert]# ls
dosg1.cnbbq.xyz
[root@server cert]# cd dosg1.cnbbq.xyz/
[root@server dosg1.cnbbq.xyz]# ls
fullchain.pem privkey.pem
[root@server dosg1.cnbbq.xyz]# vim fullchain.pem
[root@server dosg1.cnbbq.xyz]# ls
fullchain.pem privkey.pem
#将两个不完整的证书备份,命名为fullchain.pem.bak,防止以后会用到。
#然后将letsencrypt目录下的完整的fullchain.pem复制到cert 和ssl目录中去,替换掉原有的不完整的fullchain.pem。
[root@server dosg1.cnbbq.xyz]# mv fullchain.pem fullchain.pem.bak
[root@server dosg1.cnbbq.xyz]# cp /www/server/panel/vhost/letsencrypt/dosg1.cnbbq.xyz/fullchain.pem ./fullchain.pem
[root@server dosg1.cnbbq.xyz]# pwd
/www/server/panel/vhost/cert/dosg1.cnbbq.xyz
[root@server dosg1.cnbbq.xyz]# cd /www/server/panel/vhost/ssl/dosg1.cnbbq.xyz
[root@server dosg1.cnbbq.xyz]# ls
fullchain.pem info.json privkey.pem
[root@server dosg1.cnbbq.xyz]# mv fullchain.pem fullchain.pem.bak
[root@server dosg1.cnbbq.xyz]# cp /www/server/panel/vhost/letsencrypt/dosg1.cnbbq.xyz/fullchain.pem ./fullchain.pem
#最后重启nginx服务器。
[root@server dosg1.cnbbq.xyz]# nginx -t
nginx: the configuration file /www/server/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /www/server/nginx/conf/nginx.conf test is successful
[root@server dosg1.cnbbq.xyz]# nginx -s reload
参考文档1:https://its201.com/article/owenzhang24/122234171
参考文档2:https://juejin.cn/post/6844903750109249544