Browse Source

Move config to .env

develop
CareyWong 4 years ago
parent
commit
a09b1d7c9f
  1. 16
      .env
  2. 1
      .gitignore
  3. 42
      README.md
  4. 15
      src/views/Subconverter.vue

16
.env

@ -0,0 +1,16 @@
VUE_APP_PROJECT = "https://github.com/CareyWang/sub-web"
VUE_APP_BOT_LINK = "https://t.me/CareyWong_bot"
VUE_APP_BACKEND_RELEASE = "https://github.com/tindy2013/subconverter/releases"
VUE_APP_SUBCONVERTER_REMOTE_CONFIG = "https://raw.githubusercontent.com/tindy2013/subconverter/master/base/config/example_external_config.ini"
# API 后端
VUE_APP_SUBCONVERTER_DEFAULT_BACKEND = "https://api.wcc.best"
# 短链接后端
VUE_APP_MYURLS_DEFAULT_BACKEND = "https://suo.yt"
# 文本托管后端
VUE_APP_CONFIG_UPLOAD_BACKEND = "https://api.wcc.best"

1
.gitignore

@ -5,7 +5,6 @@ node_modules
# local env files
.env.local
.env.*.local
.env
# Log files
npm-debug.log*

42
README.md

@ -4,46 +4,28 @@
## Table of Contents
- [Update](#Update)
- [ChangeLog](#ChangeLog)
- [Docker](#Docker)
- [Requirements](#Requirements)
- [Install](#install)
- [Usage](#usage)
- [Related](#Related)
- [Contributing](#contributing)
- [License](#license)
## Update
## ChangeLog
- 20200324
- 现在你可以使用 docker-compose 启动前端及短链接服务,服务端口及其他参数请自行在 .env 中配置。
- 20200730
```shell
git clone https://github.com/CareyWang/sub-web.git sub-web
- 独立各类后端配置到 .env 文件中,现在修改后端只需要修改 .env 即可。
cd sub-web
cp .env.example .env
docker-compose up -d
```
- 20200309
- 由于 bitly 免费账户月调用量限制,现在你可以放弃bitly,使用本地部署的短链接服务。参考 [MyUrls](https://github.com/CareyWang/MyUrls) 搭建。
- 20200301
- 现在你可以使用 docker 部署
```shell
docker run -d -p 58080:80 --restart always --name subweb careywong/subweb:latest
```
- 20200227
- 提供了短链接服务,可用于缩短生成的订阅 url,请和谐使用。
> 注:需要后端支持。自行搭建服务,请参考 [bitly](https://github.com/CareyWang/bitly) 并修改 src/views/Subconverter.vue 中 **shortUrlBackend** 配置项。
## Docker
```shell
docker run -d -p 58080:80 --restart always --name subweb careywong/subweb:latest
```
若需要对代码进行修改,你需要在本地构建镜像并运行。
注:每次修改代码,你都需要重新执行 docker build 来执行打包操作。
@ -112,6 +94,12 @@ 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.

15
src/views/Subconverter.vue

@ -218,14 +218,13 @@
</template>
<script>
const project = "https://github.com/CareyWang/sub-web";
const remoteConfigSample =
"https://raw.githubusercontent.com/tindy2013/subconverter/master/base/config/example_external_config.ini";
const gayhubRelease = "https://github.com/tindy2013/subconverter/releases";
const defaultBackend = "https://api.wcc.best/sub?";
const shortUrlBackend = "https://api.suo.yt/short";
const configUploadBackend = "https://api.wcc.best/config/upload";
const tgBotLink = "https://t.me/CareyWong_bot";
const project = process.env.VUE_APP_PROJECT
const remoteConfigSample = process.env.VUE_APP_SUBCONVERTER_REMOTE_CONFIG
const gayhubRelease = process.env.VUE_APP_BACKEND_RELEASE
const defaultBackend = process.env.VUE_APP_SUBCONVERTER_DEFAULT_BACKEND + '/sub?'
const shortUrlBackend = process.env.VUE_APP_MYURLS_DEFAULT_BACKEND + '/short'
const configUploadBackend = process.env.VUE_APP_CONFIG_UPLOAD_BACKEND + '/config/upload'
const tgBotLink = process.env.VUE_APP_BOT_LINK
export default {
data() {

Loading…
Cancel
Save