v4.1.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "https://ddns.newfuture.cc/schema/v4.1.json",
  4. "description": "DNS 配置文件 https://github.com/NewFuture/DDNS",
  5. "type": "object",
  6. "properties": {
  7. "$schema": {
  8. "type": "string",
  9. "title": "please use https://ddns.newfuture.cc/schema/v4.1.json",
  10. "description": "请更换为 https://ddns.newfuture.cc/schema/v4.1.json",
  11. "default": "https://ddns.newfuture.cc/schema/v4.1.json",
  12. "enum": [
  13. "https://ddns.newfuture.cc/schema/v4.1.json",
  14. "http://ddns.newfuture.cc/schema/v4.1.json",
  15. "./schema/v4.1.json"
  16. ]
  17. },
  18. "providers": {
  19. "$id": "/properties/providers",
  20. "type": "array",
  21. "title": "DNS Providers List",
  22. "description": "DNS服务提供商列表,支持多个不同的DNS服务商",
  23. "items": {
  24. "type": "object",
  25. "properties": {
  26. "provider": {
  27. "type": "string",
  28. "title": "DNS Provider Name",
  29. "description": "dns服务商:阿里为alidns,阿里ESA为aliesa,DNS.COM为dnscom,DNSPOD国际版为(dnspod_com),cloudflare,HE.net为he,华为DNS为huaweidns,NameSilo为namesilo,腾讯云为tencentcloud,腾讯云EdgeOne为edgeone,腾讯云EdgeOne DNS为edgeone_dns,自定义回调为callback",
  30. "enum": [
  31. "51dns",
  32. "alidns",
  33. "aliesa",
  34. "callback",
  35. "cloudflare",
  36. "debug",
  37. "dnscom",
  38. "dnspod_com",
  39. "dnspod",
  40. "edgeone",
  41. "edgeone_dns",
  42. "he",
  43. "huaweidns",
  44. "namesilo",
  45. "noip",
  46. "tencentcloud"
  47. ]
  48. },
  49. "id": {
  50. "type": [
  51. "string",
  52. "null"
  53. ],
  54. "title": "ID or Email",
  55. "description": "DNS服务API认证的ID或者邮箱"
  56. },
  57. "token": {
  58. "type": "string",
  59. "title": "API Token",
  60. "description": "DNS服务商的访问Token或者Key"
  61. },
  62. "endpoint": {
  63. "type": [
  64. "string",
  65. "null"
  66. ],
  67. "title": "API Endpoint",
  68. "description": "DNS服务商的API端点URL,用于自定义或私有部署的API地址",
  69. "default": null
  70. },
  71. "ipv4": {
  72. "title": "IPv4 domain list",
  73. "description": "待更新的IPv4 域名列表",
  74. "type": "array",
  75. "uniqueItems": true,
  76. "items": {
  77. "title": "ipv4 domain for DDNS",
  78. "type": "string",
  79. "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$"
  80. }
  81. },
  82. "ipv6": {
  83. "type": "array",
  84. "title": "IPv6 domain list",
  85. "description": "待更新的IPv6 域名列表",
  86. "uniqueItems": true,
  87. "items": {
  88. "title": "The ipv6 domain for DDNS",
  89. "type": "string",
  90. "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$"
  91. }
  92. },
  93. "index4": {
  94. "type": [
  95. "string",
  96. "integer",
  97. "boolean",
  98. "array"
  99. ],
  100. "items": {
  101. "type": [
  102. "string",
  103. "integer"
  104. ],
  105. "minimum": 0
  106. },
  107. "uniqueItems": true,
  108. "minItems": 1,
  109. "minimum": 0,
  110. "title": "IPv4 address Setting",
  111. "description": "本机 IPv4 获取方式设置,支持数组、字符串(逗号/分号分隔)等多种格式",
  112. "default": [
  113. "default"
  114. ]
  115. },
  116. "index6": {
  117. "type": [
  118. "string",
  119. "integer",
  120. "boolean",
  121. "array"
  122. ],
  123. "items": {
  124. "type": [
  125. "string",
  126. "integer"
  127. ],
  128. "minimum": 0
  129. },
  130. "uniqueItems": true,
  131. "minItems": 1,
  132. "minimum": 0,
  133. "title": "IPv6 address Setting",
  134. "description": "本机 IPv6 获取方式设置,支持数组、字符串(逗号/分号分隔)等多种格式",
  135. "default": [
  136. "default"
  137. ]
  138. },
  139. "ttl": {
  140. "type": [
  141. "number",
  142. "null"
  143. ],
  144. "title": "TTL",
  145. "description": "设置DNS TTL,默认不填读取DNS服务商的配置",
  146. "default": null
  147. },
  148. "line": {
  149. "type": [
  150. "string",
  151. "null"
  152. ],
  153. "title": "DNS Line/Route",
  154. "description": "DNS线路设置,如电信、联通、移动等,支持中文和英文线路名称",
  155. "default": null
  156. },
  157. "cache": {
  158. "type": [
  159. "string",
  160. "boolean"
  161. ],
  162. "title": "Enable Cache",
  163. "description": "是否启用缓存记录以避免频繁更新",
  164. "default": true,
  165. "examples": [
  166. true,
  167. false,
  168. "/path/to/cache/ddns.cache"
  169. ]
  170. },
  171. "log": {
  172. "type": "object",
  173. "title": "Log Config",
  174. "description": "日志配置,仅支持设置日志级别",
  175. "properties": {
  176. "level": {
  177. "type": "string",
  178. "title": "Log Level",
  179. "description": "日志级别,如 DEBUG、INFO、WARNING、ERROR、CRITICAL",
  180. "default": "INFO",
  181. "enum": [
  182. "DEBUG",
  183. "INFO",
  184. "WARNING",
  185. "ERROR",
  186. "CRITICAL"
  187. ]
  188. }
  189. },
  190. "required": [],
  191. "additionalProperties": false
  192. },
  193. "proxy": {
  194. "type": [
  195. "string",
  196. "null",
  197. "array"
  198. ],
  199. "title": "HTTP Proxy Setting",
  200. "description": "该Provider专用的HTTP代理设置,支持多种格式:http://host:port(具体代理)、DIRECT(强制直连)、SYSTEM/DEFAULT(系统代理),多个代理逐个尝试直到成功",
  201. "pattern": "^(https?://[a-zA-Z0-9\\-_:\\.]+|[a-zA-Z0-9\\-_:\\.]+:[0-9]+|DIRECT|SYSTEM|DEFAULT)(;(https?://[a-zA-Z0-9\\-_:\\.]+|[a-zA-Z0-9\\-_:\\.]+:[0-9]+|DIRECT|SYSTEM|DEFAULT))*$",
  202. "examples": [
  203. "http://127.0.0.1:1080",
  204. "http://proxy.example.com:8080",
  205. "DIRECT",
  206. "SYSTEM",
  207. "DEFAULT"
  208. ],
  209. "uniqueItems": true,
  210. "items": {
  211. "title": "proxy setting for HTTP requests",
  212. "type": "string",
  213. "pattern": "^(https?://[a-zA-Z0-9\\-_:\\.]+|[a-zA-Z0-9\\-_:\\.]+:[0-9]+|DIRECT|SYSTEM|DEFAULT)$",
  214. "examples": [
  215. "http://127.0.0.1:1080",
  216. "https://proxy.example.com:8080",
  217. "DIRECT",
  218. "SYSTEM",
  219. "DEFAULT"
  220. ]
  221. }
  222. },
  223. "extra": {
  224. "type": "object",
  225. "title": "Extra Fields",
  226. "description": "额外的自定义字段,用于传递DNS服务商特定的参数,如Cloudflare的proxied、comment、tags等",
  227. "additionalProperties": true,
  228. "examples": [
  229. {
  230. "proxied": true,
  231. "comment": "Managed by DDNS"
  232. }
  233. ]
  234. }
  235. },
  236. "required": [
  237. "provider"
  238. ],
  239. "additionalProperties": true
  240. }
  241. },
  242. "id": {
  243. "$id": "/properties/id",
  244. "type": [
  245. "string",
  246. "null"
  247. ],
  248. "title": "ID or Email",
  249. "description": "DNS服务API认证的ID或者邮箱"
  250. },
  251. "token": {
  252. "$id": "/properties/token",
  253. "type": "string",
  254. "title": "API Token",
  255. "description": "DNS服务商的访问Token或者Key"
  256. },
  257. "endpoint": {
  258. "$id": "/properties/endpoint",
  259. "type": [
  260. "string",
  261. "null"
  262. ],
  263. "title": "API Endpoint",
  264. "description": "DNS服务商的API端点URL,用于自定义或私有部署的API地址",
  265. "default": null,
  266. "examples": [
  267. "https://dnsapi.com",
  268. null
  269. ]
  270. },
  271. "dns": {
  272. "$id": "/properties/dns",
  273. "type": "string",
  274. "title": "DNS Provider",
  275. "description": "dns服务商:阿里为alidns,阿里ESA为aliesa,DNS.COM为dnscom,DNSPOD国际版为(dnspod_com),cloudflare,HE.net为he,华为DNS为huaweidns,NameSilo为namesilo,腾讯云为tencentcloud,腾讯云EdgeOne为edgeone,腾讯云EdgeOne DNS为edgeone_dns,自定义回调为callback",
  276. "default": "dnspod",
  277. "examples": [
  278. "dnspod",
  279. "alidns",
  280. "cloudflare"
  281. ],
  282. "enum": [
  283. "51dns",
  284. "alidns",
  285. "aliesa",
  286. "callback",
  287. "cloudflare",
  288. "debug",
  289. "dnscom",
  290. "dnspod_com",
  291. "dnspod",
  292. "edgeone",
  293. "edgeone_dns",
  294. "he",
  295. "huaweidns",
  296. "namesilo",
  297. "noip",
  298. "tencentcloud"
  299. ]
  300. },
  301. "ipv4": {
  302. "$id": "/properties/ipv4",
  303. "title": "IPv4 domain list",
  304. "description": "待更新的IPv4 域名列表",
  305. "type": "array",
  306. "uniqueItems": true,
  307. "items": {
  308. "$id": "/properties/ipv4/items",
  309. "title": "ipv4 domain for DDNS",
  310. "type": "string",
  311. "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$",
  312. "examples": [
  313. "newfuture.cc",
  314. "ipv4.example.newfuture.cc"
  315. ]
  316. }
  317. },
  318. "ipv6": {
  319. "$id": "/properties/ipv6",
  320. "type": "array",
  321. "title": "IPv6 domain list",
  322. "description": "待更新的IPv6 域名列表",
  323. "uniqueItems": true,
  324. "items": {
  325. "$id": "/properties/ipv6/items",
  326. "title": "The ipv6 domain for DDNS",
  327. "type": "string",
  328. "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$",
  329. "examples": [
  330. "newfuture.cc",
  331. "ipv6.example.newfuture.cc"
  332. ]
  333. }
  334. },
  335. "index4": {
  336. "$id": "/properties/index4",
  337. "type": [
  338. "string",
  339. "integer",
  340. "boolean",
  341. "array"
  342. ],
  343. "items": {
  344. "type": [
  345. "string",
  346. "integer"
  347. ],
  348. "minimum": 0
  349. },
  350. "uniqueItems": true,
  351. "minItems": 1,
  352. "minimum": 0,
  353. "title": "IPv4 address Setting",
  354. "description": "本机 IPv4 获取方式设置,支持数组、字符串(逗号/分号分隔)等多种格式",
  355. "default": [
  356. "default"
  357. ],
  358. "examples": [
  359. "default",
  360. "public",
  361. 0,
  362. "192\\\\.168\\\\..*",
  363. "public,regex:192\\\\.168\\\\..*",
  364. [
  365. "public",
  366. "default"
  367. ],
  368. false
  369. ]
  370. },
  371. "index6": {
  372. "$id": "/properties/index6",
  373. "type": [
  374. "string",
  375. "integer",
  376. "boolean",
  377. "array"
  378. ],
  379. "items": {
  380. "type": [
  381. "string",
  382. "integer"
  383. ],
  384. "minimum": 0
  385. },
  386. "uniqueItems": true,
  387. "minItems": 1,
  388. "minimum": 0,
  389. "title": "IPv6 address Setting",
  390. "description": "本机 IPv6 获取方式设置,支持数组、字符串(逗号/分号分隔)等多种格式",
  391. "default": [
  392. "default"
  393. ],
  394. "examples": [
  395. "default",
  396. "public",
  397. 0,
  398. 1,
  399. "2404:f801:10:.*",
  400. "public;regex:2404:f801:.*",
  401. [
  402. "public",
  403. "default"
  404. ],
  405. false
  406. ]
  407. },
  408. "ttl": {
  409. "$id": "/properties/ttl",
  410. "type": [
  411. "number",
  412. "null"
  413. ],
  414. "title": "TTL",
  415. "description": "设置DNS TTL,默认不填读取DNS服务商的配置",
  416. "default": null,
  417. "examples": [
  418. 600,
  419. null
  420. ]
  421. },
  422. "line": {
  423. "$id": "/properties/line",
  424. "type": [
  425. "string",
  426. "null"
  427. ],
  428. "title": "DNS Line/Route",
  429. "description": "DNS线路设置,如电信、联通、移动等,支持中文和英文线路名称",
  430. "default": null,
  431. "examples": [
  432. "telecom",
  433. "电信",
  434. "default",
  435. "默认"
  436. ]
  437. },
  438. "proxy": {
  439. "$id": "/properties/proxy",
  440. "type": [
  441. "string",
  442. "null",
  443. "array"
  444. ],
  445. "title": "HTTP Proxy Setting",
  446. "description": "HTTP代理设置,支持多种格式:http://host:port(具体代理)、DIRECT(强制直连)、SYSTEM/DEFAULT(系统代理),多个代理逐个尝试直到成功",
  447. "pattern": "^(https?://[a-zA-Z0-9\\-_:\\.]+|[a-zA-Z0-9\\-_:\\.]+:[0-9]+|DIRECT|SYSTEM|DEFAULT)(;(https?://[a-zA-Z0-9\\-_:\\.]+|[a-zA-Z0-9\\-_:\\.]+:[0-9]+|DIRECT|SYSTEM|DEFAULT))*$",
  448. "examples": [
  449. "http://127.0.0.1:1080",
  450. "http://proxy.example.com:8080",
  451. "DIRECT",
  452. "SYSTEM",
  453. "DEFAULT",
  454. "http://127.0.0.1:1080;DIRECT"
  455. ],
  456. "uniqueItems": true,
  457. "items": {
  458. "$id": "/properties/proxy/items",
  459. "title": "proxy setting for HTTP requests",
  460. "type": "string",
  461. "pattern": "^(https?://[a-zA-Z0-9\\-_:\\.]+|[a-zA-Z0-9\\-_:\\.]+:[0-9]+|DIRECT|SYSTEM|DEFAULT)$",
  462. "examples": [
  463. "http://127.0.0.1:1080",
  464. "https://proxy.example.com:8080",
  465. "DIRECT",
  466. "SYSTEM",
  467. "DEFAULT"
  468. ]
  469. }
  470. },
  471. "cache": {
  472. "$id": "/properties/cache",
  473. "type": [
  474. "string",
  475. "boolean"
  476. ],
  477. "title": "Enable Cache",
  478. "description": "是否启用缓存记录以避免频繁更新",
  479. "default": true,
  480. "examples": [
  481. true,
  482. false,
  483. "/path/to/cache/ddns.cache"
  484. ]
  485. },
  486. "ssl": {
  487. "$id": "/properties/ssl",
  488. "type": [
  489. "string",
  490. "boolean"
  491. ],
  492. "title": "SSL/TLS Setting",
  493. "description": "SSL/TLS连接设置,auto表示自动检测,true强制使用SSL,false禁用SSL",
  494. "default": "auto",
  495. "examples": [
  496. "auto",
  497. true,
  498. false
  499. ]
  500. },
  501. "log": {
  502. "$id": "/properties/log",
  503. "type": "object",
  504. "title": "Log Config",
  505. "description": "日志配置,支持自定义日志级别、输出位置、格式和日期格式。可通过命令行 --log.level, --log.file, --log.format, --log.datefmt 或环境变量 DDNS_LOG_LEVEL, DDNS_LOG_FILE, DDNS_LOG_FORMAT, DDNS_LOG_DATEFMT 设置。",
  506. "properties": {
  507. "level": {
  508. "type": "string",
  509. "title": "Log Level",
  510. "description": "日志级别,如 DEBUG、INFO、WARNING、ERROR、CRITICAL",
  511. "default": "INFO",
  512. "enum": [
  513. "DEBUG",
  514. "INFO",
  515. "WARNING",
  516. "ERROR",
  517. "CRITICAL"
  518. ]
  519. },
  520. "file": {
  521. "type": [
  522. "string",
  523. "null"
  524. ],
  525. "title": "Log Output File",
  526. "description": "日志输出文件路径,留空或为null时输出到控制台"
  527. },
  528. "format": {
  529. "type": [
  530. "string",
  531. "null"
  532. ],
  533. "title": "Log Format",
  534. "description": "日志格式,参考Python logging模块的格式字符串",
  535. "default": "%(asctime)s %(levelname)s [%(module)s]: %(message)s"
  536. },
  537. "datefmt": {
  538. "type": [
  539. "string",
  540. "null"
  541. ],
  542. "title": "Date Format",
  543. "description": "日期时间格式,参考Python time.strftime()的格式字符串",
  544. "default": "%Y-%m-%dT%H:%M:%S"
  545. }
  546. },
  547. "required": [],
  548. "additionalProperties": false
  549. },
  550. "extra": {
  551. "$id": "/properties/extra",
  552. "type": "object",
  553. "title": "Extra Fields",
  554. "description": "额外的自定义字段,用于传递DNS服务商特定的参数,如Cloudflare的proxied、comment、tags等",
  555. "additionalProperties": true,
  556. "examples": [
  557. {
  558. "proxied": true,
  559. "comment": "Managed by DDNS",
  560. "tags": ["production", "ddns"]
  561. }
  562. ]
  563. }
  564. },
  565. "not": {
  566. "allOf": [
  567. {
  568. "required": [
  569. "providers"
  570. ]
  571. },
  572. {
  573. "anyOf": [
  574. {
  575. "required": [
  576. "dns"
  577. ]
  578. },
  579. {
  580. "required": [
  581. "id"
  582. ]
  583. },
  584. {
  585. "required": [
  586. "token"
  587. ]
  588. },
  589. {
  590. "required": [
  591. "ipv4"
  592. ]
  593. },
  594. {
  595. "required": [
  596. "ipv6"
  597. ]
  598. },
  599. {
  600. "required": [
  601. "endpoint"
  602. ]
  603. }
  604. ]
  605. }
  606. ]
  607. },
  608. "anyOf": [
  609. {
  610. "required": [
  611. "token"
  612. ]
  613. },
  614. {
  615. "required": [
  616. "providers"
  617. ]
  618. }
  619. ],
  620. "additionalProperties": true
  621. }