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