diff --git a/.github/labeler.yml b/.github/labeler.yml index 92c2ca7..2351ffe 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,5 +1,14 @@ domain: - domains/* +dns: +- "scripts/dns.js" + readme: - "README.md" + +schemas: +- schemas/** + +workflows: +- .github/workflows/** diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 204f7ef..bb7d8a4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,9 @@ on: workflow_dispatch: {} push: branches: [main] - paths: [domains/**, .github/workflows/deploy-records.yml] + paths: + - "domains/**" + - ".github/workflows/deploy.yml" concurrency: group: ${{ github.ref }}-deploy @@ -17,12 +19,13 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: gacts/install-dnscontrol@v1 + - name: Create creds.json + run: echo '{"cloudflare":{"TYPE":"CLOUDFLAREAPI","apitoken":"$CLOUDFLARE_API_TOKEN"}}' > ./creds.json - - name: Create credentials file - run: echo '{"cloudflare":{"TYPE":"CLOUDFLAREAPI","accountid":"$CF_ID","apitoken":"$CF_TOKEN"}}' > ./creds.json - - - run: dnscontrol push + - name: Push Data + uses: koenrh/dnscontrol-action@v3 env: - CF_ID: ${{ secrets.CF_ACCOUNT_ID }} - CF_TOKEN: ${{ secrets.CF_API_TOKEN }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} + with: + args: push + config_file: "scripts/dns.js" diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml deleted file mode 100644 index 9ff869b..0000000 --- a/.github/workflows/issue.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Issue - -on: - issues: - types: [opened] - -permissions: - contents: read - -jobs: - comment: - name: Comment - runs-on: ubuntu-latest - - permissions: - issues: write - - steps: - - uses: actions/checkout@v3 - - - uses: peter-evans/create-or-update-comment@v2 - with: - body: "Thank you for opening an issue, we will respond as soon as possible." - issue-number: ${{ github.event.issue.number }} - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index adef93a..07bef48 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,6 +15,7 @@ jobs: with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true + check-star: name: Check Star runs-on: ubuntu-latest diff --git a/.github/workflows/raw-api.yml b/.github/workflows/raw-api.yml index e50e7db..419a72b 100644 --- a/.github/workflows/raw-api.yml +++ b/.github/workflows/raw-api.yml @@ -4,8 +4,8 @@ on: push: branches: [main] paths: + - "domains/*" - ".github/workflows/raw-api.yml" - - "domains/*.json" - "scripts/raw-api.js" jobs: @@ -22,11 +22,18 @@ jobs: with: node-version: 16 - - name: Run Script - run: | - node scripts/raw-api.js + - run: mkdir raw-api - - name: Push Data + - name: Create CNAME + run: echo "raw.freesubdomains.org" > ./raw-api/CNAME + + - name: Create index.json + run: echo "" > ./raw-api/index.json + + - name: Run Script + run: node scripts/raw-api.js + + - name: Push uses: cpina/github-action-push-to-another-repository@main with: source-directory: "raw-api" diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 372dab6..1eb21c1 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -5,9 +5,10 @@ on: push: branches: [main] paths: - - "domains/" - - "schemas/" - - "dnsconfig.js" + - "dns/**" + - "domains/**" + - "schemas/**" + - ".github/workflows/validation.yml" pull_request: concurrency: @@ -20,5 +21,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: gacts/install-dnscontrol@v1 - - run: dnscontrol check + + - name: Check + uses: koenrh/dnscontrol-action@v3 + with: + args: check + config_file: "scripts/dns.js" + + json: + name: JSON + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: JSON Syntax Check + uses: limitusus/json-syntax-check@v1 + with: + pattern: "\\.json$" + env: + BASE: "domains/" diff --git a/README.md b/README.md index 77fc4df..8e25602 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Please select a method below to show instructions on how to register a domain.
1. **Star** and **[Fork](https://github.com/free-domains/register/fork)** this repository - 2. Add a new file called `example.domain.com.json` in the `/domains` folder to register the `example` subdomain on the `domain.com`. + 2. Add a new file called `example.domain.dev.json` in the `/domains` folder to register the `example` subdomain on the `domain.dev`. - An list of available domains can be found [here](#domains). 3. Edit it to meet your needs. - The file listed below is just an **example**, provide a **valid** JSON file with your needs. @@ -68,7 +68,7 @@ Please select a method below to show instructions on how to register a domain. { "$schema": "../schemas/domain.json", - "domain": "is-a-frontend.dev", + "domain": "is-a-fullstack.dev", "subdomain": "example", "owner": { @@ -107,6 +107,7 @@ Please select a method below to show instructions on how to register a domain. |:-:| | [`is-a-backend.dev`](https://is-a-backend.dev) | | [`is-a-frontend.dev`](https://is-a-frontend.dev) | +| [`is-a-fullstack.dev`](https://is-a-fullstack.dev) | ### Settings diff --git a/domains/dan.is-a-backend.dev.json b/domains/dan.is-a-backend.dev.json index 180ec55..1bd969c 100644 --- a/domains/dan.is-a-backend.dev.json +++ b/domains/dan.is-a-backend.dev.json @@ -12,5 +12,5 @@ "CNAME": "dkwygtig.github.io" }, - "proxied": true + "proxied": false } diff --git a/domains/kro.is-a-backend.dev.json b/domains/kro.is-a-backend.dev.json new file mode 100644 index 0000000..6e736b4 --- /dev/null +++ b/domains/kro.is-a-backend.dev.json @@ -0,0 +1,16 @@ +{ + "$schema": "../schemas/domain.json", + + "domain": "is-a-frontend.dev", + "subdomain": "kro", + + "owner": { + "email": "krooking0@gmail.com" + }, + + "records": { + "CNAME": "cname.vercel-dns.com" + }, + + "proxied": false +} diff --git a/domains/mahidoodi.is-a-backend.dev.json b/domains/mahidoodi.is-a-backend.dev.json new file mode 100644 index 0000000..ba4cc47 --- /dev/null +++ b/domains/mahidoodi.is-a-backend.dev.json @@ -0,0 +1,16 @@ +{ + "$schema": "../schemas/domain.json", + + "domain": "is-a-backend.dev", + "subdomain": "mahidoodi", + + "owner": { + "email": "ahmad.yk94@gmail.com" + }, + + "records": { + "CNAME": "crimson-lab-e0b9.powerfull.workers.dev" + }, + + "proxied": false +} diff --git a/domains/reserved/*.is-a-backend.dev.json b/domains/reserved/*.is-a-backend.dev.json index 223f2f7..52d72d2 100644 --- a/domains/reserved/*.is-a-backend.dev.json +++ b/domains/reserved/*.is-a-backend.dev.json @@ -9,4 +9,4 @@ }, "proxied": false -} \ No newline at end of file +} diff --git a/domains/reserved/*.is-a-frontend.dev.json b/domains/reserved/*.is-a-frontend.dev.json index 11d1341..adee7c4 100644 --- a/domains/reserved/*.is-a-frontend.dev.json +++ b/domains/reserved/*.is-a-frontend.dev.json @@ -9,4 +9,4 @@ }, "proxied": false -} \ No newline at end of file +} diff --git a/domains/reserved/is-a-fullstack.dev.json b/domains/reserved/is-a-fullstack.dev.json new file mode 100644 index 0000000..56472e6 --- /dev/null +++ b/domains/reserved/is-a-fullstack.dev.json @@ -0,0 +1,46 @@ +{ + "$schema": "../../schemas/reserved-domain.json", + + "domain": "is-a-fullstack.dev", + "subdomain": "@", + + "records": { + "A": [ + "185.199.108.153", + "185.199.109.153", + "185.199.110.153", + "185.199.111.153" + ], + + "AAAA": [ + "2606:50c0:8000::153", + "2606:50c0:8001::153", + "2606:50c0:8002::153", + "2606:50c0:8003::153" + ], + + "TXT": [ + { + "name": "*._domainkey", + "value": "v=DKIM1; p=" + }, + + { + "name": "_dmarc", + "value": "v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s;" + }, + + { + "name": "_github-pages-challenge-free-domains", + "value": "7c931afdc16843f326d02a669f3705" + }, + + { + "name": "@", + "value": "v=spf1 -all" + } + ] + }, + + "proxied": false +} diff --git a/domains/reserved/www.is-a-backend.dev.json b/domains/reserved/www.is-a-backend.dev.json index 0e33806..5ab2650 100644 --- a/domains/reserved/www.is-a-backend.dev.json +++ b/domains/reserved/www.is-a-backend.dev.json @@ -9,4 +9,4 @@ }, "proxied": false -} \ No newline at end of file +} diff --git a/domains/reserved/www.is-a-frontend.dev.json b/domains/reserved/www.is-a-frontend.dev.json index f8f6a3a..3452139 100644 --- a/domains/reserved/www.is-a-frontend.dev.json +++ b/domains/reserved/www.is-a-frontend.dev.json @@ -9,4 +9,4 @@ }, "proxied": false -} \ No newline at end of file +} diff --git a/domains/reserved/www.is-a-fullstack.dev.json b/domains/reserved/www.is-a-fullstack.dev.json new file mode 100644 index 0000000..5159522 --- /dev/null +++ b/domains/reserved/www.is-a-fullstack.dev.json @@ -0,0 +1,12 @@ +{ + "$schema": "../../schemas/reserved-domain.json", + + "domain": "is-a-fullstack.dev", + "subdomain": "www", + + "records": { + "CNAME": "is-a-fullstack.dev" + }, + + "proxied": false +} diff --git a/domains/william.is-a-backend.dev.json b/domains/william.is-a-backend.dev.json index 94852ed..a387f75 100644 --- a/domains/william.is-a-backend.dev.json +++ b/domains/william.is-a-backend.dev.json @@ -9,14 +9,7 @@ }, "records": { - "CNAME": "williamdavidharrison.github.io", - - "TXT": [ - { - "name": "_github-pages-challenge-williamdavidharrison", - "value": "48bebc4d20ca9ae5e712b5c1d0e39b" - } - ] + "CNAME": "wdhdns.com" }, "proxied": false diff --git a/domains/william.is-a-frontend.dev.json b/domains/william.is-a-frontend.dev.json index 3cb729c..f4366ea 100644 --- a/domains/william.is-a-frontend.dev.json +++ b/domains/william.is-a-frontend.dev.json @@ -9,14 +9,7 @@ }, "records": { - "CNAME": "williamdavidharrison.github.io", - - "TXT": [ - { - "name": "_github-pages-challenge-williamdavidharrison", - "value": "51d4a5e836ec051b1c5b3c5fb050b9" - } - ] + "CNAME": "wdhdns.com" }, "proxied": false diff --git a/domains/william.is-a-fullstack.dev.json b/domains/william.is-a-fullstack.dev.json new file mode 100644 index 0000000..ee4bb50 --- /dev/null +++ b/domains/william.is-a-fullstack.dev.json @@ -0,0 +1,16 @@ +{ + "$schema": "../schemas/domain.json", + + "domain": "is-a-fullstack.dev", + "subdomain": "william", + + "owner": { + "email": "william@freesubdomains.org" + }, + + "records": { + "CNAME": "wdhdns.com" + }, + + "proxied": false +} diff --git a/raw-api/CNAME b/raw-api/CNAME deleted file mode 100644 index bfabf07..0000000 --- a/raw-api/CNAME +++ /dev/null @@ -1 +0,0 @@ -raw.freesubdomains.org \ No newline at end of file diff --git a/raw-api/index.json b/raw-api/index.json deleted file mode 100644 index e69de29..0000000 diff --git a/schemas/domain.json b/schemas/domain.json index cc036b4..a4d2f8e 100644 --- a/schemas/domain.json +++ b/schemas/domain.json @@ -9,7 +9,7 @@ }, "domain": { "type": "string", - "enum": ["is-a-backend.dev", "is-a-frontend.dev"] + "enum": ["is-a-backend.dev", "is-a-frontend.dev", "is-a-fullstack.dev"] }, "subdomain": { "type": "string", diff --git a/schemas/reserved-domain.json b/schemas/reserved-domain.json index 148b1b5..321900c 100644 --- a/schemas/reserved-domain.json +++ b/schemas/reserved-domain.json @@ -9,7 +9,7 @@ }, "domain": { "type": "string", - "enum": ["is-a-backend.dev", "is-a-frontend.dev"] + "enum": ["is-a-backend.dev", "is-a-frontend.dev", "is-a-fullstack.dev"] }, "subdomain": { "type": "string", diff --git a/dnsconfig.js b/scripts/dns.js similarity index 97% rename from dnsconfig.js rename to scripts/dns.js index 8cde19d..a1aa2d0 100644 --- a/dnsconfig.js +++ b/scripts/dns.js @@ -35,7 +35,7 @@ function getDomainsList(filesPath) { return result; } -var domains = getDomainsList("./domains"); +var domains = getDomainsList("../domains"); /** * @type {{}} @@ -45,7 +45,7 @@ var commit = {}; for (var idx in domains) { var domainData = domains[idx].data; - var proxyState = proxy.off; // Disabled by default + var proxyState = proxy.off; if (!commit[domainData.domain]) commit[domainData.domain] = []; if (domainData.proxied === true) proxyState = proxy.on; diff --git a/scripts/raw-api.js b/scripts/raw-api.js index 772d501..89c3398 100644 --- a/scripts/raw-api.js +++ b/scripts/raw-api.js @@ -9,7 +9,7 @@ fs.readdir(directoryPath, function (err, files) { if(err) throw err; function removeValue(value, index, arr) { - if (value === "reserved") { + if(value === "reserved") { arr.splice(index, 1); return true; }