From eddd18abaa541b810bb7bedb7670f93098b93133 Mon Sep 17 00:00:00 2001 From: Ahmed Tarek Date: Fri, 9 Oct 2020 23:03:28 +0200 Subject: [PATCH 1/8] =?UTF-8?q?=E2=9C=A8=20add=20domain:=20tokyo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domains/tokyo.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/tokyo.json diff --git a/domains/tokyo.json b/domains/tokyo.json new file mode 100644 index 000000000..34eda41b1 --- /dev/null +++ b/domains/tokyo.json @@ -0,0 +1,11 @@ +{ + "description": "tokyo.is-a.dev", + "repo": "https://github.com/is-a-dev/is-a-dev.github.io", + "owner": { + "username": "a-tokyo", + "email": "ahmed.tokyo1@gmail.com" + }, + "record": { + "CNAME": "is-a-dev.github.io" + } +} From 778dcf524eb537551cac71fab66d5b1603c1bcb8 Mon Sep 17 00:00:00 2001 From: Ahmed Tarek Date: Fri, 9 Oct 2020 23:07:46 +0200 Subject: [PATCH 2/8] Update tokyo.json --- domains/tokyo.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/domains/tokyo.json b/domains/tokyo.json index 34eda41b1..ecc49ea6e 100644 --- a/domains/tokyo.json +++ b/domains/tokyo.json @@ -1,11 +1,12 @@ { - "description": "tokyo.is-a.dev", - "repo": "https://github.com/is-a-dev/is-a-dev.github.io", + "description": "A-Tokyo's website", + "repo": "https://github.com/a-tokyo/tokyo", "owner": { "username": "a-tokyo", "email": "ahmed.tokyo1@gmail.com" }, "record": { - "CNAME": "is-a-dev.github.io" + "CNAME": "tokyo.is-a-dev.github.io" + "URL": "https://tokyo.is-a.dev" } } From bc874f7709e237352b328c80a0bef8ad18961a26 Mon Sep 17 00:00:00 2001 From: Ahmed Tarek Date: Fri, 9 Oct 2020 23:13:43 +0200 Subject: [PATCH 3/8] Update tokyo.json --- domains/tokyo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/tokyo.json b/domains/tokyo.json index ecc49ea6e..a053a2ccd 100644 --- a/domains/tokyo.json +++ b/domains/tokyo.json @@ -6,7 +6,7 @@ "email": "ahmed.tokyo1@gmail.com" }, "record": { - "CNAME": "tokyo.is-a-dev.github.io" + "CNAME": "tokyo.is-a-dev.github.io", "URL": "https://tokyo.is-a.dev" } } From 4735c1d23a487c89202a51b0a1a4866731d06dcb Mon Sep 17 00:00:00 2001 From: tickle Date: Fri, 9 Oct 2020 22:42:34 +0000 Subject: [PATCH 4/8] update domains --- domains/picklerick.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/picklerick.json diff --git a/domains/picklerick.json b/domains/picklerick.json new file mode 100644 index 000000000..b9d70f69e --- /dev/null +++ b/domains/picklerick.json @@ -0,0 +1,12 @@ +{ + "description": "cool stuff", + "repo": "https://github.com/ticklerick/ticklerick.github.io", + "owner": { + "username": "ticklerick", + "email": "pickle@anonemail.net" + }, + "record": { + "CNAME": "ticklerick.github.io", + "URL": "https://picklerick.is-a.dev" + } +} \ No newline at end of file From faba306cef385e07f81ab81d1767667962b081a1 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 13:27:17 +0530 Subject: [PATCH 5/8] doc change --- API.md | 2 +- scripts/reply.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/API.md b/API.md index 746f953f1..43bc51d64 100644 --- a/API.md +++ b/API.md @@ -22,7 +22,7 @@ } ``` * After the pull request is merged, you will see a 404 error on `your-domain.is-a.dev`. To fix this go to your github page repo's `Settings > Github pages > Custom domain` and add `your-domain.is-a.dev` in the given field -* If you have added the `URL` record for forced https, check the `Enforce HTTPS` checkbox too +* Check the `Enforce HTTPS` checkbox below the custom domain input diff --git a/scripts/reply.js b/scripts/reply.js index b4fad71ae..9c5fc11b2 100644 --- a/scripts/reply.js +++ b/scripts/reply.js @@ -11,7 +11,7 @@ If your domain points to a server you own, add \`domain-name.is-a.dev\` to your * Open up the **settings** tab * Scroll down to the **Github pages** section * In the **Custom domain** text input, enter the domain you registered (\`domain-name.is-a.dev\`) -* Check the 'Enforce HTTPS' check box if you added the URL record for forced https redirection +* Check the 'Enforce HTTPS' checkbox below the input * Give it some time to reflect and you should be good to go From 96e8e269f135603c4bb7a4fcb8d2e9df70ed6666 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 13:28:28 +0530 Subject: [PATCH 6/8] Removes www for redirection --- utils/domain-service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/domain-service.js b/utils/domain-service.js index f78652740..733ca29b6 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -9,7 +9,7 @@ const recordToRedirection = ({ name, address }) => ({ redirect: address, type: 'permanent', redirect_wildcard: 1, - redirect_www: 0, + redirect_www: 1, }); const recordToZone = ({ name, type, address, ...rec }) => ({ ...rec, //line From b4dc020d2705ec1c1cbb96a34594224befd88653 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 13:45:49 +0530 Subject: [PATCH 7/8] Adds simple migrate script --- scripts/migrate.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scripts/migrate.js diff --git a/scripts/migrate.js b/scripts/migrate.js new file mode 100644 index 000000000..e5da7ebf5 --- /dev/null +++ b/scripts/migrate.js @@ -0,0 +1,30 @@ +const fs = require('fs'); +const path = require('path'); +const R = require('ramda'); +const { DOMAINS_PATH } = require('./utils/constants'); + +const migrate = ([file, domain]) => [ + file, + { + ...domain, + record: /\.github\.io$/.test(domain.record.CNAME || '') + ? R.dissoc('URL', domain.record) + : domain.record, + } +]; + +const main = async () => { + const domains = await fs.promises.readdir(DOMAINS_PATH).then(R.map(async file => [ + file, + JSON.parse(await fs.promises.readFile(path.join(DOMAINS_PATH, file), 'utf-8')), + ])).then(ps => Promise.all(ps)); + + const newDomains = domains.map(migrate); + + await Promise.all(newDomains.map(([file, json]) => { + return fs.promises.writeFile(path.join(DOMAINS_PATH, file), JSON.stringify(json, null, 2)); + })); +}; + +main(); + From ab8ba757d52d248ce34f4fc3e289ce877776c7f4 Mon Sep 17 00:00:00 2001 From: Ahmed Tarek Date: Mon, 12 Oct 2020 15:00:04 +0200 Subject: [PATCH 8/8] Update tokyo.json --- domains/tokyo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/tokyo.json b/domains/tokyo.json index a053a2ccd..fb1814029 100644 --- a/domains/tokyo.json +++ b/domains/tokyo.json @@ -6,7 +6,7 @@ "email": "ahmed.tokyo1@gmail.com" }, "record": { - "CNAME": "tokyo.is-a-dev.github.io", + "CNAME": "a-tokyo.github.io", "URL": "https://tokyo.is-a.dev" } }