ddns 4.0.0b8__tar.gz → 4.0.2__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.
- {ddns-4.0.0b8 → ddns-4.0.2}/PKG-INFO +2 -2
- {ddns-4.0.0b8 → ddns-4.0.2}/README.md +1 -1
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/__init__.py +3 -3
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/__main__.py +13 -6
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/util/config.py +19 -15
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns.egg-info/PKG-INFO +2 -2
- {ddns-4.0.0b8 → ddns-4.0.2}/LICENSE +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/__init__.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/alidns.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/callback.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/cloudflare.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/dnscom.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/dnspod.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/dnspod_com.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/he.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/provider/huaweidns.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/util/__init__.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/util/cache.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns/util/ip.py +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns.egg-info/SOURCES.txt +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns.egg-info/dependency_links.txt +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns.egg-info/entry_points.txt +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns.egg-info/requires.txt +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/ddns.egg-info/top_level.txt +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/pyproject.toml +0 -0
- {ddns-4.0.0b8 → ddns-4.0.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ddns
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.2
|
|
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
|
|
@@ -55,7 +55,7 @@ Dynamic: license-file
|
|
|
55
55
|
## Features
|
|
56
56
|
|
|
57
57
|
- 兼容和跨平台:
|
|
58
|
-
- [Docker (@NN708)](https://hub.docker.com/r/newfuture/ddns) [](https://hub.docker.com/r/newfuture/ddns)[](https://hub.docker.com/r/newfuture/ddns) [](https://hub.docker.com/r/newfuture/ddns)[](https://hub.docker.com/r/newfuture/ddns)
|
|
59
59
|
- [二进制文件](https://github.com/NewFuture/DDNS/releases/latest) 
|
|
60
60
|
|
|
61
61
|
- 配置方式:
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
## Features
|
|
16
16
|
|
|
17
17
|
- 兼容和跨平台:
|
|
18
|
-
- [Docker (@NN708)](https://hub.docker.com/r/newfuture/ddns) [](https://hub.docker.com/r/newfuture/ddns)[](https://hub.docker.com/r/newfuture/ddns) [](https://hub.docker.com/r/newfuture/ddns)[](https://hub.docker.com/r/newfuture/ddns)
|
|
19
19
|
- [二进制文件](https://github.com/NewFuture/DDNS/releases/latest) 
|
|
20
20
|
|
|
21
21
|
- 配置方式:
|
|
@@ -6,13 +6,13 @@ ddns Package
|
|
|
6
6
|
__description__ = "automatically update DNS records to my IP [域名自动指向本机IP]"
|
|
7
7
|
|
|
8
8
|
# 编译时,版本会被替换
|
|
9
|
-
__version__ = "4.0.
|
|
9
|
+
__version__ = "4.0.2"
|
|
10
10
|
|
|
11
11
|
# 时间也会被替换掉
|
|
12
|
-
build_date = "2025-06-
|
|
12
|
+
build_date = "2025-06-25T01:07:58Z"
|
|
13
13
|
|
|
14
14
|
__doc__ = """
|
|
15
|
-
ddns[{}@{}]
|
|
15
|
+
ddns [v{}@{}]
|
|
16
16
|
(i) homepage or docs [文档主页]: https://ddns.newfuture.cc/
|
|
17
17
|
(?) issues or bugs [问题和反馈]: https://github.com/NewFuture/DDNS/issues
|
|
18
18
|
Copyright (c) New Future (MIT License)
|
|
@@ -9,7 +9,7 @@ from os import path, environ, name as os_name
|
|
|
9
9
|
from io import TextIOWrapper
|
|
10
10
|
from subprocess import check_output
|
|
11
11
|
from tempfile import gettempdir
|
|
12
|
-
from logging import basicConfig, info, warning, error, debug,
|
|
12
|
+
from logging import basicConfig, info, warning, error, debug, INFO
|
|
13
13
|
|
|
14
14
|
import sys
|
|
15
15
|
|
|
@@ -126,11 +126,18 @@ def main():
|
|
|
126
126
|
sys.stderr = TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
|
|
127
127
|
init_config(__description__, __doc__, __version__, build_date)
|
|
128
128
|
|
|
129
|
-
log_level = get_config('log.level')
|
|
130
|
-
log_format = get_config('log.format'
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
log_level = get_config('log.level', INFO)
|
|
130
|
+
log_format = get_config('log.format')
|
|
131
|
+
if log_format:
|
|
132
|
+
# A custom log format is already set; no further action is required.
|
|
133
|
+
pass
|
|
134
|
+
elif log_level < INFO:
|
|
135
|
+
# Override log format in debug mode to include filename and line number for detailed debugging
|
|
136
|
+
log_format = '%(asctime)s %(levelname)s [%(module)s.%(funcName)s](%(filename)s:%(lineno)d): %(message)s'
|
|
137
|
+
elif log_level > INFO:
|
|
138
|
+
log_format = '%(asctime)s %(levelname)s: %(message)s'
|
|
139
|
+
else:
|
|
140
|
+
log_format = '%(asctime)s %(levelname)s [%(module)s]: %(message)s'
|
|
134
141
|
basicConfig(
|
|
135
142
|
level=log_level,
|
|
136
143
|
format=log_format,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
1
|
# -*- coding:utf-8 -*-
|
|
3
2
|
from argparse import Action, ArgumentParser, Namespace, RawTextHelpFormatter
|
|
4
3
|
from json import load as loadjson, dump as dumpjson
|
|
5
4
|
from os import stat, environ, path
|
|
6
|
-
from logging import error, getLevelName
|
|
5
|
+
from logging import critical, error, getLevelName
|
|
7
6
|
from ast import literal_eval
|
|
8
7
|
|
|
9
8
|
import platform
|
|
@@ -13,14 +12,12 @@ import sys
|
|
|
13
12
|
__cli_args = Namespace()
|
|
14
13
|
__config = {} # type: dict
|
|
15
14
|
log_levels = [
|
|
16
|
-
"CRITICAL",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"DEBUG",
|
|
23
|
-
"NOTSET",
|
|
15
|
+
"CRITICAL", # 50
|
|
16
|
+
"ERROR", # 40
|
|
17
|
+
"WARNING", # 30
|
|
18
|
+
"INFO", # 20
|
|
19
|
+
"DEBUG", # 10
|
|
20
|
+
"NOTSET", # 0
|
|
24
21
|
]
|
|
25
22
|
|
|
26
23
|
# 支持数组的参数列表
|
|
@@ -46,6 +43,7 @@ def str2bool(v):
|
|
|
46
43
|
def log_level(value):
|
|
47
44
|
"""
|
|
48
45
|
parse string to log level
|
|
46
|
+
or getattr(logging, value.upper())
|
|
49
47
|
"""
|
|
50
48
|
return getLevelName(value.upper())
|
|
51
49
|
|
|
@@ -70,9 +68,15 @@ def parse_array_string(value, enable_simple_split):
|
|
|
70
68
|
except (ValueError, SyntaxError) as e:
|
|
71
69
|
# 解析失败时返回原始字符串
|
|
72
70
|
error("Failed to parse array string: %s. Exception: %s", value, e)
|
|
73
|
-
elif enable_simple_split
|
|
71
|
+
elif enable_simple_split:
|
|
74
72
|
# 尝试使用逗号或分号分隔符解析
|
|
75
|
-
|
|
73
|
+
sep = None
|
|
74
|
+
if ',' in trimmed:
|
|
75
|
+
sep = ','
|
|
76
|
+
elif ';' in trimmed:
|
|
77
|
+
sep = ';'
|
|
78
|
+
if sep:
|
|
79
|
+
return [item.strip() for item in trimmed.split(sep) if item.strip()]
|
|
76
80
|
return value
|
|
77
81
|
|
|
78
82
|
|
|
@@ -239,7 +243,7 @@ def __load_config(config_path):
|
|
|
239
243
|
elif "log.level" in __config:
|
|
240
244
|
__config["log.level"] = log_level(__config["log.level"])
|
|
241
245
|
except Exception as e:
|
|
242
|
-
|
|
246
|
+
critical("Failed to load config file `%s`: %s", config_path, e)
|
|
243
247
|
raise
|
|
244
248
|
# 重新抛出异常
|
|
245
249
|
|
|
@@ -306,8 +310,8 @@ def generate_config(config_path):
|
|
|
306
310
|
dumpjson(configure, f, indent=2, sort_keys=True)
|
|
307
311
|
return True
|
|
308
312
|
except IOError:
|
|
309
|
-
|
|
313
|
+
critical("Cannot open config file to write: `%s`!", config_path)
|
|
310
314
|
return False
|
|
311
315
|
except Exception as e:
|
|
312
|
-
|
|
316
|
+
critical("Failed to write config file `%s`: %s", config_path, e)
|
|
313
317
|
return False
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ddns
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.2
|
|
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
|
|
@@ -55,7 +55,7 @@ Dynamic: license-file
|
|
|
55
55
|
## Features
|
|
56
56
|
|
|
57
57
|
- 兼容和跨平台:
|
|
58
|
-
- [Docker (@NN708)](https://hub.docker.com/r/newfuture/ddns) [](https://hub.docker.com/r/newfuture/ddns)[](https://hub.docker.com/r/newfuture/ddns) [](https://hub.docker.com/r/newfuture/ddns)[](https://hub.docker.com/r/newfuture/ddns)
|
|
59
59
|
- [二进制文件](https://github.com/NewFuture/DDNS/releases/latest) 
|
|
60
60
|
|
|
61
61
|
- 配置方式:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|