mirror of
https://github.com/partofmyid/register.git
synced 2026-06-05 10:36:50 +07:00
update script
This commit is contained in:
parent
8de5a77005
commit
2934db27ec
10 changed files with 26 additions and 44 deletions
14
.github/workflows/check.yml
vendored
14
.github/workflows/check.yml
vendored
|
|
@ -1,14 +0,0 @@
|
||||||
name: Check
|
|
||||||
|
|
||||||
on: pull_request
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: DNSControl check
|
|
||||||
uses: koenrh/dnscontrol-action@v3
|
|
||||||
with:
|
|
||||||
args: check
|
|
||||||
config_file: 'dnsconfig.js'
|
|
||||||
15
.github/workflows/db.yml
vendored
15
.github/workflows/db.yml
vendored
|
|
@ -24,19 +24,16 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '18'
|
||||||
|
|
||||||
- name: Generate database
|
- name: Generate statistics
|
||||||
run: node scripts/dbgen.js > stats/database.json
|
run: |
|
||||||
|
node scripts/dict.js > stats/dict.json 2>&1 &
|
||||||
- name: Count domains
|
ls domains | wc -l > stats/count.txt 2>&1 &
|
||||||
run: ls domains | wc -l > stats/count.txt
|
wait
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git add stats/database.json stats/count.txt
|
git add stats/dict.json stats/count.txt
|
||||||
ls -l
|
|
||||||
ls -l stats
|
|
||||||
pwd
|
|
||||||
git commit -m "[automated] update stats"
|
git commit -m "[automated] update stats"
|
||||||
git push
|
git push
|
||||||
|
|
|
||||||
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
|
|
@ -7,7 +7,7 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- "domains/**"
|
- "domains/**"
|
||||||
- ".github/workflows/publish.yml"
|
- ".github/workflows/publish.yml"
|
||||||
- "dnsconfig.js"
|
- "scripts/dnsconfig.js"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.ref }}-publish
|
group: ${{ github.ref }}-publish
|
||||||
|
|
@ -26,4 +26,4 @@ jobs:
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
|
||||||
with:
|
with:
|
||||||
args: push
|
args: push
|
||||||
config_file: "dnsconfig.js"
|
config_file: "scripts/dnsconfig.js"
|
||||||
7
.github/workflows/validation.yml
vendored
7
.github/workflows/validation.yml
vendored
|
|
@ -8,7 +8,8 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- "domains/**"
|
- "domains/**"
|
||||||
- ".github/workflows/validation.yml"
|
- ".github/workflows/validation.yml"
|
||||||
- "dnsconfig.js"
|
- "scripts/dnsconfig.js"
|
||||||
|
- "scripts/schema.json"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.ref }}-validation
|
group: ${{ github.ref }}-validation
|
||||||
|
|
@ -24,7 +25,7 @@ jobs:
|
||||||
uses: koenrh/dnscontrol-action@v3
|
uses: koenrh/dnscontrol-action@v3
|
||||||
with:
|
with:
|
||||||
args: check
|
args: check
|
||||||
config_file: "dnsconfig.js"
|
config_file: "scripts/dnsconfig.js"
|
||||||
json:
|
json:
|
||||||
name: JSON
|
name: JSON
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -40,4 +41,4 @@ jobs:
|
||||||
uses: cardinalby/schema-validator-action@v3
|
uses: cardinalby/schema-validator-action@v3
|
||||||
with:
|
with:
|
||||||
file: 'domains/*.json'
|
file: 'domains/*.json'
|
||||||
schema: 'schema.json'
|
schema: 'scripts/schema.json'
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
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
|
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
12
scripts/dict.js
Normal file
12
scripts/dict.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const dict = fs.readdirSync('./domains').map(f => [
|
||||||
|
f.split('.').slice(0, -1).join('.'),
|
||||||
|
JSON.parse(fs.readFileSync(`./domains/${f}`, 'utf8')).owner.username // owner
|
||||||
|
]).reduce((v, [s, o]) => {
|
||||||
|
if (!v[o]) v[o] = [];
|
||||||
|
v[o].push(s);
|
||||||
|
return v;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
console.log(dict);
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
/// <reference path="types-dnscontrol.d.ts"/>
|
/// <reference path="./types-dnscontrol.d.ts"/>
|
||||||
// ^^^^^^ https://docs.dnscontrol.org/getting-started/typescript
|
// ^^^^^^ https://docs.dnscontrol.org/getting-started/typescript
|
||||||
|
|
||||||
var regNone = NewRegistrar("none");
|
var regNone = NewRegistrar("none");
|
||||||
|
|
@ -26,7 +26,7 @@ function getDomainsList(filesPath) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
var domains = getDomainsList('./domains');
|
var domains = getDomainsList('../domains');
|
||||||
var commits = [];
|
var commits = [];
|
||||||
|
|
||||||
for (var idx in domains) {
|
for (var idx in domains) {
|
||||||
0
stats/.gitkeep
Normal file
0
stats/.gitkeep
Normal file
|
|
@ -1 +0,0 @@
|
||||||
20
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
[["@","partofmyid"],["_discord.cutedog5695","CuteDog5695"],["_discord","SX-9"],["_discord.justdeveloper","JustDeveloper1"],["c","orangci"],["cutedog5695","CuteDog5695"],["j","JustDeveloper1"],["jd","JustDeveloper1"],["js","JustDeveloper1"],["just","JustDeveloper1"],["justdev","JustDeveloper1"],["justdeveloper","JustDeveloper1"],["juststudio","JustDeveloper1"],["katz","Bananalolok"],["no-one-is","EducatedSuddenBucket"],["rchessauth","vortexprime24"],["satr14","SX-9"],["stef","Stef-00012"],["ukriu","ukriu"],["you-are","Stef-00012"]]
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue