项目地址
前端Sub-Web:https://github.com/CareyWang/sub-web
后端Subconverter:https://github.com/tindy2013/subconverter
部署后端subconverter
wget https://github.com/tindy2013/subconverter/releases/download/v0.6.4/subconverter_linux64.tar.gz
tar -zxvf subconverter_linux64.tar.gz
创建守护进程
vi /etc/systemd/system/subconverter.service
[Unit]
Description=A API For Subscription Convert
After=network.target
[Service]
Type=simple
ExecStart=/root/subconverter/subconverter
WorkingDirectory=/root/subconverter
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
要注意相关路径是否正确
systemctl daemon-reload
systemctl start subconverter
systemctl status subconverter
systemctl enable subconverter
现在访问http://服务器ip:25500
应该就可以看到已经部署成功了
宝塔创建站点subconverter.wc.ci 配置好 https 并反向代理到http://127.0.0.1:25500/
部署前端sub-web
安装Node.js
下文安装的是 lts 版本,安装其它版本请参考https://github.com/nodesource/distributions
curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -
sudo yum install -y nodejs
安装Yarn
npm install yarn -g
sub-web
git clone https://github.com/CareyWang/sub-web
cd sub-web
yarn install
yarn serve
访问http://服务器ip:8080
就能看到预览页面了
修改后端地址
vi /root/sub-web/src/views/Subconverter.vue
将 backendOptions: [{ value: "http://127.0.0.1:25500/sub?" }],
修改为 backendOptions: [{ value: "https://subconverter.wc.ci/sub?" }],
vi /root/sub-web/.env
将 api.wcc.best
修改为subconverter.wc.ci
编译部署
宝塔创建站点sub-web.wc.ci 并配置好 https
执行yarn build
将生成的 dist 目录下所有文件移动到站点sub-web.wc.ci根目录就部署成功了,看看效果