mirror of
https://github.com/partofmyid/register.git
synced 2026-06-05 18:46:50 +07:00
database sync
This commit is contained in:
parent
b5052b73dc
commit
d3c6ec4de9
4 changed files with 73 additions and 4 deletions
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
|
@ -1,12 +1,15 @@
|
||||||
<!-- To make our job easier, please spend time to review your application before submitting. -->
|
<!--
|
||||||
|
To make our job easier, please spend time to review your application before submitting.
|
||||||
|
To check an item, add an 'X' between the brackets: '[ ]' => '[X]'
|
||||||
|
-->
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
- [ ] The website is reachable.
|
- [ ] The website is reachable.
|
||||||
- [ ] You have completed your website.
|
- [ ] You have completed your website.
|
||||||
<!-- ^^^^^^^ ignore if its not a website but provide a clear description of what your doing with this subdomain -->
|
<!-- ^^^^^^^ ignore if its not a website but provide a clear description of what your doing with this subdomain -->
|
||||||
|
|
||||||
- [ ] The CNAME record doesn't contain `https://` or `/`. <!-- ignore if your not using CNAME -->
|
- [ ] The CNAME record is a valid hostname and doesn't contain `https://` or `/`. <!-- ignore if your not using CNAME -->
|
||||||
- [ ] There is sufficient information at the `owner` field. (including `username`)
|
- [ ] There is sufficient information at the `owner` field. (including your github `username`)
|
||||||
- [ ] I have read the [README](https://github.com/partofmyid/register) for announcements in case of any updates.
|
- [ ] I have read the [README](https://github.com/partofmyid/register) for announcements in case of any updates.
|
||||||
- [ ] I know what im doing and everything is ready.
|
- [ ] I know what im doing and everything is ready.
|
||||||
|
|
||||||
|
|
|
||||||
55
.github/workflows/db.yml
vendored
Normal file
55
.github/workflows/db.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
name: Database Sync
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "domains/**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Generate database
|
||||||
|
run: node dbgen.js > database.json
|
||||||
|
|
||||||
|
- name: Upload database artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: database
|
||||||
|
path: database.json
|
||||||
|
|
||||||
|
upload:
|
||||||
|
needs: generate
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Download database artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: database
|
||||||
|
path: database.json
|
||||||
|
|
||||||
|
- name: Commit and push database.json
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'github-actions'
|
||||||
|
git config --global user.email 'github-actions@github.com'
|
||||||
|
git add database.json
|
||||||
|
git commit -m 'Update database.json'
|
||||||
|
git push
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
10
dbgen.js
Normal file
10
dbgen.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
console.log(
|
||||||
|
JSON.stringify(
|
||||||
|
require('fs').readdirSync('./domains').map(f =>
|
||||||
|
[
|
||||||
|
f.split('.').slice(0, -1).join('.'), // subdomain
|
||||||
|
require(`./domains/${f}`).owner.username // owner
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// @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");
|
||||||
var providerCf = DnsProvider(NewDnsProvider("cloudflare", "CLOUDFLAREAPI", {
|
var providerCf = DnsProvider(NewDnsProvider("cloudflare", "CLOUDFLAREAPI", {
|
||||||
// manage_redirects: true,
|
// manage_redirects: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue