Skip to content

Commit

Permalink
auto generate configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
NewFuture committed Jul 29, 2018
1 parent 339e58b commit 7626f6c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DDNS

### 1.下载

* 二进制版(无需python环境,preview)
* 单文件版(二进制编译,无需python环境,preview)
* Windows [ddns.exe](https://github.com/NewFuture/DDNS/releases/)
* Linux (仅Ubuntu测试) [ddns](https://github.com/NewFuture/DDNS/releases/)
* 源码运行(需要python环境)
Expand All @@ -47,14 +47,14 @@ DDNS
### 2.快速配置

1. 复制 `example.config.json``config.json`
2. 申请 api token:
2. 申请 api `token`:
* [DNSPOD(国内版)创建token](https://support.dnspod.cn/Kb/showarticle/tsid/227/)
* [阿里云accesskey](https://help.aliyun.com/knowledge_detail/38738.html)
* [DNS.COM API Key/Secret](https://www.dns.com/member/apiSet)
* [DNSPOD(国际版)](https://www.dnspod.com/docs/info.html#get-the-user-token)
* [CloudFlare](https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-)

3. 修改配置,`ipv4``ipv6`字段,无则设为`[]`,详细参照配置说明
3. 修改配置,`ipv4``ipv6`字段,无则设为`[]`(此时不会解析和更新对应IP),详细参照配置说明


## 配置
Expand All @@ -64,7 +64,8 @@ DDNS
<summary>config.json
</summary>

可以使用 `-c`使用指定的配置文件 (默认读取当前目录的 config.json)
* 首次运行会自动生成一个模板配置文件
* 可以使用 `-c`使用指定的配置文件 (默认读取当前目录的 config.json)

```bash
python run.py -c /path/to/config.json
Expand Down Expand Up @@ -119,7 +120,7 @@ python run.py -c /path/to/config.json
</details>


## 定时任务 (暂时需要源码)
## 定时任务

<details>

Expand Down
17 changes: 0 additions & 17 deletions example.config.json

This file was deleted.

8 changes: 5 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ def get_config(key=None, default=None, path="config.json"):
"dns": "dnspod",
"ipv4": [
"your.domain",
"ipv4.yours.domain"
"server.your.domain"
],
"ipv6": [
"your.domain",
"ipv6.your.domain"
"server.your.domain",
"ipv6.server.your.domain"
],
"index4": "default",
"index6": "default",
"proxy": None
"proxy": None,
"debug": False,
}
json.dump(configure, configfile, indent=2, sort_keys=True)
sys.exit("New template configure file is created!")
Expand Down

0 comments on commit 7626f6c

Please sign in to comment.