|
@ -1,57 +1,23 @@ |
|
|
# sub-web |
|
|
# sub-web |
|
|
|
|
|
|
|
|
基于 vue-cli 与 [tindy2013/subconverter](https://github.com/tindy2013/subconverter) 后端实现的配置自动生成。 |
|
|
> 基于 vue-cli 与 [subconverter](https://github.com/tindy2013/subconverter) 后端实现的订阅转换。 |
|
|
|
|
|
|
|
|
## Table of Contents |
|
|
## 环境要求 |
|
|
|
|
|
|
|
|
- [ChangeLog](#ChangeLog) |
|
|
需要 [Node](https://nodejs.org/zh-cn/) 与 [Yarn](https://legacy.yarnpkg.com/en/docs/install) 来安装依赖与打包发布,可以通过以下命令查看是否安装成功。 |
|
|
- [Docker](#Docker) |
|
|
|
|
|
- [Requirements](#Requirements) |
|
|
|
|
|
- [Install](#install) |
|
|
|
|
|
- [Usage](#usage) |
|
|
|
|
|
- [Related](#Related) |
|
|
|
|
|
- [Contributing](#contributing) |
|
|
|
|
|
- [License](#license) |
|
|
|
|
|
|
|
|
|
|
|
## ChangeLog |
|
|
|
|
|
|
|
|
|
|
|
- 20200730 |
|
|
|
|
|
|
|
|
|
|
|
- 独立各类后端配置到 .env 文件中,现在修改后端只需要修改 .env 即可。 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Docker |
|
|
|
|
|
|
|
|
|
|
|
```shell |
|
|
|
|
|
docker run -d -p 58080:80 --restart always --name subweb careywong/subweb:latest |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
若需要对代码进行修改,你需要在本地构建镜像并运行。 |
|
|
|
|
|
注:每次修改代码,你都需要重新执行 docker build 来执行打包操作。 |
|
|
|
|
|
|
|
|
|
|
|
```shell |
|
|
|
|
|
docker build -t subweb-local:latest . |
|
|
|
|
|
|
|
|
|
|
|
docker run -d -p 58080:80 --restart always --name subweb subweb-local:latest |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
## Requirements |
|
|
|
|
|
|
|
|
|
|
|
你需要安装 [Node](https://nodejs.org/zh-cn/) 与 [Yarn](https://legacy.yarnpkg.com/en/docs/install) 来安装依赖与打包发布。你可以通过以下命令查看是否安装成功。 |
|
|
|
|
|
注:以下步骤为 Ubuntu 下相应命令,其他系统请自行修改。为了方便后来人解决问题,有问题请发 issue。 |
|
|
|
|
|
|
|
|
|
|
|
```shell |
|
|
```shell |
|
|
node -v |
|
|
node -v |
|
|
yarn -v |
|
|
yarn -v |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
## Install |
|
|
## 安装 |
|
|
|
|
|
|
|
|
```shell |
|
|
```shell |
|
|
yarn install |
|
|
yarn install |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
## Usage |
|
|
## 使用 |
|
|
|
|
|
|
|
|
```shell |
|
|
```shell |
|
|
yarn serve |
|
|
yarn serve |
|
@ -59,32 +25,38 @@ yarn serve |
|
|
|
|
|
|
|
|
浏览器访问 <http://localhost:8080/> |
|
|
浏览器访问 <http://localhost:8080/> |
|
|
|
|
|
|
|
|
## Deploy |
|
|
## 发布 |
|
|
|
|
|
|
|
|
发布到线上环境,你需要安装依赖,执行以下打包命令,生成的 dist 目录即为发布目录。如需修改默认后端,请修改 src/views/Subconverter.vue 中 **defaultBackend** 配置项。 |
|
|
执行以下打包命令,生成的 dist 目录即为发布目录。 |
|
|
|
|
|
|
|
|
```shell |
|
|
```shell |
|
|
yarn build |
|
|
yarn build |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
你需要安装 nginx (或其他 web 服务器)并正确配置。以下为示例配置,你需要修改 example.com 为自己域名并配置正确的项目根路径(https 自行配置)。 |
|
|
你需要安装 nginx (或其他 web 服务器)并正确配置,以下为示例配置: |
|
|
|
|
|
|
|
|
```shell |
|
|
```shell |
|
|
server { |
|
|
server { |
|
|
listen 80; |
|
|
listen 80; |
|
|
server_name example.com; |
|
|
server_name sub.343.re; |
|
|
|
|
|
return 301 https://$server_name$request_uri; |
|
|
root /var/www/http/sub-web/dist; |
|
|
} |
|
|
index index.html index.htm; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server { |
|
|
|
|
|
listen 443 ssl http2; |
|
|
|
|
|
server_name sub.343.re; |
|
|
|
|
|
ssl_certificate /etc/ssl/certs/343.re/fullchain.pem; |
|
|
|
|
|
ssl_certificate_key /etc/ssl/certs/343.re/privkey.pem; |
|
|
|
|
|
root /var/www/sub-web/dist; |
|
|
|
|
|
index index.html; |
|
|
error_page 404 /index.html; |
|
|
error_page 404 /index.html; |
|
|
|
|
|
|
|
|
gzip on; #开启gzip压缩 |
|
|
gzip on; |
|
|
gzip_min_length 1k; #设置对数据启用压缩的最少字节数 |
|
|
gzip_min_length 1k; |
|
|
gzip_buffers 4 16k; |
|
|
gzip_buffers 4 16k; |
|
|
gzip_http_version 1.0; |
|
|
gzip_http_version 1.0; |
|
|
gzip_comp_level 6; #设置数据的压缩等级,等级为1-9,压缩比从小到大 |
|
|
gzip_comp_level 6; |
|
|
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; #设置需要压缩的数据格式 |
|
|
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; |
|
|
gzip_vary on; |
|
|
gzip_vary on; |
|
|
|
|
|
|
|
|
location ~* \.(css|js|png|jpg|jpeg|gif|gz|svg|mp4|ogg|ogv|webm|htc|xml|woff)$ { |
|
|
location ~* \.(css|js|png|jpg|jpeg|gif|gz|svg|mp4|ogg|ogv|webm|htc|xml|woff)$ { |
|
@ -94,18 +66,6 @@ server { |
|
|
} |
|
|
} |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
## Related |
|
|
## 许可证 |
|
|
|
|
|
|
|
|
- [tindy2013/subconverter](https://github.com/tindy2013/subconverter) |
|
|
|
|
|
- [CareyWang/MyUrls](https://github.com/CareyWang/MyUrls) |
|
|
|
|
|
- [CareyWang/bitly](https://github.com/CareyWang/bitly) |
|
|
|
|
|
|
|
|
|
|
|
## Contributing |
|
|
|
|
|
|
|
|
|
|
|
PRs accepted. |
|
|
|
|
|
|
|
|
|
|
|
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification. |
|
|
|
|
|
|
|
|
|
|
|
## License |
|
|
|
|
|
|
|
|
|
|
|
MIT © 2020 CareyWang |
|
|
MIT © 2020 Dnomd343 (fork from CareyWang) |
|
|