ddns 4.1.0b1__tar.gz → 4.1.0b3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ddns might be problematic. Click here for more details.

Files changed (83) hide show
  1. {ddns-4.1.0b1 → ddns-4.1.0b3}/PKG-INFO +95 -119
  2. {ddns-4.1.0b1 → ddns-4.1.0b3}/README.md +93 -116
  3. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/__builtins__.pyi +1 -0
  4. ddns-4.1.0b3/ddns/__init__.py +12 -0
  5. ddns-4.1.0b3/ddns/__main__.py +146 -0
  6. {ddns-4.1.0b1/ddns/util → ddns-4.1.0b3/ddns}/cache.py +42 -11
  7. {ddns-4.1.0b1/ddns/util → ddns-4.1.0b3/ddns}/ip.py +11 -11
  8. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/__init__.py +24 -4
  9. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/_base.py +65 -198
  10. ddns-4.1.0b3/ddns/provider/_signature.py +113 -0
  11. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/alidns.py +35 -17
  12. ddns-4.1.0b3/ddns/provider/aliesa.py +130 -0
  13. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/callback.py +10 -10
  14. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/cloudflare.py +10 -10
  15. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/debug.py +0 -1
  16. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/dnscom.py +7 -6
  17. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/dnspod.py +4 -7
  18. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/dnspod_com.py +1 -1
  19. ddns-4.1.0b3/ddns/provider/edgeone.py +83 -0
  20. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/he.py +4 -4
  21. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/huaweidns.py +12 -11
  22. ddns-4.1.0b3/ddns/provider/namesilo.py +159 -0
  23. ddns-4.1.0b3/ddns/provider/noip.py +101 -0
  24. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/provider/tencentcloud.py +13 -14
  25. ddns-4.1.0b3/ddns/util/comment.py +88 -0
  26. ddns-4.1.0b3/ddns/util/fileio.py +113 -0
  27. ddns-4.1.0b3/ddns/util/http.py +322 -0
  28. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns.egg-info/PKG-INFO +95 -119
  29. ddns-4.1.0b3/ddns.egg-info/SOURCES.txt +75 -0
  30. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns.egg-info/requires.txt +1 -2
  31. {ddns-4.1.0b1 → ddns-4.1.0b3}/pyproject.toml +46 -43
  32. ddns-4.1.0b1/tests/test_util_cache.py → ddns-4.1.0b3/tests/test_cache.py +196 -15
  33. ddns-4.1.0b3/tests/test_config_cli.py +543 -0
  34. ddns-4.1.0b3/tests/test_config_cli_task.py +471 -0
  35. ddns-4.1.0b3/tests/test_config_config.py +390 -0
  36. ddns-4.1.0b3/tests/test_config_env.py +265 -0
  37. ddns-4.1.0b3/tests/test_config_file.py +758 -0
  38. ddns-4.1.0b3/tests/test_config_file_remote.py +393 -0
  39. ddns-4.1.0b3/tests/test_config_init.py +449 -0
  40. ddns-4.1.0b3/tests/test_config_init_multi.py +294 -0
  41. ddns-4.1.0b3/tests/test_config_schema_v4_1.py +265 -0
  42. ddns-4.1.0b1/tests/test_hmac_sha256_authorization.py → ddns-4.1.0b3/tests/test_provider__signature.py +6 -6
  43. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_alidns.py +38 -57
  44. ddns-4.1.0b3/tests/test_provider_aliesa.py +510 -0
  45. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_base.py +72 -30
  46. ddns-4.1.0b1/tests/test_provider_simple.py → ddns-4.1.0b3/tests/test_provider_base_simple.py +38 -100
  47. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_callback.py +138 -117
  48. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_cloudflare.py +53 -59
  49. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_debug.py +17 -19
  50. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_dnscom.py +37 -42
  51. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_dnspod.py +8 -13
  52. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_dnspod_com.py +15 -15
  53. ddns-4.1.0b3/tests/test_provider_edgeone.py +507 -0
  54. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_he.py +37 -37
  55. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_huaweidns.py +24 -24
  56. ddns-4.1.0b3/tests/test_provider_namesilo.py +312 -0
  57. ddns-4.1.0b3/tests/test_provider_noip.py +389 -0
  58. ddns-4.1.0b3/tests/test_provider_proxy_list.py +154 -0
  59. {ddns-4.1.0b1 → ddns-4.1.0b3}/tests/test_provider_tencentcloud.py +18 -35
  60. ddns-4.1.0b3/tests/test_scheduler_base.py +197 -0
  61. ddns-4.1.0b3/tests/test_scheduler_cron.py +360 -0
  62. ddns-4.1.0b3/tests/test_scheduler_init.py +301 -0
  63. ddns-4.1.0b3/tests/test_scheduler_launchd.py +447 -0
  64. ddns-4.1.0b3/tests/test_scheduler_schtasks.py +331 -0
  65. ddns-4.1.0b3/tests/test_scheduler_systemd.py +355 -0
  66. ddns-4.1.0b3/tests/test_util_comment.py +249 -0
  67. ddns-4.1.0b3/tests/test_util_fileio.py +404 -0
  68. ddns-4.1.0b3/tests/test_util_http.py +515 -0
  69. ddns-4.1.0b3/tests/test_util_http_proxy_list.py +228 -0
  70. ddns-4.1.0b3/tests/test_util_http_retry.py +461 -0
  71. ddns-4.1.0b1/ddns/__init__.py +0 -21
  72. ddns-4.1.0b1/ddns/__main__.py +0 -193
  73. ddns-4.1.0b1/ddns/util/config.py +0 -314
  74. ddns-4.1.0b1/ddns/util/http.py +0 -277
  75. ddns-4.1.0b1/ddns.egg-info/SOURCES.txt +0 -46
  76. ddns-4.1.0b1/tests/test_config_ssl.py +0 -191
  77. ddns-4.1.0b1/tests/test_util_http.py +0 -597
  78. {ddns-4.1.0b1 → ddns-4.1.0b3}/LICENSE +0 -0
  79. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns/util/__init__.py +0 -0
  80. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns.egg-info/dependency_links.txt +0 -0
  81. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns.egg-info/entry_points.txt +0 -0
  82. {ddns-4.1.0b1 → ddns-4.1.0b3}/ddns.egg-info/top_level.txt +0 -0
  83. {ddns-4.1.0b1 → ddns-4.1.0b3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ddns
3
- Version: 4.1.0b1
3
+ Version: 4.1.0b3
4
4
  Summary: Dynamic DNS client for multiple providers, supporting IPv4 and IPv6.
5
5
  Author-email: NewFuture <python@newfuture.cc>
6
6
  License-Expression: MIT
@@ -34,8 +34,7 @@ Requires-Python: >=2.7
34
34
  Description-Content-Type: text/markdown
35
35
  License-File: LICENSE
36
36
  Provides-Extra: dev
37
- Requires-Dist: black; extra == "dev"
38
- Requires-Dist: flake8; extra == "dev"
37
+ Requires-Dist: ruff; extra == "dev"
39
38
  Requires-Dist: mock; python_version < "3.3" and extra == "dev"
40
39
  Provides-Extra: pytest
41
40
  Requires-Dist: pytest>=6.0; extra == "pytest"
@@ -43,72 +42,63 @@ Requires-Dist: pytest-cov; extra == "pytest"
43
42
  Requires-Dist: mock; python_version < "3.3" and extra == "pytest"
44
43
  Dynamic: license-file
45
44
 
46
- # [<img src="https://ddns.newfuture.cc/doc/img/ddns.svg" width="32px" height="32px"/>](https://ddns.newfuture.cc) [DDNS](https://github.com/NewFuture/DDNS)
45
+ # [<img src="https://ddns.newfuture.cc/doc/img/ddns.svg" width="32px" height="32px"/>](https://ddns.newfuture.cc) DDNS
47
46
 
48
- > 自动更新 DNS 解析 到本机 IP 地址,支持 IPv4 和 IPv6,本地(内网)IP 和公网 IP。
49
- > 代理模式,支持自动创建 DNS 记录。
47
+ > 自动更新 DNS 解析到本机 IP 地址,支持 IPv4/IPv6,内网/公网 IP,自动创建 DNS 记录
50
48
 
51
- [![Github Release](https://img.shields.io/github/v/release/NewFuture/DDNS?&logo=github&style=flatten
52
- )](https://github.com/NewFuture/DDNS/releases/latest)
53
- [![PyPI](https://img.shields.io/pypi/v/ddns.svg?label=ddns&logo=pypi&style=flatten)](https://pypi.org/project/ddns/)
54
- [![Docker Image Version](https://img.shields.io/docker/v/newfuture/ddns?label=newfuture/ddns&logo=docker&&sort=semver&style=flatten)](https://hub.docker.com/r/newfuture/ddns)
55
- [![Build Status](https://github.com/NewFuture/DDNS/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/NewFuture/DDNS/actions/workflows/build.yml)
49
+ [![GitHub](https://img.shields.io/github/license/NewFuture/DDNS?logo=github&style=flat)](https://github.com/NewFuture/DDNS)
50
+ [![Build](https://github.com/NewFuture/DDNS/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/NewFuture/DDNS/actions/workflows/build.yml)
56
51
  [![Publish](https://github.com/NewFuture/DDNS/actions/workflows/publish.yml/badge.svg)](https://github.com/NewFuture/DDNS/actions/workflows/publish.yml)
52
+ [![Release](https://img.shields.io/github/v/release/NewFuture/DDNS?logo=github&style=flat)](https://github.com/NewFuture/DDNS/releases/latest)
53
+ [![PyPI](https://img.shields.io/pypi/v/ddns.svg?logo=pypi&style=flat)](https://pypi.org/project/ddns/)
54
+ [![Python Version](https://img.shields.io/pypi/pyversions/ddns.svg?logo=python&style=flat)](https://pypi.org/project/ddns/)
55
+ [![Docker](https://img.shields.io/docker/v/newfuture/ddns?logo=docker&sort=semver&style=flat)](https://hub.docker.com/r/newfuture/ddns)
56
+ [![Docker image size](https://img.shields.io/docker/image-size/newfuture/ddns/latest?logo=docker&style=flat)](https://hub.docker.com/r/newfuture/ddns)
57
57
 
58
- ---
59
-
60
- ## Features
61
-
62
- - 兼容和跨平台:
63
- - [Docker (@NN708)](https://hub.docker.com/r/newfuture/ddns) [![Docker Image Size](https://img.shields.io/docker/image-size/newfuture/ddns/latest?logo=docker&style=social)](https://hub.docker.com/r/newfuture/ddns)[![Docker Platforms](https://img.shields.io/badge/arch-amd64%20%7C%20arm64%20%7C%20arm%2Fv7%20%7C%20arm%2Fv6%20%7C%20ppc64le%20%7C%20s390x%20%7C%20386%20%7C%20riscv64-blue?style=social)](https://hub.docker.com/r/newfuture/ddns)
64
- - [二进制文件](https://github.com/NewFuture/DDNS/releases/latest) ![cross platform](https://img.shields.io/badge/system-windows_%7C%20linux_%7C%20mac-success.svg?style=social)
65
-
66
- - 配置方式:
67
- - [命令行参数](https://ddns.newfuture.cc/doc/cli.html)
68
- - [JSON 配置文件](https://ddns.newfuture.cc/doc/json.html)
69
- - [环境变量配置](https://ddns.newfuture.cc/doc/env.html)
70
- - [服务商配置指南](https://ddns.newfuture.cc/doc/providers/)
71
-
72
- - 域名支持:
73
- - 多个域名支持
74
- - 多级域名解析
75
- - 自动创建新 DNS 记录
76
- - IP 类型:
77
- - 内网 IPv4 / IPv6
78
- - 公网 IPv4 / IPv6 (支持自定义 API)
79
- - 自定义命令(shell)
80
- - 正则选取支持 (@rufengsuixing)
81
- - 网络代理:
82
- - http 代理支持
83
- - 多代理自动切换
84
- - 服务商支持:
85
- - [DNSPOD](https://www.dnspod.cn/) ([配置指南](doc/providers/dnspod.md))
86
- - [阿里 DNS](http://www.alidns.com/) ([配置指南](doc/providers/alidns.md)) ⚡
87
- - [DNS.COM](https://www.dns.com/) (@loftor-git)
88
- - [DNSPOD 国际版](https://www.dnspod.com/)
89
- - [CloudFlare](https://www.cloudflare.com/) (@tongyifan)
90
- - [HE.net](https://dns.he.net/) (@NN708) (不支持自动创建记录)
91
- - [华为云](https://huaweicloud.com/) (@cybmp3) ⚡
92
- - [腾讯云](https://cloud.tencent.com/) ([配置指南](doc/providers/tencentcloud.md)) ⚡
93
- - 自定义回调 API ([配置指南](doc/providers/callback.md))
94
-
95
- > ⚡ 标记的服务商使用高级 HMAC-SHA256 签名认证,提供企业级安全保障
96
- - 其他:
97
- - 可设置定时任务
98
- - TTL 配置支持
99
- - DNS 线路(运营商)配置支持(国内服务商)
100
- - 本地文件缓存(减少 API 请求)
101
- - 地址变更时触发自定义回调 API(与 DDNS 功能互斥)
58
+ ## 主要特性
59
+
60
+ ### 🚀 多平台支持
61
+
62
+ - **Docker**: 推荐方式,支持 `amd64`、`arm64`、`arm/v7` 等多架构 ([使用文档](doc/docker.md))
63
+ - **二进制文件**: 单文件运行,支持 Windows/Linux/macOS ([下载地址](https://github.com/NewFuture/DDNS/releases/latest))
64
+ - **pip 安装**: `pip install ddns`
65
+ - **源码运行**: 无依赖,仅需 Python 环境
66
+
67
+ ### ⚙️ 灵活配置
68
+
69
+ - **命令行参数**: `ddns --dns=dnspod --id=xxx --token=xxx` ([配置文档](doc/config/cli.md))
70
+ - **JSON 配置文件**: 支持多域名、多服务商配置,支持远程URL配置 ([配置文档](doc/config/json.md))
71
+ - **环境变量**: Docker 友好的配置方式 ([配置文档](doc/config/env.md))
72
+
73
+ ### 🌍 DNS 服务商支持
74
+
75
+ 支持 15+ 主流 DNS 服务商,包括:
76
+
77
+ - **国内**: [阿里DNS](doc/providers/alidns.md) ⚡、[阿里云ESA](doc/providers/aliesa.md) ⚡、[DNSPOD](doc/providers/dnspod.md)、[腾讯云DNS](doc/providers/tencentcloud.md) ⚡、[腾讯云EdgeOne](doc/providers/edgeone.md) ⚡、[华为云DNS](doc/providers/huaweidns.md) ⚡、[DNS.COM](doc/providers/51dns.md)
78
+ - **国际**: [Cloudflare](doc/providers/cloudflare.md)、[DNSPOD国际版](doc/providers/dnspod_com.md)、[HE.net](doc/providers/he.md)、[NameSilo](doc/providers/namesilo.md)、[No-IP](doc/providers/noip.md)
79
+ - **自定义**: [回调 API](doc/providers/callback.md)、[调试模式](doc/providers/debug.md)
80
+
81
+ > ⚡ 表示支持 HMAC-SHA256 企业级安全认证 | [查看所有服务商](doc/providers/)
82
+
83
+ ### 🔧 高级功能
84
+
85
+ - 多域名和多级域名解析
86
+ - IPv4/IPv6 双栈支持
87
+ - 自动创建 DNS 记录
88
+ - 内网/公网 IP 自动检测
89
+ - HTTP 代理和多代理切换
90
+ - 本地缓存减少 API 调用
91
+ - [定时任务](doc/config/cli.md#task-management-定时任务管理)和日志管理
102
92
 
103
93
  ## 使用
104
94
 
105
95
  ### ① 安装
106
96
 
107
- 根据需要选择一种方式:`二进制`版、`pip`版、`源码`运行,或者 `Docker`。
97
+ 根据需要选择一种方式:`一键脚本`、`二进制`版、`pip`版、`源码`运行,或者 `Docker`。
108
98
 
109
99
  推荐 Docker 版,兼容性最佳,体积小,性能优化。
110
100
 
111
- - #### Docker(需要安装 Docker)
101
+ - #### Docker(推荐)
112
102
 
113
103
  详细说明和高级用法请查看 [Docker 使用文档](https://ddns.newfuture.cc/doc/docker.html)
114
104
 
@@ -141,19 +131,28 @@ Dynamic: license-file
141
131
 
142
132
  </details>
143
133
 
134
+ - #### 二进制版(单文件,无需 python)
135
+
136
+ 前往[release下载对应版本](https://github.com/NewFuture/DDNS/releases/latest)
137
+
138
+ 也可使用一键安装脚本自动下载并安装对应平台的二进制:
139
+
140
+ ```bash
141
+ curl -fSL https://ddns.newfuture.cc/install.sh | sh
142
+ ```
143
+ 提示:安装到系统目录(如 /usr/local/bin)可能需要 root 或 sudo 权限;若权限不足,可改为 `sudo sh` 运行。
144
+
145
+ 详细说明请查看 [一键安装文档](doc/install.md)
146
+
144
147
  - #### pip 安装(需要 pip 或 easy_install)
145
148
 
146
149
  1. 安装 ddns: `pip install ddns` 或 `easy_install ddns`
147
150
  2. 运行: `ddns -h` 或者 `python -m ddns`
148
151
 
149
- - #### 二进制版(单文件,无需 python)
150
-
151
- 前往[release下载对应版本](https://github.com/NewFuture/DDNS/releases/latest)
152
-
153
152
  - #### 源码运行(无任何依赖,需 python 环境)
154
153
 
155
154
  1. clone 或者 [下载此仓库](https://github.com/NewFuture/DDNS/archive/master.zip) 并解压
156
- 2. 运行 `python run.py` 或者 `python -m ddns`
155
+ 2. 运行 `python -m ddns`
157
156
 
158
157
  ### ② 快速配置
159
158
 
@@ -161,12 +160,16 @@ Dynamic: license-file
161
160
 
162
161
  - **DNSPOD(中国版)**: [创建 token](https://support.dnspod.cn/Kb/showarticle/tsid/227/) | [详细配置文档](doc/providers/dnspod.md)
163
162
  - **阿里云 DNS**: [申请 accesskey](https://help.aliyun.com/document_detail/87745.htm) | [详细配置文档](doc/providers/alidns.md)
164
- - **DNS.COM**: [API Key/Secret](https://www.dns.com/member/apiSet)
165
- - **DNSPOD(国际版)**: [获取 token](https://www.dnspod.com/docs/info.html#get-the-user-token)
166
- - **CloudFlare**: [API Key](https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-)(除了 `email + API KEY`,也可使用 `Token`,**需要list Zone 权限**)
167
- - **HE.net**: [DDNS 文档](https://dns.he.net/docs.html)(仅需将设置的密码填入 `token` 字段,`id` 字段可留空)
168
- - **华为云 DNS**: [APIKEY 申请](https://console.huaweicloud.com/iam/)(点左边访问密钥,然后点新增访问密钥)
169
- - **腾讯云 DNS**: [详细配置文档](doc/providers/tencentcloud.md)
163
+ - **阿里云边缘安全加速(ESA)**: [申请 accesskey](https://help.aliyun.com/document_detail/87745.htm) | [详细配置文档](doc/providers/aliesa.md)
164
+ - **51DNS(dns.com)**: [API Key/Secret](https://www.dns.com/member/apiSet) | [详细配置文档](doc/providers/51dns.md)
165
+ - **DNSPOD(国际版)**: [获取 token](https://www.dnspod.com/docs/info.html#get-the-user-token) | [详细配置文档](doc/providers/dnspod_com.md)
166
+ - **CloudFlare**: [API Key](https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-)(除了 `email + API KEY`,也可使用 `Token`,**需要list Zone 权限**) | [详细配置文档](doc/providers/cloudflare.md)
167
+ - **HE.net**: [DDNS 文档](https://dns.he.net/docs.html)(仅需将设置的密码填入 `token` 字段,`id` 字段可留空) | [详细配置文档](doc/providers/he.md)
168
+ - **华为云 DNS**: [APIKEY 申请](https://console.huaweicloud.com/iam/)(点左边访问密钥,然后点新增访问密钥) | [详细配置文档](doc/providers/huaweidns.md)
169
+ - **NameSilo**: [API Key](https://www.namesilo.com/account/api-manager)(API Manager 中获取 API Key) | [详细配置文档](doc/providers/namesilo.md)
170
+ - **腾讯云 DNS**: [API Secret](https://console.cloud.tencent.com/cam/capi) | [详细配置文档](doc/providers/tencentcloud.md)
171
+ - **腾讯云 EdgeOne**: [API Secret](https://console.cloud.tencent.com/cam/capi) | [详细配置文档](doc/providers/edgeone.md)
172
+ - **No-IP**: [用户名和密码](https://www.noip.com/)(使用 No-IP 账户的用户名和密码) | [详细配置文档](doc/providers/noip.md)
170
173
  - **自定义回调**: 参数填写方式请查看下方的自定义回调配置说明
171
174
 
172
175
  2. 修改配置文件,`ipv4` 和 `ipv6` 字段,为待更新的域名,详细参照配置说明
@@ -175,9 +178,9 @@ Dynamic: license-file
175
178
 
176
179
  所有字段可通过三种方式进行配置,优先级为:**命令行参数 > JSON配置文件 > 环境变量**
177
180
 
178
- 1. [命令行参数](doc/cli.md) `ddns --key=value`(`ddns -h` 查看详情),优先级最高
179
- 2. [JSON 配置文件](doc/json.md)(值为 null 认为是有效值,会覆盖环境变量的设置,如果没有对应的 key 则会尝试使用环境变量)
180
- 3. 环境变量 DDNS_ 前缀加上 key 全大写或者全小写,点转下划线(`${ddns_id}` 或 `${DDNS_ID}`,`${DDNS_LOG_LEVEL}`)
181
+ 1. [命令行参数](doc/config/cli.md) `ddns --key=value`(`ddns -h` 查看详情),优先级最高
182
+ 2. [JSON 配置文件](doc/config/json.md)(值为 null 认为是有效值,会覆盖环境变量的设置,如果没有对应的 key 则会尝试使用环境变量)
183
+ 3. [环境变量](doc/config/env.md) DDNS_ 前缀加上 key (`${ddns_id}` 或 `${DDNS_ID}`,`${DDNS_LOG_LEVEL}`)
181
184
 
182
185
  ### 配置优先级和字段覆盖关系
183
186
 
@@ -193,9 +196,9 @@ Dynamic: license-file
193
196
  - `debug`参数只在命令行中有效,JSON配置文件中的同名设置无效
194
197
  - 多值参数(如`ipv4`、`ipv6`等)在命令行中使用方式为重复使用参数,如`--ipv4 domain1 --ipv4 domain2`
195
198
 
196
- 各配置方式的详细说明请查看对应文档:[命令行](doc/cli.md)、[JSON配置](doc/json.md)、[环境变量](doc/env.md)、[服务商配置](doc/providers/)
199
+ 各配置方式的详细说明请查看对应文档:[命令行](doc/config/cli.md)、[JSON配置](doc/config/json.md)、[环境变量](doc/config/env.md)、[服务商配置](doc/providers/)
197
200
 
198
- > 📖 **环境变量详细配置**: 查看 [环境变量配置文档](doc/env.md) 了解所有环境变量的详细用法和示例
201
+ > 📖 **环境变量详细配置**: 查看 [环境变量配置文档](doc/config/env.md) 了解所有环境变量的详细用法和示例
199
202
 
200
203
  <details open>
201
204
  <summary markdown="span">config.json 配置文件</summary>
@@ -203,12 +206,14 @@ Dynamic: license-file
203
206
  - 首次运行会自动生成一个模板配置文件
204
207
  - 可以使用 `-c` 使用指定的配置文件(默认读取当前目录的 config.json)
205
208
  - 推荐使用 vscode 等支持 JsonSchema 的编辑器编辑配置文件
206
- - 查看 [JSON配置文件详细文档](doc/json.md) 了解完整的配置选项和示例
209
+ - 查看 [JSON配置文件详细文档](doc/config/json.md) 了解完整的配置选项和示例
207
210
 
208
211
  ```bash
209
212
  ddns -c path/to/config.json
210
213
  # 或者python运行
211
214
  python -m ddns -c /path/to/config.json
215
+ # 远程配置文件
216
+ ddns -c https://ddns.newfuture.cc/tests/config/debug.json
212
217
  ```
213
218
 
214
219
  #### 配置参数表
@@ -217,13 +222,13 @@ python -m ddns -c /path/to/config.json
217
222
  | :----: | :----------------: | :------: | :---------: | :----------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
218
223
  | id | string | √ | 无 | api 访问 ID | Cloudflare 为邮箱(使用 Token 时留空)<br>HE.net 可留空<br>华为云为 Access Key ID (AK) |
219
224
  | token | string | √ | 无 | api 授权 token | 部分平台叫 secret key,**反馈粘贴时删除** |
220
- | dns | string | No | `"dnspod"` | dns 服务商 | 阿里 DNS 为 `alidns`,Cloudflare 为 `cloudflare`,dns.com 为 `dnscom`,DNSPOD 国内为 `dnspod`,DNSPOD 国际为 `dnspod_com`,HE.net 为 `he`,华为云为 `huaweidns`,腾讯云为 `tencentcloud`,自定义回调为 `callback`。部分服务商有[详细配置文档](doc/providers/) |
225
+ | dns | string | No | `"dnspod"` | dns 服务商 | 阿里 DNS 为 `alidns`,阿里ESA为 `aliesa`,Cloudflare 为 `cloudflare`,dns.com 为 `dnscom`,DNSPOD 国内为 `dnspod`,DNSPOD 国际为 `dnspod_com`,HE.net 为 `he`,华为云为 `huaweidns`,NameSilo 为 `namesilo`,腾讯云为 `tencentcloud`,腾讯云EdgeOne为 `edgeone`,No-IP 为 `noip`,自定义回调为 `callback`。部分服务商有[详细配置文档](doc/providers/) |
221
226
  | ipv4 | array | No | `[]` | ipv4 域名列表 | 为 `[]` 时,不会获取和更新 IPv4 地址 |
222
227
  | ipv6 | array | No | `[]` | ipv6 域名列表 | 为 `[]` 时,不会获取和更新 IPv6 地址 |
223
228
  | index4 | string\|int\|array | No | `"default"` | ipv4 获取方式 | 可设置 `网卡`、`内网`、`公网`、`正则` 等方式 |
224
229
  | index6 | string\|int\|array | No | `"default"` | ipv6 获取方式 | 可设置 `网卡`、`内网`、`公网`、`正则` 等方式 |
225
230
  | ttl | number | No | `null` | DNS 解析 TTL 时间 | 不设置采用 DNS 默认策略 |
226
- | proxy | string\|array | No | 无 | http 代理 `;` 分割 | 多代理逐个尝试直到成功,`DIRECT` 为直连 |
231
+ | proxy | string\|array | No | 无 | HTTP 代理格式:`http://host:port` | 多代理逐个尝试直到成功,`DIRECT` 为直连 |
227
232
  | ssl | string\|boolean | No | `"auto"` | SSL证书验证方式 | `true`(强制验证)、`false`(禁用验证)、`"auto"`(自动降级)或自定义CA证书文件路径 |
228
233
  | debug | bool | No | `false` | 是否开启调试 | 调试模式,仅命令行参数`--debug`有效 |
229
234
  | cache | string\|bool | No | `true` | 是否缓存记录 | 正常情况打开避免频繁更新,默认位置为临时目录下 `ddns.cache`,也可以指定一个具体路径 |
@@ -266,13 +271,13 @@ python -m ddns -c /path/to/config.json
266
271
  "$schema": "https://ddns.newfuture.cc/schema/v4.0.json",
267
272
  "id": "12345",
268
273
  "token": "mytokenkey",
269
- "dns": "dnspod 或 dnspod_com 或 alidns 或 dnscom 或 cloudflare 或 he 或 huaweidns 或 tencentcloud 或 callback",
274
+ "dns": "dnspod 或 dnspod_com 或 alidns 或 aliesa 或 dnscom 或 cloudflare 或 he 或 huaweidns 或 namesilo 或 tencentcloud 或 noip 或 callback",
270
275
  "ipv4": ["ddns.newfuture.cc", "ipv4.ddns.newfuture.cc"],
271
276
  "ipv6": ["ddns.newfuture.cc", "ipv6.ddns.newfuture.cc"],
272
277
  "index4": 0,
273
278
  "index6": "public",
274
279
  "ttl": 600,
275
- "proxy": ["127.0.0.1:1080", "DIRECT"],
280
+ "proxy": ["http://127.0.0.1:1080", "DIRECT"],
276
281
  "log": {
277
282
  "level": "DEBUG",
278
283
  "file": "dns.log",
@@ -286,58 +291,29 @@ python -m ddns -c /path/to/config.json
286
291
  ## 定时任务
287
292
 
288
293
  <details>
289
- <summary markdown="span">可以通过脚本设置定时任务(默认每 5 分钟检查一次 IP,自动更新)</summary>
290
-
291
- #### Windows
292
-
293
- - [推荐] 以系统身份运行,右键“以管理员身份运行”`task.bat`(或者在管理员命令行中运行)
294
- - 以当前用户身份运行定时任务,双击或运行 `task.bat`(执行时会闪黑框)
294
+ <summary markdown="span">使用内置的 task 命令设置定时任务(默认每 5 分钟检查一次 IP,自动更新)</summary>
295
295
 
296
- #### Linux
296
+ DDNS 提供内置的 `task` 子命令来管理定时任务,支持跨平台自动化部署:
297
297
 
298
- - 使用 init.d 和 crontab:
298
+ ### 高级管理
299
299
 
300
- ```bash
301
- sudo ./task.sh
302
- ```
303
-
304
- - 使用 systemd:
300
+ ```bash
301
+ # 安装并指定更新间隔(分钟)
302
+ ddns task --install 10 -c /etc/config/ddns.json
305
303
 
306
- ```bash
307
- 安装:
308
- sudo ./systemd.sh install
309
- 卸载:
310
- sudo ./systemd.sh uninstall
311
- ```
304
+ # 启用/禁用任务
305
+ ddns task --enable
306
+ ddns task --disable
307
+ ```
312
308
 
313
- 该脚本安装的文件符合 [Filesystem Hierarchy Standard (FHS)](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)
314
- 可执行文件所在目录为 `/usr/share/DDNS`
315
- 配置文件所在目录为 `/etc/DDNS`
309
+ 详细配置指南请参考:[命令行参数文档](https://ddns.newfuture.cc/doc/config/cli.md#task-management-定时任务管理)
316
310
 
317
- #### Docker
311
+ ### Docker
318
312
 
319
313
  Docker 镜像在无额外参数的情况下,已默认启用每 5 分钟执行一次的定时任务
320
314
 
321
315
  </details>
322
316
 
323
- ## FAQ
324
-
325
- <details>
326
- <summary markdown="span">Windows Server [SSL: CERTIFICATE_VERIFY_FAILED]</summary>
327
-
328
- > Windows Server 默认安全策略会禁止任何未添加的信任 SSL 证书,可手动添加一下对应的证书 [#56](https://github.com/NewFuture/DDNS/issues/56#issuecomment-487371078)
329
-
330
- 使用系统自带的 IE 浏览器访问一次对应的 API 即可
331
-
332
- - alidns 打开: <https://alidns.aliyuncs.com>
333
- - cloudflare 打开: <https://api.cloudflare.com>
334
- - dns.com 打开: <https://www.dns.com>
335
- - dnspod.cn 打开: <https://dnsapi.cn>
336
- - dnspod 国际版: <https://api.dnspod.com>
337
- - 华为 DNS <https://dns.myhuaweicloud.com>
338
-
339
- </details>
340
-
341
317
  <details>
342
318
  <summary markdown="span">问题排查反馈</summary>
343
319