From 1484db9c1301c54bd11fd8fc399b6242a66e9644 Mon Sep 17 00:00:00 2001 From: Gj4meZ <69838718+Gj4meZ@users.noreply.github.com> Date: Tue, 1 Apr 2025 09:27:04 +0330 Subject: [PATCH 1/4] Create lovely.localplayer.dev.json --- domains/lovely.localplayer.dev.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 domains/lovely.localplayer.dev.json diff --git a/domains/lovely.localplayer.dev.json b/domains/lovely.localplayer.dev.json new file mode 100644 index 00000000..5bf314b0 --- /dev/null +++ b/domains/lovely.localplayer.dev.json @@ -0,0 +1,16 @@ +{ + "description": "gateway for site", + "domain": "localplayer.dev", + "subdomain": "lovely", + + "owner": { + "repo": "https://github.com/Gj4meZ/rsr", + "email": "chilliatogj4mez@gmail.com" + }, + + "record": { + "A": ["87.106.232.208"] + }, + + "proxied": true +} From f6cc7d5f868985ccd20381c7cb03b21d1883b0c2 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Sun, 13 Apr 2025 20:34:25 -0400 Subject: [PATCH 2/4] chore: more validation --- tests/json.test.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/json.test.js b/tests/json.test.js index 5e5c50ea..72deb5b8 100644 --- a/tests/json.test.js +++ b/tests/json.test.js @@ -80,6 +80,29 @@ t("All files should have the required fields", (t) => { }); }); +t("All files should have lowercase subdomain/domain and match filename", (t) => { + const files = fs.readdirSync(domainsPath).filter(file => { + const filePath = path.join(domainsPath, file); + return file.endsWith(".json") && fs.lstatSync(filePath).isFile(); + }); + + files.forEach(file => { + const filePath = path.join(domainsPath, file); + const data = fs.readJsonSync(filePath); + + const { subdomain, domain } = data; + + t.truthy(subdomain, `${file}: Missing subdomain field`); + t.truthy(domain, `${file}: Missing domain field`); + + t.is(subdomain, subdomain.toLowerCase(), `${file}: 'subdomain' must be lowercase`); + t.is(domain, domain.toLowerCase(), `${file}: 'domain' must be lowercase`); + + const expectedFileName = `${subdomain}.${domain}.json`; + t.is(file, expectedFileName, `${file}: Filename does not match subdomain and domain`); + }); +}); + t("All files should have valid optional owner fields", (t) => { const files = fs.readdirSync(domainsPath).filter(file => { const filePath = path.join(domainsPath, file); From 281ddd5421ac9913b76c39b772b89d56b436c3a3 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Sun, 13 Apr 2025 20:36:30 -0400 Subject: [PATCH 3/4] fix: validation --- tests/json.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/json.test.js b/tests/json.test.js index 72deb5b8..aca87b76 100644 --- a/tests/json.test.js +++ b/tests/json.test.js @@ -80,7 +80,7 @@ t("All files should have the required fields", (t) => { }); }); -t("All files should have lowercase subdomain/domain and match filename", (t) => { +t("All filenames, subdomains, and domains must be lowercase", (t) => { const files = fs.readdirSync(domainsPath).filter(file => { const filePath = path.join(domainsPath, file); return file.endsWith(".json") && fs.lstatSync(filePath).isFile(); @@ -90,16 +90,17 @@ t("All files should have lowercase subdomain/domain and match filename", (t) => const filePath = path.join(domainsPath, file); const data = fs.readJsonSync(filePath); + // Check filename is lowercase + t.is(file, file.toLowerCase(), `${file}: Filename must be lowercase`); + const { subdomain, domain } = data; + // Check JSON values are lowercase t.truthy(subdomain, `${file}: Missing subdomain field`); t.truthy(domain, `${file}: Missing domain field`); - t.is(subdomain, subdomain.toLowerCase(), `${file}: 'subdomain' must be lowercase`); - t.is(domain, domain.toLowerCase(), `${file}: 'domain' must be lowercase`); - - const expectedFileName = `${subdomain}.${domain}.json`; - t.is(file, expectedFileName, `${file}: Filename does not match subdomain and domain`); + t.is(subdomain, subdomain.toLowerCase(), `${file}: Subdomain must be lowercase`); + t.is(domain, domain.toLowerCase(), `${file}: Domain must be lowercase`); }); }); From cc25afcd4a46680192a03b759ef94ca9afc6bc04 Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Sun, 13 Apr 2025 20:41:24 -0400 Subject: [PATCH 4/4] chore: allow concurrent runs --- .github/workflows/validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index de78330c..cc6ac600 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.ref }}-validation + group: pr-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: