Skip to content

Commit

Permalink
Move config to .env
Browse files Browse the repository at this point in the history
  • Loading branch information
CareyWang committed Aug 19, 2020
1 parent 1d4dae0 commit a09b1d7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 36 deletions.
16 changes: 16 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ node_modules
# local env files
.env.local
.env.*.local
.env

# Log files
npm-debug.log*
Expand Down
42 changes: 15 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

- 20200324
- 现在你可以使用 docker-compose 启动前端及短链接服务,服务端口及其他参数请自行在 .env 中配置。
## ChangeLog

```shell
git clone https://github.com/CareyWang/sub-web.git sub-web
- 20200730

cd sub-web
cp .env.example .env
- 独立各类后端配置到 .env 文件中,现在修改后端只需要修改 .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 来执行打包操作。

Expand Down Expand Up @@ -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.
Expand Down
15 changes: 7 additions & 8 deletions src/views/Subconverter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit a09b1d7

Please sign in to comment.