|
1 | 1 | { |
2 | 2 | "$schema": "http://json-schema.org/draft-07/schema", |
3 | | - "$id": "https://ddns.newfuture.cc/schema.json", |
4 | | - "description": "[Deprecated] 已弃用,请使用 https://ddns.newfuture.cc/schema/v2.json", |
| 3 | + "$id": "https://ddns.newfuture.cc/schema/v4.0.json", |
| 4 | + "description": "DNS 配置文件 https://github.com/NewFuture/DDNS", |
5 | 5 | "type": "object", |
6 | 6 | "properties": { |
7 | 7 | "$schema": { |
8 | 8 | "type": "string", |
9 | | - "title": "please use https://ddns.newfuture.cc/schema/v2.json", |
10 | | - "description": "请更换为 https://ddns.newfuture.cc/schema/v2.json", |
| 9 | + "title": "please use https://ddns.newfuture.cc/schema/v2.8.json", |
| 10 | + "description": "请更换为 https://ddns.newfuture.cc/schema/v2.8.json", |
| 11 | + "default": "https://ddns.newfuture.cc/schema/v2.8.json", |
11 | 12 | "enum": [ |
12 | | - "https://ddns.newfuture.cc/schema/v2.json", |
13 | | - "http://ddns.newfuture.cc/schema/v2.json" |
| 13 | + "https://ddns.newfuture.cc/schema/v2.8.json", |
| 14 | + "http://ddns.newfuture.cc/schema/v2.8.json", |
| 15 | + "./schema/v2.8.json" |
14 | 16 | ] |
15 | 17 | }, |
16 | 18 | "id": { |
17 | 19 | "$id": "/properties/id", |
18 | | - "type": "string", |
| 20 | + "type": [ |
| 21 | + "string", |
| 22 | + "null" |
| 23 | + ], |
19 | 24 | "title": "ID or Email", |
20 | 25 | "description": "DNS服务API认证的ID或者邮箱" |
21 | 26 | }, |
|
29 | 34 | "$id": "/properties/dns", |
30 | 35 | "type": "string", |
31 | 36 | "title": "DNS Provider", |
32 | | - "description": "dns服务商:阿里为alidns,DNS.COM为dnscom,DNSPOD国际版为(dnspod_com),cloudflare,HE.net为he", |
| 37 | + "description": "dns服务商:阿里为alidns,DNS.COM为dnscom,DNSPOD国际版为(dnspod_com),cloudflare,HE.net为he,华为DNS为huaweidns,自定义回调为callback", |
33 | 38 | "default": "dnspod", |
34 | 39 | "examples": [ |
35 | 40 | "dnspod", |
|
42 | 47 | "cloudflare", |
43 | 48 | "dnspod_com", |
44 | 49 | "dnscom", |
45 | | - "he" |
| 50 | + "he", |
| 51 | + "huaweidns", |
| 52 | + "callback" |
46 | 53 | ] |
47 | 54 | }, |
48 | 55 | "ipv4": { |
|
55 | 62 | "$id": "/properties/ipv4/items", |
56 | 63 | "title": "ipv4 domain for DDNS", |
57 | 64 | "type": "string", |
58 | | - "pattern": "^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$", |
| 65 | + "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$", |
59 | 66 | "examples": [ |
60 | 67 | "newfuture.cc", |
61 | 68 | "ipv4.example.newfuture.cc" |
|
72 | 79 | "$id": "/properties/ipv6/items", |
73 | 80 | "title": "The ipv6 domain for DDNS", |
74 | 81 | "type": "string", |
75 | | - "pattern": "^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$", |
| 82 | + "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$", |
76 | 83 | "examples": [ |
77 | 84 | "newfuture.cc", |
78 | 85 | "ipv6.example.newfuture.cc" |
|
84 | 91 | "type": [ |
85 | 92 | "string", |
86 | 93 | "integer", |
87 | | - "boolean" |
| 94 | + "boolean", |
| 95 | + "array" |
88 | 96 | ], |
| 97 | + "items": { |
| 98 | + "type": [ |
| 99 | + "string", |
| 100 | + "integer" |
| 101 | + ], |
| 102 | + "minimum": 0 |
| 103 | + }, |
| 104 | + "uniqueItems": true, |
| 105 | + "minItems": 1, |
| 106 | + "minimum": 0, |
89 | 107 | "title": "IPv4 address Setting", |
90 | 108 | "description": "本机 IPv4 获取方式设置", |
91 | 109 | "default": "default", |
|
103 | 121 | "type": [ |
104 | 122 | "string", |
105 | 123 | "integer", |
106 | | - "boolean" |
| 124 | + "boolean", |
| 125 | + "array" |
107 | 126 | ], |
| 127 | + "items": { |
| 128 | + "type": [ |
| 129 | + "string", |
| 130 | + "integer" |
| 131 | + ], |
| 132 | + "minimum": 0 |
| 133 | + }, |
| 134 | + "uniqueItems": true, |
| 135 | + "minItems": 1, |
| 136 | + "minimum": 0, |
108 | 137 | "title": "IPv6 address Setting", |
109 | 138 | "description": "本机 IPv6 获取方式设置", |
110 | 139 | "default": "default", |
|
144 | 173 | "127.0.0.1:1080;DIRECT" |
145 | 174 | ] |
146 | 175 | }, |
147 | | - "debug": { |
148 | | - "$id": "/properties/debug", |
149 | | - "type": "boolean", |
150 | | - "title": "Enable Debug Mode", |
151 | | - "description": "是否启用调试模式显示更多信息", |
152 | | - "default": false, |
| 176 | + "cache": { |
| 177 | + "$id": "/properties/cache", |
| 178 | + "type": [ |
| 179 | + "string", |
| 180 | + "boolean" |
| 181 | + ], |
| 182 | + "title": "Enable Cache", |
| 183 | + "description": "是否启用缓存记录以避免频繁更新", |
| 184 | + "default": true, |
153 | 185 | "examples": [ |
| 186 | + true, |
154 | 187 | false, |
155 | | - true |
| 188 | + "/path/to/cache/ddns.cache" |
156 | 189 | ] |
| 190 | + }, |
| 191 | + "log": { |
| 192 | + "$id": "/properties/log", |
| 193 | + "type": "object", |
| 194 | + "title": "Log Config", |
| 195 | + "description": "日志配置,支持自定义日志级别和输出位置。可通过命令行 --log.level, --log.file 或环境变量 DDNS_LOG_LEVEL, DDNS_LOG_FILE 设置。", |
| 196 | + "properties": { |
| 197 | + "level": { |
| 198 | + "type": "string", |
| 199 | + "title": "Log Level", |
| 200 | + "description": "日志级别,如 DEBUG、INFO、WARNING、ERROR、CRITICAL", |
| 201 | + "default": "INFO", |
| 202 | + "enum": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] |
| 203 | + }, |
| 204 | + "file": { |
| 205 | + "type": ["string", "null"], |
| 206 | + "title": "Log Output File", |
| 207 | + "description": "日志输出文件路径,留空或为null时输出到控制台" |
| 208 | + } |
| 209 | + }, |
| 210 | + "required": [], |
| 211 | + "additionalProperties": false |
157 | 212 | } |
158 | 213 | }, |
159 | 214 | "required": [ |
|
0 commit comments