mirror of
https://github.com/partofmyid/register.git
synced 2026-06-05 10:36:50 +07:00
organize and add count
This commit is contained in:
parent
e7d87ee257
commit
2b6f3e630a
6 changed files with 6 additions and 7 deletions
12
scripts/dbgen.js
Normal file
12
scripts/dbgen.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const fs = require('fs');
|
||||
|
||||
console.log(
|
||||
JSON.stringify(
|
||||
fs.readdirSync('./domains').map(f =>
|
||||
[
|
||||
f.split('.').slice(0, -1).join('.'), // subdomain
|
||||
JSON.parse(fs.readFileSync(`./domains/${f}`, 'utf8')).owner.username // owner
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
72
scripts/schema.json
Normal file
72
scripts/schema.json
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"owner": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["username"],
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"record": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ALIAS": {
|
||||
"type": "string"
|
||||
},
|
||||
"A": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "ipv4"
|
||||
}
|
||||
},
|
||||
"AAAA": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "ipv6"
|
||||
}
|
||||
},
|
||||
"CNAME": {
|
||||
"type": "string"
|
||||
},
|
||||
"MX": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"TXT": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [],
|
||||
"anyOf": [
|
||||
{ "required": ["ALIAS"] },
|
||||
{ "required": ["A"] },
|
||||
{ "required": ["AAAA"] },
|
||||
{ "required": ["CNAME"] },
|
||||
{ "required": ["MX"] },
|
||||
{ "required": ["TXT"] },
|
||||
{ "required": ["SRV"] }
|
||||
]
|
||||
},
|
||||
"proxied": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["owner", "record"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue