v4.0.json 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "https://ddns.newfuture.cc/schema/v4.0.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.0.json",
  10. "description": "请更换为 https://ddns.newfuture.cc/schema/v4.0.json",
  11. "default": "https://ddns.newfuture.cc/schema/v4.0.json",
  12. "enum": [
  13. "https://ddns.newfuture.cc/schema/v4.0.json",
  14. "http://ddns.newfuture.cc/schema/v4.0.json",
  15. "./schema/v4.0.json"
  16. ]
  17. },
  18. "id": {
  19. "$id": "/properties/id",
  20. "type": [
  21. "string",
  22. "null"
  23. ],
  24. "title": "ID or Email",
  25. "description": "DNS服务API认证的ID或者邮箱"
  26. },
  27. "token": {
  28. "$id": "/properties/token",
  29. "type": "string",
  30. "title": "API Token",
  31. "description": "DNS服务商的访问Token或者Key"
  32. },
  33. "endpoint": {
  34. "$id": "/properties/endpoint",
  35. "type": [
  36. "string",
  37. "null"
  38. ],
  39. "title": "API Endpoint",
  40. "description": "DNS服务商的API端点URL,用于自定义或私有部署的API地址",
  41. "default": null,
  42. "examples": [
  43. "https://dnsapi.com",
  44. null
  45. ]
  46. },
  47. "dns": {
  48. "$id": "/properties/dns",
  49. "type": "string",
  50. "title": "DNS Provider",
  51. "description": "dns服务商:阿里为alidns,阿里ESA为aliesa,DNS.COM为dnscom,DNSPOD国际版为(dnspod_com),cloudflare,HE.net为he,华为DNS为huaweidns,NameSilo为namesilo,腾讯云为tencentcloud,腾讯云EdgeOne为edgeone,自定义回调为callback",
  52. "default": "dnspod",
  53. "examples": [
  54. "dnspod",
  55. "alidns",
  56. "cloudflare"
  57. ],
  58. "enum": [
  59. "alidns",
  60. "aliesa",
  61. "callback",
  62. "cloudflare",
  63. "debug",
  64. "dnscom",
  65. "dnspod_com",
  66. "dnspod",
  67. "edgeone",
  68. "he",
  69. "huaweidns",
  70. "namesilo",
  71. "noip",
  72. "tencentcloud"
  73. ]
  74. },
  75. "ipv4": {
  76. "$id": "/properties/ipv4",
  77. "title": "IPv4 domain list",
  78. "description": "待更新的IPv4 域名列表",
  79. "type": "array",
  80. "uniqueItems": true,
  81. "items": {
  82. "$id": "/properties/ipv4/items",
  83. "title": "ipv4 domain for DDNS",
  84. "type": "string",
  85. "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$",
  86. "examples": [
  87. "newfuture.cc",
  88. "ipv4.example.newfuture.cc"
  89. ]
  90. }
  91. },
  92. "ipv6": {
  93. "$id": "/properties/ipv6",
  94. "type": "array",
  95. "title": "IPv6 domain list",
  96. "description": "待更新的IPv6 域名列表",
  97. "uniqueItems": true,
  98. "items": {
  99. "$id": "/properties/ipv6/items",
  100. "title": "The ipv6 domain for DDNS",
  101. "type": "string",
  102. "pattern": "^(?:\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}$",
  103. "examples": [
  104. "newfuture.cc",
  105. "ipv6.example.newfuture.cc"
  106. ]
  107. }
  108. },
  109. "index4": {
  110. "$id": "/properties/index4",
  111. "type": [
  112. "string",
  113. "integer",
  114. "boolean",
  115. "array"
  116. ],
  117. "items": {
  118. "type": [
  119. "string",
  120. "integer"
  121. ],
  122. "minimum": 0
  123. },
  124. "uniqueItems": true,
  125. "minItems": 1,
  126. "minimum": 0,
  127. "title": "IPv4 address Setting",
  128. "description": "本机 IPv4 获取方式设置,支持数组、字符串(逗号/分号分隔)等多种格式",
  129. "default": [
  130. "default"
  131. ],
  132. "examples": [
  133. "default",
  134. "public",
  135. 0,
  136. "192\\\\.168\\\\..*",
  137. "public,regex:192\\\\.168\\\\..*",
  138. [
  139. "public",
  140. "default"
  141. ],
  142. false
  143. ]
  144. },
  145. "index6": {
  146. "$id": "/properties/index6",
  147. "type": [
  148. "string",
  149. "integer",
  150. "boolean",
  151. "array"
  152. ],
  153. "items": {
  154. "type": [
  155. "string",
  156. "integer"
  157. ],
  158. "minimum": 0
  159. },
  160. "uniqueItems": true,
  161. "minItems": 1,
  162. "minimum": 0,
  163. "title": "IPv6 address Setting",
  164. "description": "本机 IPv6 获取方式设置,支持数组、字符串(逗号/分号分隔)等多种格式",
  165. "default": [
  166. "default"
  167. ],
  168. "examples": [
  169. "default",
  170. "public",
  171. 0,
  172. 1,
  173. "2404:f801:10:.*",
  174. "public;regex:2404:f801:.*",
  175. [
  176. "public",
  177. "default"
  178. ],
  179. false
  180. ]
  181. },
  182. "ttl": {
  183. "$id": "/properties/ttl",
  184. "type": [
  185. "number",
  186. "null"
  187. ],
  188. "title": "TTL",
  189. "description": "设置DNS TTL,默认不填读取DNS服务商的配置",
  190. "default": null,
  191. "examples": [
  192. 600,
  193. null
  194. ]
  195. },
  196. "line": {
  197. "$id": "/properties/line",
  198. "type": [
  199. "string",
  200. "null"
  201. ],
  202. "title": "DNS Line/Route",
  203. "description": "DNS线路设置,如电信、联通、移动等,支持中文和英文线路名称",
  204. "default": null,
  205. "examples": [
  206. "telecom",
  207. "电信",
  208. "default",
  209. "默认"
  210. ]
  211. },
  212. "proxy": {
  213. "$id": "/properties/proxy",
  214. "type": [
  215. "string",
  216. "null",
  217. "array"
  218. ],
  219. "title": "HTTP Proxy Setting",
  220. "description": "DIRECT表示直连,多个代理分号(;)分割逐个尝试直到成功",
  221. "pattern": "^[a-zA-Z0-9\\-;_:\\.]*$",
  222. "examples": [
  223. "127.0.0.1:1080;DIRECT"
  224. ],
  225. "uniqueItems": true,
  226. "items": {
  227. "$id": "/properties/ipv4/items",
  228. "title": "ipv4 domain for DDNS",
  229. "type": "string",
  230. "pattern": "^[a-zA-Z0-9\\-_:\\.]*$",
  231. "examples": [
  232. "127.0.0.1:1080"
  233. ]
  234. }
  235. },
  236. "cache": {
  237. "$id": "/properties/cache",
  238. "type": [
  239. "string",
  240. "boolean"
  241. ],
  242. "title": "Enable Cache",
  243. "description": "是否启用缓存记录以避免频繁更新",
  244. "default": true,
  245. "examples": [
  246. true,
  247. false,
  248. "/path/to/cache/ddns.cache"
  249. ]
  250. },
  251. "ssl": {
  252. "$id": "/properties/ssl",
  253. "type": [
  254. "string",
  255. "boolean"
  256. ],
  257. "title": "SSL/TLS Setting",
  258. "description": "SSL/TLS连接设置,auto表示自动检测,true强制使用SSL,false禁用SSL",
  259. "default": "auto",
  260. "examples": [
  261. "auto",
  262. true,
  263. false
  264. ]
  265. },
  266. "log": {
  267. "$id": "/properties/log",
  268. "type": "object",
  269. "title": "Log Config",
  270. "description": "日志配置,支持自定义日志级别、输出位置、格式和日期格式。可通过命令行 --log.level, --log.file, --log.format, --log.datefmt 或环境变量 DDNS_LOG_LEVEL, DDNS_LOG_FILE, DDNS_LOG_FORMAT, DDNS_LOG_DATEFMT 设置。",
  271. "properties": {
  272. "level": {
  273. "type": "string",
  274. "title": "Log Level",
  275. "description": "日志级别,如 DEBUG、INFO、WARNING、ERROR、CRITICAL",
  276. "default": "INFO",
  277. "enum": [
  278. "DEBUG",
  279. "INFO",
  280. "WARNING",
  281. "ERROR",
  282. "CRITICAL"
  283. ]
  284. },
  285. "file": {
  286. "type": [
  287. "string",
  288. "null"
  289. ],
  290. "title": "Log Output File",
  291. "description": "日志输出文件路径,留空或为null时输出到控制台"
  292. },
  293. "format": {
  294. "type": [
  295. "string",
  296. "null"
  297. ],
  298. "title": "Log Format",
  299. "description": "日志格式,参考Python logging模块的格式字符串",
  300. "default": "%(asctime)s %(levelname)s [%(module)s]: %(message)s"
  301. },
  302. "datefmt": {
  303. "type": [
  304. "string",
  305. "null"
  306. ],
  307. "title": "Date Format",
  308. "description": "日期时间格式,参考Python time.strftime()的格式字符串",
  309. "default": "%Y-%m-%dT%H:%M:%S"
  310. }
  311. },
  312. "required": [],
  313. "additionalProperties": false
  314. }
  315. },
  316. "required": [
  317. "token"
  318. ],
  319. "additionalProperties": false
  320. }