From 0bccbe0757a84a83b74124ac409d00bcb104c722 Mon Sep 17 00:00:00 2001 From: Dan Habot Date: Wed, 7 Oct 2020 18:58:31 -0400 Subject: [PATCH 001/108] Registered for my domain --- domains/dan-habot.is-a.dev | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/dan-habot.is-a.dev diff --git a/domains/dan-habot.is-a.dev b/domains/dan-habot.is-a.dev new file mode 100644 index 000000000..c58d894fd --- /dev/null +++ b/domains/dan-habot.is-a.dev @@ -0,0 +1,12 @@ +{ + "description": "Fullstack web & mobile dev, quality assurance, automation, reverse engineering, and flexible", + "repo": "https://github.com/danhab99/danhab99.github.io", + "owner": { + "username": "danhab99", + "email": "dan.habot@gmail.com" + }, + "record": { + "CNAME": "danhab99.github.io", + "URL": "https://dan-habot.is-a.dev" + } +} From 6305cf77d62992fe7988f8a7f6975c6fba1a32e8 Mon Sep 17 00:00:00 2001 From: georgekaran Date: Thu, 8 Oct 2020 17:59:43 -0300 Subject: [PATCH 002/108] add georgekaran.json domain --- domains/georgekaran.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/georgekaran.json diff --git a/domains/georgekaran.json b/domains/georgekaran.json new file mode 100644 index 000000000..ae89517f2 --- /dev/null +++ b/domains/georgekaran.json @@ -0,0 +1,11 @@ +{ + "description": "George Karan - Personal Page", + "repo": "https://github.com/georgekaran", + "owner": { + "username": "georgekaran", + "email": "georgekaran12@gmail.com" + }, + "record": { + "URL": "https://georgekaran.com" + } +} From ce90cf18fedd68989e81a0ae5fef2958661d7d73 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 8 Oct 2020 16:02:04 -0500 Subject: [PATCH 003/108] Create eric.json --- domains/eric.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/eric.json diff --git a/domains/eric.json b/domains/eric.json new file mode 100644 index 000000000..2ef78034f --- /dev/null +++ b/domains/eric.json @@ -0,0 +1,12 @@ +{ + "description": "Eric's website and blog", + "repo": "https://github.com/yurrriq", + "owner": { + "username": "yurrriq", + "email": "eric@ericb.me", + }, + "record": { + "CNAME": "yurrriq.github.io", + "URL": "https://eric.is-a.dev" + } +} From c870f217760899215042c1961d796123cbf44790 Mon Sep 17 00:00:00 2001 From: Mark Davydov Date: Fri, 9 Oct 2020 00:02:53 +0300 Subject: [PATCH 004/108] Add mark.json added mark json with redirect to linkedin. --- domains/mark.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/mark.json diff --git a/domains/mark.json b/domains/mark.json new file mode 100644 index 000000000..8c79922a8 --- /dev/null +++ b/domains/mark.json @@ -0,0 +1,12 @@ + +{ + "description": "Makr Davydov is a Developer!", + "repo": "https://github.com/markrity", + "owner": { + "username": "markrity", + "email": "markrity@gmail.com" + }, + "record": { + "URL": "https://www.linkedin.com/in/davydovmark/" + } +} From 4c4680177c4a535227c5888807a4b95ffc2ee932 Mon Sep 17 00:00:00 2001 From: Sai Sandeep Vaddi Date: Thu, 8 Oct 2020 21:24:07 +0000 Subject: [PATCH 005/108] Add saisandeepvaddi.json --- domains/saisandeepvaddi.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 domains/saisandeepvaddi.json diff --git a/domains/saisandeepvaddi.json b/domains/saisandeepvaddi.json new file mode 100644 index 000000000..584f761ae --- /dev/null +++ b/domains/saisandeepvaddi.json @@ -0,0 +1,10 @@ +{ + "description": "Sai Sandeep Vaddi's website", + "owner": { + "username": "saisandeepvaddi", + "email": "saisandeepvaddi@gmail.com" + }, + "record": { + "A": ["104.198.14.52"] + } +} From bb7d74dfa92ac209e4f3965cacbe4fb2ff363199 Mon Sep 17 00:00:00 2001 From: Matheus Costa Date: Thu, 8 Oct 2020 18:27:57 -0300 Subject: [PATCH 006/108] Create matheus.json --- domains/matheus.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/matheus.json diff --git a/domains/matheus.json b/domains/matheus.json new file mode 100644 index 000000000..d5f7196f5 --- /dev/null +++ b/domains/matheus.json @@ -0,0 +1,12 @@ +{ + "description": "Matheus Costa's personal developer website", + "repo": "https://github.com/mthcsta/mthcsta.github.io", + "owner": { + "username": "mthcsta", + "email": "matheuscosta.dev@yahoo.com" + }, + "record": { + "CNAME": "mthcsta.github.io", + "URL": "https://matheus.is-a.dev" + } +} From 4f3c28e6483aaf8abb5930fe140a0bddf6e59221 Mon Sep 17 00:00:00 2001 From: Vitor Dino Date: Thu, 8 Oct 2020 18:29:55 -0300 Subject: [PATCH 007/108] add dino --- domains/dino.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/dino.json diff --git a/domains/dino.json b/domains/dino.json new file mode 100644 index 000000000..af974a8de --- /dev/null +++ b/domains/dino.json @@ -0,0 +1,12 @@ +{ + "description": "Vitor Dino is a front-end developer and ui designer", + "repo": "https://github.com/vitordino", + "owner": { + "username": "vitordino", + "email": "me@vitordino.com" + }, + "record": { + "CNAME": "vitordino.com", + "URL": "https://dino.is-a.dev" + } +} From b51a158c1bfcdd7ab8ed95eed614cf3a01aaa366 Mon Sep 17 00:00:00 2001 From: Alan Schio <6757777+schirrel@users.noreply.github.com> Date: Thu, 8 Oct 2020 17:48:25 -0400 Subject: [PATCH 008/108] Create alan.json --- domains/alan.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/alan.json diff --git a/domains/alan.json b/domains/alan.json new file mode 100644 index 000000000..eb0a1bd31 --- /dev/null +++ b/domains/alan.json @@ -0,0 +1,12 @@ +{ + "description": "Alan's personal developer website", + "repo": "https://github.com/schirrel", + "owner": { + "username": "schirrel", + "email": "alan@schirrel.dev" + }, + "record": { + "CNAME": "schirrel.dev", + "URL": "https://alan.is-a.dev" + } +} From dd01185a66c8a85758767914b5856ea374979e5b Mon Sep 17 00:00:00 2001 From: Vivek Kumar Date: Thu, 8 Oct 2020 15:04:59 -0700 Subject: [PATCH 009/108] create vivekkumar.json --- domains/vivekkumar.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 domains/vivekkumar.json diff --git a/domains/vivekkumar.json b/domains/vivekkumar.json new file mode 100644 index 000000000..c7048deaa --- /dev/null +++ b/domains/vivekkumar.json @@ -0,0 +1,13 @@ +{ + "description": "Vivek's portfolio website", + "repo": "https://github.com/VivekKumarNeu/VivekKumarNeu.github.io", + "owner": { + "username": "vivekkumarneu", + "email": "vivek-kumar@live.in" + }, + "record": { + "CNAME": "VivekKumarNeu.github.io", + "URL": "https://vivekkumar.is-a.dev" + } + } + \ No newline at end of file From aadf33c3c5800f350d33ccee6efda99e2322c4cd Mon Sep 17 00:00:00 2001 From: Roy Date: Thu, 8 Oct 2020 18:34:00 -0500 Subject: [PATCH 010/108] Created roy.json personal json file --- domains/roy.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/roy.json diff --git a/domains/roy.json b/domains/roy.json new file mode 100644 index 000000000..678134f47 --- /dev/null +++ b/domains/roy.json @@ -0,0 +1,12 @@ +{ + "description": "Roy's portfolio website", + "repo": "https://github.com/rcrj/rcrj.github.io", + "owner": { + "username": "rcrj", + "email": "rcrj95@gmail.com" + }, + "record": { + "CNAME": "rcrj.github.io", + "URL": "https://roy.is-a.dev" + } +} From 6381086eaf721b317fd27b62aa106f17052e4efa Mon Sep 17 00:00:00 2001 From: Mike Perry Y Attara <31483629+mikeattara@users.noreply.github.com> Date: Thu, 8 Oct 2020 23:47:07 +0000 Subject: [PATCH 011/108] add mpy subdomain --- domains/mpy.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/mpy.json diff --git a/domains/mpy.json b/domains/mpy.json new file mode 100644 index 000000000..a2e26935e --- /dev/null +++ b/domains/mpy.json @@ -0,0 +1,12 @@ +{ + "description": "Mike Perry Y Attara's personal website", + "repo": "https://github.com/mikeattara", + "owner": { + "username": "mikeattara", + "email": "mpyebattara@gmail.com" + }, + "record": { + "CNAME": "mikeattara.github.io", + "URL": "https://mpy.is-a.dev" + } + } \ No newline at end of file From 16bc93bc10ad1c6a4a08a248f286740845c9f293 Mon Sep 17 00:00:00 2001 From: Mike Perry Y Attara <31483629+mikeattara@users.noreply.github.com> Date: Fri, 9 Oct 2020 00:37:30 +0000 Subject: [PATCH 012/108] format --- domains/mpy.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/domains/mpy.json b/domains/mpy.json index a2e26935e..474c3889b 100644 --- a/domains/mpy.json +++ b/domains/mpy.json @@ -1,12 +1,12 @@ { - "description": "Mike Perry Y Attara's personal website", - "repo": "https://github.com/mikeattara", - "owner": { - "username": "mikeattara", - "email": "mpyebattara@gmail.com" - }, - "record": { - "CNAME": "mikeattara.github.io", - "URL": "https://mpy.is-a.dev" - } - } \ No newline at end of file + "description": "Mike Perry Y Attara's personal website", + "repo": "https://github.com/mikeattara", + "owner": { + "username": "mikeattara", + "email": "mpyebattara@gmail.com" + }, + "record": { + "CNAME": "mikeattara.github.io", + "URL": "https://mpy.is-a.dev" + } +} \ No newline at end of file From 747357240f1a47760f6a9d95abb3edbb64214690 Mon Sep 17 00:00:00 2001 From: Kintsugi Date: Fri, 9 Oct 2020 03:39:50 +0300 Subject: [PATCH 013/108] create ezedinff.json --- domains/ezedinff.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/ezedinff.json diff --git a/domains/ezedinff.json b/domains/ezedinff.json new file mode 100644 index 000000000..6e61aad08 --- /dev/null +++ b/domains/ezedinff.json @@ -0,0 +1,12 @@ +{ + "description": "Ezedin's personal developer website", + "repo": "https://github.com/ezedinff", + "owner": { + "username": "ezedinff", + "email": "ezedin.fedlu@gmail.com" + }, + "record": { + "CNAME": "https://black-horse-coder-blog.vercel.app/", + "URL": "https://ezedin.is-a.dev" + } +} From aa022e3696d1462733d58b6ab3b978c062105c2f Mon Sep 17 00:00:00 2001 From: Savio Martin <61895712+saviomartin@users.noreply.github.com> Date: Fri, 9 Oct 2020 07:52:50 +0530 Subject: [PATCH 014/108] Created Savio.json --- domains/savio.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/savio.json diff --git a/domains/savio.json b/domains/savio.json new file mode 100644 index 000000000..0bdea966a --- /dev/null +++ b/domains/savio.json @@ -0,0 +1,12 @@ + { + "description": "Savio Martin is a Dev", + "repo": "https://github.com/saviomartin/register", + "owner": { + "username": "saviomartin", + "email": "saviomartin2020@gmail.com" + }, + "record": { + "CNAME": "saviomartin.github.io", + "URL": "https://savio.is-a.dev" + } +} From 0c01284dc87ac16f0bfc65fb617b75dcdee492af Mon Sep 17 00:00:00 2001 From: Nimish Date: Fri, 9 Oct 2020 08:48:47 +0530 Subject: [PATCH 015/108] chore: added the nimish domain --- domains/nimish.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/nimish.json diff --git a/domains/nimish.json b/domains/nimish.json new file mode 100644 index 000000000..a8b343dec --- /dev/null +++ b/domains/nimish.json @@ -0,0 +1,12 @@ +{ + "description": "Nimish's Engineering Diary", + "repo": "https://github.com/nimish-gupta/blog", + "owner": { + "username": "nimish-gupta", + "email": "gnimish03@gmail.com" + }, + "record": { + "CNAME": "nimish-gupta.dev", + "URL": "https://nimish.is-a.dev" + } +} From 22ff6eef9be60046d9772e26403d90d25a78387e Mon Sep 17 00:00:00 2001 From: Daggron Date: Fri, 9 Oct 2020 08:54:29 +0530 Subject: [PATCH 016/108] add(abhay.json): Added the json for abhay --- domains/abhay.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/abhay.json diff --git a/domains/abhay.json b/domains/abhay.json new file mode 100644 index 000000000..55d695f56 --- /dev/null +++ b/domains/abhay.json @@ -0,0 +1,12 @@ +{ + "description": "Abhay's portfolio website", + "repo": "https://github.com/daggron/daggron.github.io", + "owner": { + "username": "Daggron", + "email": "returnofking04@gmail.com" + }, + "record": { + "CNAME": "codeinator.me", + "URL": "http://codeinator.me" + } +} \ No newline at end of file From b34ee739fccdfe694c2fa8d29e071be7c032699d Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 9 Oct 2020 09:30:25 +0530 Subject: [PATCH 017/108] A new file --- domains/jacob.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/jacob.json diff --git a/domains/jacob.json b/domains/jacob.json new file mode 100644 index 000000000..0ea327a3a --- /dev/null +++ b/domains/jacob.json @@ -0,0 +1,12 @@ +{ + "description": "My cool dev", + "repo": "https://github.com/jacob13400/jacob13400.github.io", + "owner": { + "username": "jacob13400", + "email": "jacob13400@gmail.com" + }, + "record": { + "CNAME": "jacob13400.github.io", + "URL": "https://your-domain.is-a.dev" + } +} From 089a3688fe7e834aa539c37af4c3fc087a2c19ac Mon Sep 17 00:00:00 2001 From: AbhishekS-2099 Date: Fri, 9 Oct 2020 09:33:35 +0530 Subject: [PATCH 018/108] Added json in domains directory: abhishek.json --- domains/abhishek.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/abhishek.json diff --git a/domains/abhishek.json b/domains/abhishek.json new file mode 100644 index 000000000..22545cd82 --- /dev/null +++ b/domains/abhishek.json @@ -0,0 +1,12 @@ +{ + "description": "Abhishek's personal website", + "repo": "https://github.com/nullpointxr", + "owner": { + "username": "nullpointxr", + "email": "abhishek.sankar.in@protonmail.com" + }, + "record": { + "CNAME": "nullpointxr.github.io", + "URL": "https://abhishek.is-a.dev" + } +} From 722c12fc131b4e6285aa1e337dd3af287c2413c5 Mon Sep 17 00:00:00 2001 From: Farzan F A Date: Fri, 9 Oct 2020 10:02:09 +0530 Subject: [PATCH 019/108] Create farzan.json --- domains/farzan.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/farzan.json diff --git a/domains/farzan.json b/domains/farzan.json new file mode 100644 index 000000000..535308431 --- /dev/null +++ b/domains/farzan.json @@ -0,0 +1,12 @@ +{ + "description": "Farzan F A is a Dev", + "repo": "https://github.com/Farzanfa/Farzanfa.github.io", + "owner": { + "username": "farzanfa", + "email": "farzanfa007@gmail.com" + }, + "record": { + "CNAME": "Farzanfa.github.io", + "URL": "https://farzan.is-a.dev" + } +} From 016bbe9885687c9363a2e93a55bdd707f495cd06 Mon Sep 17 00:00:00 2001 From: Aashutosh Rathi Date: Fri, 9 Oct 2020 10:05:50 +0530 Subject: [PATCH 020/108] aashutosh.dev --- domains/aashutosh.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/aashutosh.json diff --git a/domains/aashutosh.json b/domains/aashutosh.json new file mode 100644 index 000000000..2399d7be0 --- /dev/null +++ b/domains/aashutosh.json @@ -0,0 +1,11 @@ +{ + "description": "Aashutosh Rathi's Space on Web", + "owner": { + "username": "aashutoshrathi", + "email": "me@aashutosh.dev" + }, + "record": { + "CNAME": "aashutosh.dev", + "URL": "https://aashutosh.is-a.dev" + } +} From 0d24f4ad92b36605efaeaab5591a1e9f65e40579 Mon Sep 17 00:00:00 2001 From: JackY Date: Fri, 9 Oct 2020 15:08:48 +1000 Subject: [PATCH 021/108] Added domain for yujia. --- domains/yujia.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/yujia.json diff --git a/domains/yujia.json b/domains/yujia.json new file mode 100644 index 000000000..4d56109d9 --- /dev/null +++ b/domains/yujia.json @@ -0,0 +1,12 @@ +{ + "description": "Yujia's Magic", + "repo": "https://github.com/YujiaY", + "owner": { + "username": "YujiaY", + "email": "aujackyuan@gmail.com" + }, + "record": { + "CNAME": "YujiaY.github.io", + "URL": "https://yujia.is-a.dev" + } +} \ No newline at end of file From ba56ed7d082e0240bfda6863e50203c5bf561b61 Mon Sep 17 00:00:00 2001 From: Gaurav Tewari <54894783+tewarig@users.noreply.github.com> Date: Fri, 9 Oct 2020 10:38:56 +0530 Subject: [PATCH 022/108] created gaurav.json --- domains/gaurav.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/gaurav.json diff --git a/domains/gaurav.json b/domains/gaurav.json new file mode 100644 index 000000000..4a5f346c0 --- /dev/null +++ b/domains/gaurav.json @@ -0,0 +1,12 @@ +{ + "description": "Gaurav Tewari", + "repo": "https://github.com/tewarig/tewarig.github.io", + "owner": { + "username": "Gaurav", + "email": "gauravtewari111@gmail.com" + }, + "record": { + "CNAME": "tewarig.github.io", + "URL": "https://gaurav.is-a.dev" + } +} From 48b9c1d0f31807ed7d208dd1a015dd59e9211eb7 Mon Sep 17 00:00:00 2001 From: Rwithik Manoj Date: Fri, 9 Oct 2020 10:41:53 +0530 Subject: [PATCH 023/108] Create rwithik.json --- domains/rwithik.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/rwithik.json diff --git a/domains/rwithik.json b/domains/rwithik.json new file mode 100644 index 000000000..6615c5d68 --- /dev/null +++ b/domains/rwithik.json @@ -0,0 +1,12 @@ +{ + "description": "Rwithik's Website", + "repo": "https://github.com/rwithik/rwithik.github.io", + "owner": { + "username": "rwithik", + "email": "rwithik@gmail.com" + }, + "record": { + "CNAME": "rwithik.github.io", + "URL": "https://rwithik.is-a.dev" + } +} From 3f5c90f6823bbe71915971bfcdf91c469937001f Mon Sep 17 00:00:00 2001 From: Shen Junru Date: Fri, 9 Oct 2020 13:14:31 +0800 Subject: [PATCH 024/108] Create shenjunru.json --- domains/shenjunru.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/shenjunru.json diff --git a/domains/shenjunru.json b/domains/shenjunru.json new file mode 100644 index 000000000..d521ea054 --- /dev/null +++ b/domains/shenjunru.json @@ -0,0 +1,12 @@ +{ + "description": "Shen Junru is a Dev", + "repo": "https://github.com/shenjunru/is-a-dev", + "owner": { + "username": "shenjunru", + "email": "shenjunru@gmail.com" + }, + "record": { + "CNAME": "shenjunru.github.io", + "URL": "https://shenjunru.is-a.dev" + } +} From 85ef1398373ecc8369af32297d1fda6c046ce350 Mon Sep 17 00:00:00 2001 From: Akshay Ashok Date: Fri, 9 Oct 2020 11:02:31 +0530 Subject: [PATCH 025/108] Create akshay-ashok.json --- domains/akshay-ashok.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/akshay-ashok.json diff --git a/domains/akshay-ashok.json b/domains/akshay-ashok.json new file mode 100644 index 000000000..132781ef9 --- /dev/null +++ b/domains/akshay-ashok.json @@ -0,0 +1,12 @@ +{ + "description": "Akshay Ashok has a is a dev domain", + "repo": "https://github.com/Akshay090/akshay090.github.io", + "owner": { + "username": "Akshay090", + "email": "aks28id@gmail.com" + }, + "record": { + "CNAME": "akshay090.github.io", + "URL": "https://akshay-ashok.is-a.dev" + } +} From 0c0c5d11ee6986818bd1f8e4f9da08734e7f1048 Mon Sep 17 00:00:00 2001 From: Namitha S Date: Fri, 9 Oct 2020 11:25:43 +0530 Subject: [PATCH 026/108] Create vaskian.json --- domains/vaskian.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/vaskian.json diff --git a/domains/vaskian.json b/domains/vaskian.json new file mode 100644 index 000000000..f3d371e95 --- /dev/null +++ b/domains/vaskian.json @@ -0,0 +1,11 @@ +{ + "description": "Vaskian is a Dev", + "repo": "https://github.com/Nami2012", + "owner": { + "username": "Nami2012", + "email": "namithasadeeshbabu@gmail.com" + }, + "record": { + "URL": "https://vaskian.me/" + } +} From 3b753bd98363ca19f7cb9e6b79595f4c1529adcb Mon Sep 17 00:00:00 2001 From: Reed Jones Date: Thu, 8 Oct 2020 23:03:01 -0700 Subject: [PATCH 027/108] Create reed.json --- domains/reed.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/reed.json diff --git a/domains/reed.json b/domains/reed.json new file mode 100644 index 000000000..5f70ceda1 --- /dev/null +++ b/domains/reed.json @@ -0,0 +1,11 @@ +{ + "repo": "https://github.com/reed-jones", + "owner": { + "username": "reed-jones", + "email": "reedjones@reedjones.com" + }, + "record": { + "CNAME": "reedjones.com", + "URL": "https://reed.is-a.dev" + } +} From ce66d83ffc438d93139c964ab7575bbf81271324 Mon Sep 17 00:00:00 2001 From: Ashish Yadav Date: Fri, 9 Oct 2020 12:03:37 +0545 Subject: [PATCH 028/108] chore: ashish's domain --- domains/ashish.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/ashish.json diff --git a/domains/ashish.json b/domains/ashish.json new file mode 100644 index 000000000..a1d6e2498 --- /dev/null +++ b/domains/ashish.json @@ -0,0 +1,12 @@ +{ + "description": "Ashish's personal developer website", + "repo": "https://github.com/ashiishme", + "owner": { + "username": "ashiishme", + "email": "contact@ashiish.me" + }, + "record": { + "CNAME": "ashiish.me", + "URL": "https://ashish.is-a.dev" + } +} From 38140d4017ca9fafd82acf3ff1849cd4d62dae01 Mon Sep 17 00:00:00 2001 From: Owain Date: Fri, 9 Oct 2020 07:38:06 +0100 Subject: [PATCH 029/108] Create owain.json --- domains/owain.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 domains/owain.json diff --git a/domains/owain.json b/domains/owain.json new file mode 100644 index 000000000..0fcd1d788 --- /dev/null +++ b/domains/owain.json @@ -0,0 +1,10 @@ +{ + "description": "Owain's Website", + "owner": { + "username": "owjothegreat", + "email": "owain.jones74@gmail.com" + }, + "record": { + "URL": "0wain.xyz" + } +} From eb5f44d81ad7160a094b9d0d952aaf2957dc4078 Mon Sep 17 00:00:00 2001 From: Susnata Goswami <55017730+proghead00@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:08:18 +0530 Subject: [PATCH 030/108] Added my .json file --- proghead00.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 proghead00.json diff --git a/proghead00.json b/proghead00.json new file mode 100644 index 000000000..e647ed5d9 --- /dev/null +++ b/proghead00.json @@ -0,0 +1,12 @@ +{ + "description": "Susnata's is.a.dev domain!", + "repo": "https://github.com/proghead00/proghead00.github.io", + "owner": { + "username": "proghead00", + "email": "susnata00@gmail.com" + }, + "record": { + "CNAME": "proghead00.github.io", + "URL": "https://proghead00.is-a.dev" + } +} From 55ea9c3938f75d9777d0491f478fe0d5556b1b9e Mon Sep 17 00:00:00 2001 From: Owain Date: Fri, 9 Oct 2020 07:38:48 +0100 Subject: [PATCH 031/108] add protocol --- domains/owain.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/owain.json b/domains/owain.json index 0fcd1d788..a53081812 100644 --- a/domains/owain.json +++ b/domains/owain.json @@ -5,6 +5,6 @@ "email": "owain.jones74@gmail.com" }, "record": { - "URL": "0wain.xyz" + "URL": "https://0wain.xyz" } } From 0c302a5a0fcec6fbadd1988feff74b7979ef44a2 Mon Sep 17 00:00:00 2001 From: Brandon Hexsel Date: Thu, 8 Oct 2020 23:42:06 -0700 Subject: [PATCH 032/108] 'my website' --- domains/brandon.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/brandon.json diff --git a/domains/brandon.json b/domains/brandon.json new file mode 100644 index 000000000..b533a756a --- /dev/null +++ b/domains/brandon.json @@ -0,0 +1,12 @@ +{ + "description": "Brandons's personal developer website", + "repo": "https://github.com/b-hexsoul", + "owner": { + "username": "b-hexsoul", + "email": "brandon.hexsel@gmail.com" + }, + "record": { + "CNAME": "b-hexsoul.github.io", + "URL": "https://brandon.is-a.dev" + } +} From 08c859c6d8953ee20df9bb2b76c45bc30704b1fd Mon Sep 17 00:00:00 2001 From: Owain Date: Fri, 9 Oct 2020 07:44:49 +0100 Subject: [PATCH 033/108] amendments --- domains/owain.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/domains/owain.json b/domains/owain.json index a53081812..09020668a 100644 --- a/domains/owain.json +++ b/domains/owain.json @@ -5,6 +5,7 @@ "email": "owain.jones74@gmail.com" }, "record": { - "URL": "https://0wain.xyz" + "CNAME": "0wain.xyz", + "URL": "https://owain.is-a.dev" } } From af7ddab06070479dfb35c82186d470dc1d3d8bdc Mon Sep 17 00:00:00 2001 From: Adarsh S <47141299+adarshsuresh07@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:14:59 +0530 Subject: [PATCH 034/108] Create adarshs.json --- domains/adarshs.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/adarshs.json diff --git a/domains/adarshs.json b/domains/adarshs.json new file mode 100644 index 000000000..9d18225cd --- /dev/null +++ b/domains/adarshs.json @@ -0,0 +1,11 @@ +{ + "description": "The portfolio of Adarsh S", + "repo": "https://github.com/adarshsuresh07", + "owner": { + "username": "adarshsuresh07", + "email": "adarshsuresh@cet.ac.in" + }, + "record": { + "URL": "https://adarshs.is-a.dev" + } +} From 8edf6842bc82c25febfabcbd19ef648f1a1a1c9b Mon Sep 17 00:00:00 2001 From: Adarsh S <47141299+adarshsuresh07@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:19:19 +0530 Subject: [PATCH 035/108] Update adarshs.json --- domains/adarshs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/domains/adarshs.json b/domains/adarshs.json index 9d18225cd..47670879b 100644 --- a/domains/adarshs.json +++ b/domains/adarshs.json @@ -6,6 +6,7 @@ "email": "adarshsuresh@cet.ac.in" }, "record": { + "CNAME":"adarshsuresh07.github.io", "URL": "https://adarshs.is-a.dev" } } From 0357a1fc23f5af145323171a3daea874868ae8bf Mon Sep 17 00:00:00 2001 From: aryavinodan <36436909+aryavinodan@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:21:03 +0530 Subject: [PATCH 036/108] Create new file --- domains/arya.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/arya.json diff --git a/domains/arya.json b/domains/arya.json new file mode 100644 index 000000000..2a0d987d2 --- /dev/null +++ b/domains/arya.json @@ -0,0 +1,12 @@ +{ + "description": "Arya Vinodan's Website", + "repo": "", + "owner": { + "username": "aryavinodan2000", + "email": "aryavinodan2000@gmail.com" + }, + "record": { + "CNAME": "aryavinodan2000.github.io", + "URL": "https://andrew.is-a.dev" + } +} From fa406ff856f2cc66eaa41e0087e3e1ac43dc699f Mon Sep 17 00:00:00 2001 From: aryavinodan <36436909+aryavinodan@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:28:39 +0530 Subject: [PATCH 037/108] Updated arya.json --- domains/arya.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domains/arya.json b/domains/arya.json index 2a0d987d2..9384c66ad 100644 --- a/domains/arya.json +++ b/domains/arya.json @@ -1,8 +1,8 @@ { "description": "Arya Vinodan's Website", - "repo": "", + "repo": "aryavinodan/register", "owner": { - "username": "aryavinodan2000", + "username": "aryavinodan", "email": "aryavinodan2000@gmail.com" }, "record": { From bedf5f9904237bf1e27d6ba9c190fe1a7bc86add Mon Sep 17 00:00:00 2001 From: aryavinodan <36436909+aryavinodan@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:39:35 +0530 Subject: [PATCH 038/108] Updated repo --- domains/arya.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/arya.json b/domains/arya.json index 9384c66ad..59f82fb1b 100644 --- a/domains/arya.json +++ b/domains/arya.json @@ -1,6 +1,6 @@ { "description": "Arya Vinodan's Website", - "repo": "aryavinodan/register", + "repo": "https://github.com/aryavinodan", "owner": { "username": "aryavinodan", "email": "aryavinodan2000@gmail.com" From ccaccae3097bf98f7371d791a663b045786b32f5 Mon Sep 17 00:00:00 2001 From: Anoop M S Date: Fri, 9 Oct 2020 12:49:00 +0530 Subject: [PATCH 039/108] Add anoop.json --- domains/anoop.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/anoop.json diff --git a/domains/anoop.json b/domains/anoop.json new file mode 100644 index 000000000..53c1c378c --- /dev/null +++ b/domains/anoop.json @@ -0,0 +1,12 @@ +{ + "description": "Anoop's blog", + "repo": "https://gitlab.com/anoopmsivadas/anoopmsivadas.gitlab.io", + "owner": { + "username": "anoopmsivadas", + "email": "anoopms@disroot.org" + }, + "record": { + "CNAME": "anoopmsivadas.gitlab.io", + "URL": "https://anoop.is-a.dev" + } +} From 20cd478043bd754d60007b9cac805b1fb45e165d Mon Sep 17 00:00:00 2001 From: Abishek PY <43115551+vj-abishek@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:50:23 +0530 Subject: [PATCH 040/108] Create abishek.json --- domains/abishek.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/abishek.json diff --git a/domains/abishek.json b/domains/abishek.json new file mode 100644 index 000000000..3fde17249 --- /dev/null +++ b/domains/abishek.json @@ -0,0 +1,12 @@ +{ + "description": "Abishek's portfolio website", + "repo": "https://github.com/vj-abishek/vj-abishek.github.io", + "owner": { + "username": "vj-abishek", + "email": "abigosearch@gmail.com" + }, + "record": { + "CNAME": "vj-abishek.github.io", + "URL": "https://abishek.is-a.dev" + } +} From 1649403303f0cbeb2ff460d75f2af933eddafbca Mon Sep 17 00:00:00 2001 From: Shibiliya Ismail <50785323+duaboola@users.noreply.github.com> Date: Fri, 9 Oct 2020 12:54:15 +0530 Subject: [PATCH 041/108] Testing --- domains/shibiliya.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/shibiliya.json diff --git a/domains/shibiliya.json b/domains/shibiliya.json new file mode 100644 index 000000000..d6390a4a6 --- /dev/null +++ b/domains/shibiliya.json @@ -0,0 +1,11 @@ +{ + "description": "Shibiliya's personal developer website", + "repo": "https://github.com/duaboola", + "owner": { + "username": "duaboola", + "email": "ismailshibiliya@gmail.com" + }, + "record": { + "ALIAS": "https://duaboola.github.io/ShibiliyaIsmail.github.io/" + } +} From af8fe8059f6c504af35a7830da3415a985ed9240 Mon Sep 17 00:00:00 2001 From: Gautam krishna R Date: Fri, 9 Oct 2020 12:56:07 +0530 Subject: [PATCH 042/108] Added gkr.is-a.dev --- domains/gkr.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 domains/gkr.json diff --git a/domains/gkr.json b/domains/gkr.json new file mode 100644 index 000000000..fed031e3c --- /dev/null +++ b/domains/gkr.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "gautamkrishnar", + "email": "hello@gautamkrishnar.com" + }, + "record": { + "A": ["185.224.138.125"] + } +} From d870ad1931b258a848b195ed6a7dd033704571f4 Mon Sep 17 00:00:00 2001 From: Govind V Shenoy Date: Fri, 9 Oct 2020 13:00:51 +0530 Subject: [PATCH 043/108] added domain govind.is-a.dev --- domains/govind.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/govind.json diff --git a/domains/govind.json b/domains/govind.json new file mode 100644 index 000000000..3073c3601 --- /dev/null +++ b/domains/govind.json @@ -0,0 +1,12 @@ +{ + "description": "Govind's personal developer website", + "repo": "https://github.com/govind-shenoy", + "owner": { + "username": "govind-shenoy", + "email": "govindvshenoy@gmail.com" + }, + "record": { + "CNAME": "govind-shenoy.github.io/", + "URL": "https://govind.is-a.dev" + } +} From db51a3f4902c49cee0a5bef4646cc901c9dbdee8 Mon Sep 17 00:00:00 2001 From: Alex Joseph <31386066+Alec1563@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:03:18 +0530 Subject: [PATCH 044/108] Create alexjoseph.json --- domains/alexjoseph.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/alexjoseph.json diff --git a/domains/alexjoseph.json b/domains/alexjoseph.json new file mode 100644 index 000000000..b6b4d1f5d --- /dev/null +++ b/domains/alexjoseph.json @@ -0,0 +1,12 @@ +{ + "description": "Add some description", + "repo": "https://github.com/alec1563/alec1563.github.io", + "owner": { + "username": "alec1563", + "email": "aj71563@gmail.com" + }, + "record": { + "CNAME": "alec1563.github.io", + "URL": "https://alexjoseph.is-a.dev" + } +} From 4876cac1a1afba79fcb1016d5869f08672ed7f62 Mon Sep 17 00:00:00 2001 From: justinjohnymathew Date: Fri, 9 Oct 2020 13:07:53 +0530 Subject: [PATCH 045/108] added justin.is-a.dev --- domains/justin.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/justin.json diff --git a/domains/justin.json b/domains/justin.json new file mode 100644 index 000000000..6101efb31 --- /dev/null +++ b/domains/justin.json @@ -0,0 +1,12 @@ +{ + "description": "My personal Page", + "repo": "https://github.com/justinjohnymathew/justinjohnymathew.github.io", + "owner": { + "username": "justinjohnymathew", + "email": "justinjohny.jj@gmail.com" + }, + "record": { + "CNAME": "https://justinjohnymathew.github.io/", + "URL": "https://justin.is-a.dev" + } + \ No newline at end of file From 35828c7b92565345fd405d3cc84095e07d05be54 Mon Sep 17 00:00:00 2001 From: Bhadra Jayakumar Sandhya <46893827+BhadraJayakumarSandhya@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:07:54 +0530 Subject: [PATCH 046/108] Create bhadra.json --- domains/bhadra.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 domains/bhadra.json diff --git a/domains/bhadra.json b/domains/bhadra.json new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/domains/bhadra.json @@ -0,0 +1 @@ + From 081668b6ec1e1cf0004909f55e47fec727597a0a Mon Sep 17 00:00:00 2001 From: Bhadra Jayakumar Sandhya <46893827+BhadraJayakumarSandhya@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:14:46 +0530 Subject: [PATCH 047/108] Update bhadra.json --- domains/bhadra.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/domains/bhadra.json b/domains/bhadra.json index 8b1378917..69b9a8fd1 100644 --- a/domains/bhadra.json +++ b/domains/bhadra.json @@ -1 +1,12 @@ - +{ + "description": "Personal Website", + "repo": "https://github.com/BhadraJayakumarSandhya/BhadraJayakumarSandhya.github.io", + "owner": { + "username": "BhadraJayakumarSandhya", + "email": "tomjerryparu@gmail.com" + }, + "record": { + "CNAME": "BhadraJayakumarSandhya.github.io", + "URL": "https://bhadra.is-a.dev" + } +} From 70a256568441f7d9669e0ec8e05ed4f4a2515026 Mon Sep 17 00:00:00 2001 From: Alex Joseph <31386066+Alec1563@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:16:22 +0530 Subject: [PATCH 048/108] Update alexjoseph.json --- domains/alexjoseph.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/domains/alexjoseph.json b/domains/alexjoseph.json index b6b4d1f5d..27f3853b0 100644 --- a/domains/alexjoseph.json +++ b/domains/alexjoseph.json @@ -1,12 +1,12 @@ { - "description": "Add some description", - "repo": "https://github.com/alec1563/alec1563.github.io", + "description": "This is my first githib page", + "repo": "https://github.com/alec1563/alexjoseph.github.io", "owner": { "username": "alec1563", "email": "aj71563@gmail.com" }, "record": { - "CNAME": "alec1563.github.io", + "CNAME": "alexjoseph.github.io", "URL": "https://alexjoseph.is-a.dev" } } From ecb2be7a381f72930f37a6424a3b6ed50aaa1083 Mon Sep 17 00:00:00 2001 From: Alex Joseph <31386066+Alec1563@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:21:12 +0530 Subject: [PATCH 049/108] Update alexjoseph.json --- domains/alexjoseph.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/alexjoseph.json b/domains/alexjoseph.json index 27f3853b0..9b5d4c0d3 100644 --- a/domains/alexjoseph.json +++ b/domains/alexjoseph.json @@ -6,7 +6,7 @@ "email": "aj71563@gmail.com" }, "record": { - "CNAME": "alexjoseph.github.io", + "CNAME": "alec1563.github.io/alexjoseph.github.io", "URL": "https://alexjoseph.is-a.dev" } } From 53a4a25ecd0183557eb2acaa767418ce77ffb9dc Mon Sep 17 00:00:00 2001 From: "F. Kiss" Date: Fri, 9 Oct 2020 09:51:55 +0200 Subject: [PATCH 050/108] Create kiss.json --- domains/kiss.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 domains/kiss.json diff --git a/domains/kiss.json b/domains/kiss.json new file mode 100644 index 000000000..9f04710c2 --- /dev/null +++ b/domains/kiss.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "filipekiss", + "email": "filipe@kiss.ink" + }, + "record": { + "CNAME": "filipe.kiss.ink", + "URL": "https://kiss.is-a.dev" + } +} From 00d62b80b9910c7fefdb084dbe58686e8cc281db Mon Sep 17 00:00:00 2001 From: Alex Joseph <31386066+Alec1563@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:28:14 +0530 Subject: [PATCH 051/108] Update alexjoseph.json --- domains/alexjoseph.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/alexjoseph.json b/domains/alexjoseph.json index 9b5d4c0d3..f6335eae7 100644 --- a/domains/alexjoseph.json +++ b/domains/alexjoseph.json @@ -6,7 +6,7 @@ "email": "aj71563@gmail.com" }, "record": { - "CNAME": "alec1563.github.io/alexjoseph.github.io", + "CNAME": "https://alec1563.github.io/alexjoseph.github.io/", "URL": "https://alexjoseph.is-a.dev" } } From 69dd89e57eb36697592ba44ae7711bbd92a9001d Mon Sep 17 00:00:00 2001 From: Shibiliya Ismail <50785323+duaboola@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:35:57 +0530 Subject: [PATCH 052/108] Update shibiliya.json --- domains/shibiliya.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/domains/shibiliya.json b/domains/shibiliya.json index d6390a4a6..12a349f9f 100644 --- a/domains/shibiliya.json +++ b/domains/shibiliya.json @@ -6,6 +6,7 @@ "email": "ismailshibiliya@gmail.com" }, "record": { - "ALIAS": "https://duaboola.github.io/ShibiliyaIsmail.github.io/" + "CNAME": "duaboola.github.io", + "URL": "https://ShibiliyaIsmail.is-a.dev" } } From 1fa42fec8219c51702f2c942a4baf77d348ea59a Mon Sep 17 00:00:00 2001 From: Steven Frohlich Date: Fri, 9 Oct 2020 10:18:13 +0200 Subject: [PATCH 053/108] Create steven.json --- domains/steven.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/steven.json diff --git a/domains/steven.json b/domains/steven.json new file mode 100644 index 000000000..1e798e941 --- /dev/null +++ b/domains/steven.json @@ -0,0 +1,12 @@ +{ + "description": "Steven Frohlich's portfolio", + "repo": "https://github.com/StevenRonnyFrohlich/StevenRonnyFrohlich.github.io", + "owner": { + "username": "StevenRonnyFrohlich", + "email": "steve.r.frohlich@gmail.com" + }, + "record": { + "CNAME": "StevenRonnyFrohlich.github.io", + "URL": "https://steven.is-a.dev" + } +} From a692dedf7f5e825626f91d900b72eacb66d4d703 Mon Sep 17 00:00:00 2001 From: Gokul Kp Date: Fri, 9 Oct 2020 14:19:52 +0530 Subject: [PATCH 054/108] Create gokuldskp.json --- domains/gokuldskp.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/gokuldskp.json diff --git a/domains/gokuldskp.json b/domains/gokuldskp.json new file mode 100644 index 000000000..c6f5eb241 --- /dev/null +++ b/domains/gokuldskp.json @@ -0,0 +1,12 @@ +{ + "description": "Personal Page", + "repo": "https://github.com/gkdskp/gkdskp.github.io", + "owner": { + "username": "gkdskp", + "email": "gokuldskp@gmail.com" + }, + "record": { + "CNAME": "gkdskp.github.io", + "URL": "https://gokuldskp.is-a.dev" + } +} From b8a5720b90056b106990416b1f1cd880fdaf9522 Mon Sep 17 00:00:00 2001 From: Alestor Aldous <51041424+alestor123@users.noreply.github.com> Date: Fri, 9 Oct 2020 14:30:21 +0530 Subject: [PATCH 055/108] Added my json --- domains/alestor123.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 domains/alestor123.json diff --git a/domains/alestor123.json b/domains/alestor123.json new file mode 100644 index 000000000..7fef3325e --- /dev/null +++ b/domains/alestor123.json @@ -0,0 +1,12 @@ +{ + "description": "A Mortal Web Developer With Immortal Dreams", + "repo": "https://github.com/alestor123/alestor123.github.io", + "owner": { + "username": "alestor123", + "email": "alestoraldous@gmail.com" + }, + "record": { + "CNAME": "http://alestor123.github.io/", + "URL": "https://alestor123.is-a.dev" + } +} From f06ecfdf408981faa1d53df90720e8b9e5b71c6a Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 16:56:29 +0530 Subject: [PATCH 056/108] Fixes eric.json --- domains/eric.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/eric.json b/domains/eric.json index 2ef78034f..ab4967530 100644 --- a/domains/eric.json +++ b/domains/eric.json @@ -3,7 +3,7 @@ "repo": "https://github.com/yurrriq", "owner": { "username": "yurrriq", - "email": "eric@ericb.me", + "email": "eric@ericb.me" }, "record": { "CNAME": "yurrriq.github.io", From 208b9e74d98961e01a427aabd96fafaf02ea06d2 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 17:36:36 +0530 Subject: [PATCH 057/108] Adds ref for checkout --- .github/workflows/checks.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e8519241f..02a8dafee 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} - uses: borales/actions-yarn@v2.0.0 with: cmd: install From b64a56c5237d4368200c1ebcabf0eeb305ff3679 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 17:58:13 +0530 Subject: [PATCH 058/108] changes checks.yml --- .github/workflows/checks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 02a8dafee..214dbdbb0 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,7 +10,8 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} - - uses: borales/actions-yarn@v2.0.0 + - name: Installing dependencies + uses: borales/actions-yarn@v2.0.0 with: cmd: install - name: Running tests From 926df0f5d8d9a94cfc0a912de8545427a0326819 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 18:11:36 +0530 Subject: [PATCH 059/108] Update ezedinff.json --- domains/ezedinff.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/ezedinff.json b/domains/ezedinff.json index 6e61aad08..8a10dd6df 100644 --- a/domains/ezedinff.json +++ b/domains/ezedinff.json @@ -6,7 +6,7 @@ "email": "ezedin.fedlu@gmail.com" }, "record": { - "CNAME": "https://black-horse-coder-blog.vercel.app/", + "CNAME": "black-horse-coder-blog.vercel.app", "URL": "https://ezedin.is-a.dev" } } From f2037ae03d18cae0bd762c8d5311e3ce859dbf75 Mon Sep 17 00:00:00 2001 From: Daggron Date: Fri, 9 Oct 2020 19:05:09 +0530 Subject: [PATCH 060/108] fix(abhay.json): updated the URL --- domains/abhay.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/abhay.json b/domains/abhay.json index 55d695f56..02777b5d9 100644 --- a/domains/abhay.json +++ b/domains/abhay.json @@ -7,6 +7,6 @@ }, "record": { "CNAME": "codeinator.me", - "URL": "http://codeinator.me" + "URL": "http://abhay.is-a.dev" } } \ No newline at end of file From 54f9581a83f6273b5faccdc320ef4627e9d3f18d Mon Sep 17 00:00:00 2001 From: Daggron Date: Fri, 9 Oct 2020 19:06:31 +0530 Subject: [PATCH 061/108] fix: pointing to https --- domains/abhay.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/abhay.json b/domains/abhay.json index 02777b5d9..1e722675c 100644 --- a/domains/abhay.json +++ b/domains/abhay.json @@ -7,6 +7,6 @@ }, "record": { "CNAME": "codeinator.me", - "URL": "http://abhay.is-a.dev" + "URL": "https://abhay.is-a.dev" } } \ No newline at end of file From 6a53237ad927b02c0c360e92a7b8ed468ad384e1 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 19:26:17 +0530 Subject: [PATCH 062/108] testing fetch-depth: 0 for ci --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 214dbdbb0..ecdd66f53 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,6 +10,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} + fetch-depth: 0 - name: Installing dependencies uses: borales/actions-yarn@v2.0.0 with: From 1aed2a3804250b7c8a8a6484621052b05be77fa8 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 20:07:23 +0530 Subject: [PATCH 063/108] removes fetch-depth --- .github/workflows/checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ecdd66f53..214dbdbb0 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,7 +10,6 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} - fetch-depth: 0 - name: Installing dependencies uses: borales/actions-yarn@v2.0.0 with: From bcc9a2db86cac55569f344c3ea1123d60cd8426b Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 9 Oct 2020 20:08:18 +0530 Subject: [PATCH 064/108] Update jacob.json --- domains/jacob.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/jacob.json b/domains/jacob.json index 0ea327a3a..230214cee 100644 --- a/domains/jacob.json +++ b/domains/jacob.json @@ -7,6 +7,6 @@ }, "record": { "CNAME": "jacob13400.github.io", - "URL": "https://your-domain.is-a.dev" + "URL": "https://jacob.is-a.dev" } } From 20ce20e9c41f61fcdecc7105f0ad6bb00a20e5e5 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 20:15:28 +0530 Subject: [PATCH 065/108] fetch-depth set again --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 214dbdbb0..ecdd66f53 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,6 +10,7 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} + fetch-depth: 0 - name: Installing dependencies uses: borales/actions-yarn@v2.0.0 with: From b5a1bd5c248f725987ca497d1dc72f7eed4a1b79 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 20:46:01 +0530 Subject: [PATCH 066/108] Adds repo field to checkout --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ecdd66f53..56be78630 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,6 +9,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + repository: ${{ github.repository }} ref: ${{ github.head_ref }} fetch-depth: 0 - name: Installing dependencies From 1b0a157201cd85258f2d9a4bd77f88d6b892cbae Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 20:56:57 +0530 Subject: [PATCH 067/108] Add pr head commit for validation --- .github/workflows/checks.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 56be78630..6ff9fe1cd 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,8 +9,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - repository: ${{ github.repository }} - ref: ${{ github.head_ref }} + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Installing dependencies uses: borales/actions-yarn@v2.0.0 From d74f37a870e916588152c197c3c907e2849e09c0 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 22:06:51 +0530 Subject: [PATCH 068/108] Update domains/arya.json --- domains/arya.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/arya.json b/domains/arya.json index 59f82fb1b..7510a71e2 100644 --- a/domains/arya.json +++ b/domains/arya.json @@ -7,6 +7,6 @@ }, "record": { "CNAME": "aryavinodan2000.github.io", - "URL": "https://andrew.is-a.dev" + "URL": "https://arya.is-a.dev" } } From 22f58b67f43dacb4871ec746736eca3b1646806b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 22:19:50 +0530 Subject: [PATCH 069/108] Update domains/shibiliya.json --- domains/shibiliya.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/shibiliya.json b/domains/shibiliya.json index 12a349f9f..4c3104986 100644 --- a/domains/shibiliya.json +++ b/domains/shibiliya.json @@ -7,6 +7,6 @@ }, "record": { "CNAME": "duaboola.github.io", - "URL": "https://ShibiliyaIsmail.is-a.dev" + "URL": "https://shibiliya.is-a.dev" } } From 58152cc1cb60d686a19bd59f0c14744eeec582a2 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 22:20:59 +0530 Subject: [PATCH 070/108] Update domains/govind.json --- domains/govind.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/govind.json b/domains/govind.json index 3073c3601..32732a21d 100644 --- a/domains/govind.json +++ b/domains/govind.json @@ -6,7 +6,7 @@ "email": "govindvshenoy@gmail.com" }, "record": { - "CNAME": "govind-shenoy.github.io/", + "CNAME": "govind-shenoy.github.io", "URL": "https://govind.is-a.dev" } } From 35c1a59cc873a80679c4edb685c51e8f01583a3b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 22:27:36 +0530 Subject: [PATCH 071/108] Update domains/alexjoseph.json --- domains/alexjoseph.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/alexjoseph.json b/domains/alexjoseph.json index f6335eae7..27f3853b0 100644 --- a/domains/alexjoseph.json +++ b/domains/alexjoseph.json @@ -6,7 +6,7 @@ "email": "aj71563@gmail.com" }, "record": { - "CNAME": "https://alec1563.github.io/alexjoseph.github.io/", + "CNAME": "alexjoseph.github.io", "URL": "https://alexjoseph.is-a.dev" } } From a26e3c6d7bc520b73f05460c1c1326dc943ecfa8 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 22:31:52 +0530 Subject: [PATCH 072/108] Update domains/justin.json --- domains/justin.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domains/justin.json b/domains/justin.json index 6101efb31..33969d7fb 100644 --- a/domains/justin.json +++ b/domains/justin.json @@ -6,7 +6,7 @@ "email": "justinjohny.jj@gmail.com" }, "record": { - "CNAME": "https://justinjohnymathew.github.io/", + "CNAME": "justinjohnymathew.github.io", "URL": "https://justin.is-a.dev" } - \ No newline at end of file + From 4c00d0e85ed45283c1c2e27b35f505b21fb19acd Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 22:33:46 +0530 Subject: [PATCH 073/108] Update justin.json --- domains/justin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/justin.json b/domains/justin.json index 33969d7fb..c2fb26afa 100644 --- a/domains/justin.json +++ b/domains/justin.json @@ -9,4 +9,4 @@ "CNAME": "justinjohnymathew.github.io", "URL": "https://justin.is-a.dev" } - +} From 334649ad7bf5a6ebdbb866beb5d7f34bc16de5c1 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 9 Oct 2020 22:54:32 +0530 Subject: [PATCH 074/108] moves json file to domains --- proghead00.json => domains/proghead00.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename proghead00.json => domains/proghead00.json (100%) diff --git a/proghead00.json b/domains/proghead00.json similarity index 100% rename from proghead00.json rename to domains/proghead00.json From f399bac708e737102a063247cc694507d54842d1 Mon Sep 17 00:00:00 2001 From: Dan Habot Date: Fri, 9 Oct 2020 13:38:43 -0400 Subject: [PATCH 075/108] whoops --- domains/{dan-habot.is-a.dev => dan-habot.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename domains/{dan-habot.is-a.dev => dan-habot.json} (100%) diff --git a/domains/dan-habot.is-a.dev b/domains/dan-habot.json similarity index 100% rename from domains/dan-habot.is-a.dev rename to domains/dan-habot.json From 8da557537e943250dff0d7e61b05d574ae21b254 Mon Sep 17 00:00:00 2001 From: Alex Joseph <31386066+Alec1563@users.noreply.github.com> Date: Sat, 10 Oct 2020 01:48:02 +0530 Subject: [PATCH 076/108] Update alexjoseph.json --- domains/alexjoseph.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domains/alexjoseph.json b/domains/alexjoseph.json index 27f3853b0..ba70eab3a 100644 --- a/domains/alexjoseph.json +++ b/domains/alexjoseph.json @@ -1,12 +1,12 @@ { "description": "This is my first githib page", - "repo": "https://github.com/alec1563/alexjoseph.github.io", + "repo": "https://github.com/Alec1563/alec1563.github.io", "owner": { "username": "alec1563", "email": "aj71563@gmail.com" }, "record": { - "CNAME": "alexjoseph.github.io", + "CNAME": "alec1563.github.io", "URL": "https://alexjoseph.is-a.dev" } } From 135772a6bb2ebe60d3da1e0ff8a20b763507cc3f Mon Sep 17 00:00:00 2001 From: Alex Joseph <31386066+alexkjoseph@users.noreply.github.com> Date: Sat, 10 Oct 2020 01:53:55 +0530 Subject: [PATCH 077/108] Update alexjoseph.json --- domains/alexjoseph.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/domains/alexjoseph.json b/domains/alexjoseph.json index ba70eab3a..01c7cc49e 100644 --- a/domains/alexjoseph.json +++ b/domains/alexjoseph.json @@ -1,12 +1,12 @@ { "description": "This is my first githib page", - "repo": "https://github.com/Alec1563/alec1563.github.io", + "repo": "https://github.com/alexkjoseph/alexkjoseph.github.io", "owner": { - "username": "alec1563", + "username": "alexkjoseph", "email": "aj71563@gmail.com" }, "record": { - "CNAME": "alec1563.github.io", + "CNAME": "alexkjoseph.github.io", "URL": "https://alexjoseph.is-a.dev" } } From 4212a8e408dc149e0cf45b7098f13692263fb531 Mon Sep 17 00:00:00 2001 From: Gokul Kp Date: Sat, 10 Oct 2020 09:25:47 +0530 Subject: [PATCH 078/108] Update and rename gokuldskp.json to gokul.json --- domains/{gokuldskp.json => gokul.json} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename domains/{gokuldskp.json => gokul.json} (84%) diff --git a/domains/gokuldskp.json b/domains/gokul.json similarity index 84% rename from domains/gokuldskp.json rename to domains/gokul.json index c6f5eb241..7032658d2 100644 --- a/domains/gokuldskp.json +++ b/domains/gokul.json @@ -7,6 +7,6 @@ }, "record": { "CNAME": "gkdskp.github.io", - "URL": "https://gokuldskp.is-a.dev" + "URL": "https://gokul.is-a.dev" } } From dd09370217e3ebf28729a6da80a647db69cfcc41 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 11:38:01 +0530 Subject: [PATCH 079/108] Removes extra records --- domains/abhishek.json | 12 ------------ domains/adarshs.json | 12 ------------ domains/anoop.json | 12 ------------ domains/arya.json | 12 ------------ domains/ashish.json | 12 ------------ domains/bhadra.json | 12 ------------ domains/brandon.json | 12 ------------ domains/govind.json | 12 ------------ domains/proghead00.json | 12 ------------ domains/shibiliya.json | 12 ------------ 10 files changed, 120 deletions(-) delete mode 100644 domains/abhishek.json delete mode 100644 domains/adarshs.json delete mode 100644 domains/anoop.json delete mode 100644 domains/arya.json delete mode 100644 domains/ashish.json delete mode 100644 domains/bhadra.json delete mode 100644 domains/brandon.json delete mode 100644 domains/govind.json delete mode 100644 domains/proghead00.json delete mode 100644 domains/shibiliya.json diff --git a/domains/abhishek.json b/domains/abhishek.json deleted file mode 100644 index 22545cd82..000000000 --- a/domains/abhishek.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Abhishek's personal website", - "repo": "https://github.com/nullpointxr", - "owner": { - "username": "nullpointxr", - "email": "abhishek.sankar.in@protonmail.com" - }, - "record": { - "CNAME": "nullpointxr.github.io", - "URL": "https://abhishek.is-a.dev" - } -} diff --git a/domains/adarshs.json b/domains/adarshs.json deleted file mode 100644 index 47670879b..000000000 --- a/domains/adarshs.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "The portfolio of Adarsh S", - "repo": "https://github.com/adarshsuresh07", - "owner": { - "username": "adarshsuresh07", - "email": "adarshsuresh@cet.ac.in" - }, - "record": { - "CNAME":"adarshsuresh07.github.io", - "URL": "https://adarshs.is-a.dev" - } -} diff --git a/domains/anoop.json b/domains/anoop.json deleted file mode 100644 index 53c1c378c..000000000 --- a/domains/anoop.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Anoop's blog", - "repo": "https://gitlab.com/anoopmsivadas/anoopmsivadas.gitlab.io", - "owner": { - "username": "anoopmsivadas", - "email": "anoopms@disroot.org" - }, - "record": { - "CNAME": "anoopmsivadas.gitlab.io", - "URL": "https://anoop.is-a.dev" - } -} diff --git a/domains/arya.json b/domains/arya.json deleted file mode 100644 index 7510a71e2..000000000 --- a/domains/arya.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Arya Vinodan's Website", - "repo": "https://github.com/aryavinodan", - "owner": { - "username": "aryavinodan", - "email": "aryavinodan2000@gmail.com" - }, - "record": { - "CNAME": "aryavinodan2000.github.io", - "URL": "https://arya.is-a.dev" - } -} diff --git a/domains/ashish.json b/domains/ashish.json deleted file mode 100644 index a1d6e2498..000000000 --- a/domains/ashish.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Ashish's personal developer website", - "repo": "https://github.com/ashiishme", - "owner": { - "username": "ashiishme", - "email": "contact@ashiish.me" - }, - "record": { - "CNAME": "ashiish.me", - "URL": "https://ashish.is-a.dev" - } -} diff --git a/domains/bhadra.json b/domains/bhadra.json deleted file mode 100644 index 69b9a8fd1..000000000 --- a/domains/bhadra.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Personal Website", - "repo": "https://github.com/BhadraJayakumarSandhya/BhadraJayakumarSandhya.github.io", - "owner": { - "username": "BhadraJayakumarSandhya", - "email": "tomjerryparu@gmail.com" - }, - "record": { - "CNAME": "BhadraJayakumarSandhya.github.io", - "URL": "https://bhadra.is-a.dev" - } -} diff --git a/domains/brandon.json b/domains/brandon.json deleted file mode 100644 index b533a756a..000000000 --- a/domains/brandon.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Brandons's personal developer website", - "repo": "https://github.com/b-hexsoul", - "owner": { - "username": "b-hexsoul", - "email": "brandon.hexsel@gmail.com" - }, - "record": { - "CNAME": "b-hexsoul.github.io", - "URL": "https://brandon.is-a.dev" - } -} diff --git a/domains/govind.json b/domains/govind.json deleted file mode 100644 index 32732a21d..000000000 --- a/domains/govind.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Govind's personal developer website", - "repo": "https://github.com/govind-shenoy", - "owner": { - "username": "govind-shenoy", - "email": "govindvshenoy@gmail.com" - }, - "record": { - "CNAME": "govind-shenoy.github.io", - "URL": "https://govind.is-a.dev" - } -} diff --git a/domains/proghead00.json b/domains/proghead00.json deleted file mode 100644 index e647ed5d9..000000000 --- a/domains/proghead00.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Susnata's is.a.dev domain!", - "repo": "https://github.com/proghead00/proghead00.github.io", - "owner": { - "username": "proghead00", - "email": "susnata00@gmail.com" - }, - "record": { - "CNAME": "proghead00.github.io", - "URL": "https://proghead00.is-a.dev" - } -} diff --git a/domains/shibiliya.json b/domains/shibiliya.json deleted file mode 100644 index 4c3104986..000000000 --- a/domains/shibiliya.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "description": "Shibiliya's personal developer website", - "repo": "https://github.com/duaboola", - "owner": { - "username": "duaboola", - "email": "ismailshibiliya@gmail.com" - }, - "record": { - "CNAME": "duaboola.github.io", - "URL": "https://shibiliya.is-a.dev" - } -} From 3befd0707df10a7801046cba391edc98ad2afd3a Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 11:39:32 +0530 Subject: [PATCH 080/108] Revert "moves json file to domains" This reverts commit 334649ad7bf5a6ebdbb866beb5d7f34bc16de5c1. --- proghead00.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 proghead00.json diff --git a/proghead00.json b/proghead00.json new file mode 100644 index 000000000..e647ed5d9 --- /dev/null +++ b/proghead00.json @@ -0,0 +1,12 @@ +{ + "description": "Susnata's is.a.dev domain!", + "repo": "https://github.com/proghead00/proghead00.github.io", + "owner": { + "username": "proghead00", + "email": "susnata00@gmail.com" + }, + "record": { + "CNAME": "proghead00.github.io", + "URL": "https://proghead00.is-a.dev" + } +} From 4105ba1129597604663a6f021b9f9d46ded94041 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 11:39:53 +0530 Subject: [PATCH 081/108] Moves proghead00 to domains directory --- proghead00.json => domains/proghead00.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename proghead00.json => domains/proghead00.json (100%) diff --git a/proghead00.json b/domains/proghead00.json similarity index 100% rename from proghead00.json rename to domains/proghead00.json From addf748158ab77831124dc26b93742470d9ec6cc Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 14:41:07 +0530 Subject: [PATCH 082/108] Adds cpanel util --- tests/cpanel.test.js | 88 ++++++++++++++++++++++++++++++++++++++++++++ utils/lib/cpanel.js | 59 +++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 tests/cpanel.test.js create mode 100644 utils/lib/cpanel.js diff --git a/tests/cpanel.test.js b/tests/cpanel.test.js new file mode 100644 index 000000000..29d4606fb --- /dev/null +++ b/tests/cpanel.test.js @@ -0,0 +1,88 @@ +const R = require('ramda'); +const { CpanelClient } = require('../utils/lib/cpanel'); + +const mockFetch = (expectRequest, decorate = R.identity) => (reqUrl, request) => { + expectRequest(reqUrl, request); + return Promise.resolve({ + json: async () => decorate(request), + }); +}; + +describe('Cpanel client', () => { + describe('fetchzonerecords', () => { + it('should make the correct request', async () => { + const fetch = mockFetch((url, request) => { + expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=is-a.dev&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); + expect(request).toEqual({ + headers: { + Authorization: 'cpanel boy:boybyebye', + }, + rejectUnauthorized: false, + }); + }); + + const cpanel = CpanelClient({ + host: 'example.com', + port: 2000, + username: 'boy', + apiKey: 'boybyebye', + dependencies: { fetch }, + }); + + await cpanel.fetchZoneRecords(); + }); + + it('should make the correct request with query', async () => { + const fetch = mockFetch((url, request) => { + expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=foobar.boeey&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); + expect(request).toEqual({ + headers: { + Authorization: 'cpanel boy:boybyebye', + }, + rejectUnauthorized: false, + }); + }); + + const cpanel = CpanelClient({ + host: 'example.com', + port: 2000, + username: 'boy', + apiKey: 'boybyebye', + dependencies: { fetch }, + }); + + await cpanel.fetchZoneRecords({ domain: 'foobar.boeey' }); + }); + }); + + describe('addzonerecord', () => { + it('should make the correct request', async () => { + const fetch = mockFetch((url, request) => { + expect(url).toBe('https://example.com:2000//json-api/cpanel?domain=is-a.dev&name=googo&type=CNAME&cname=beey&ttl=2020&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_apiversion=2'); + expect(request).toEqual({ + headers: { + Authorization: 'cpanel boy:boybyebye', + }, + rejectUnauthorized: false, + }); + }); + + const cpanel = CpanelClient({ + host: 'example.com', + port: 2000, + username: 'boy', + apiKey: 'boybyebye', + dependencies: { fetch }, + }); + + await cpanel.addZoneRecord({ + name: 'googo', + type: 'boyee', + cname: 'beey', + type: 'CNAME', + ttl: 2020, + }); + }); + }); +}); + diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js new file mode 100644 index 000000000..cadca4d4b --- /dev/null +++ b/utils/lib/cpanel.js @@ -0,0 +1,59 @@ +const R = require('ramda'); +const fetch = require('node-fetch'); +const qs = require('qs'); +const { DOMAIN_API_HOST, DOMAIN_API_PORT, DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DOMAIN } = require('../constants'); + +const CpanelClient = (options) => { + const api = (module, func, defaultQuery = {}) => (q = {}) => { + const query = { + ...defaultQuery, + ...q, + cpanel_jsonapi_user: options.username, + cpanel_jsonapi_module: module, + cpanel_jsonapi_func: func, + cpanel_jsonapi_apiversion: 2, + }; + + const request = { + headers: { + Authorization: `cpanel ${options.username}:${options.apiKey}`, + }, + rejectUnauthorized: false, + }; + + const path = `${options.path || '/json-api'}/cpanel?${qs.stringify(query)}`; + const reqUrl = `https://${options.host}:${options.port}/${path}`; + + const { fetch } = options.dependencies; + return fetch(reqUrl, request).then(res => res.json()); + }; + + return { + // { customonly, domain } + // -> { cpanelresult: { data[{ class, ttl, name, line, Line, cname, type, record }] } } + fetchZoneRecords: api('ZoneEdit', 'fetchzone_records', { customonly: 1, domain: options.domain }), + // { domain, name, type, cname, address, ttl } + // -> { result: { status } } + addZoneRecord: api('ZoneEdit', 'add_zone_record', { domain: options.domain }), + }; +}; + +if (!DOMAIN_API_KEY) { + console.error('Api key cannot be empty'); + process.exit(1); +} + +const cpanel = CpanelClient({ + host: DOMAIN_API_HOST, + port: DOMAIN_API_PORT, + username: DOMAIN_USER, + apiKey: DOMAIN_API_KEY, + domain: DOMAIN_DOMAIN, + dependencies: { fetch }, +}); + +module.exports = { + cpanel, + CpanelClient, +}; + From c20f6d767308fe491e088b936b702448df5d1215 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 15:20:02 +0530 Subject: [PATCH 083/108] Fixes cpanel test cases and constants --- tests/cpanel.test.js | 7 +++++-- utils/constants.js | 15 ++++++++------- utils/lib/cpanel.js | 3 ++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/cpanel.test.js b/tests/cpanel.test.js index 29d4606fb..083a09e17 100644 --- a/tests/cpanel.test.js +++ b/tests/cpanel.test.js @@ -12,7 +12,7 @@ describe('Cpanel client', () => { describe('fetchzonerecords', () => { it('should make the correct request', async () => { const fetch = mockFetch((url, request) => { - expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=is-a.dev&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); + expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=a.b&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); expect(request).toEqual({ headers: { Authorization: 'cpanel boy:boybyebye', @@ -26,6 +26,7 @@ describe('Cpanel client', () => { port: 2000, username: 'boy', apiKey: 'boybyebye', + domain: 'a.b', dependencies: { fetch }, }); @@ -48,6 +49,7 @@ describe('Cpanel client', () => { port: 2000, username: 'boy', apiKey: 'boybyebye', + domain: 'a.b', dependencies: { fetch }, }); @@ -58,7 +60,7 @@ describe('Cpanel client', () => { describe('addzonerecord', () => { it('should make the correct request', async () => { const fetch = mockFetch((url, request) => { - expect(url).toBe('https://example.com:2000//json-api/cpanel?domain=is-a.dev&name=googo&type=CNAME&cname=beey&ttl=2020&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_apiversion=2'); + expect(url).toBe('https://example.com:2000//json-api/cpanel?domain=a.b&name=googo&type=CNAME&cname=beey&ttl=2020&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_apiversion=2'); expect(request).toEqual({ headers: { Authorization: 'cpanel boy:boybyebye', @@ -72,6 +74,7 @@ describe('Cpanel client', () => { port: 2000, username: 'boy', apiKey: 'boybyebye', + domain: 'a.b', dependencies: { fetch }, }); diff --git a/utils/constants.js b/utils/constants.js index 89a9b627f..bc7643150 100644 --- a/utils/constants.js +++ b/utils/constants.js @@ -1,21 +1,22 @@ const path = require('path'); -const { ENV = 'sandbox', CI } = process.env; +const { ENV = 'test', CI } = process.env; if (!CI) { require('dotenv').config({ path: path.resolve(`.env.${ENV}`) }); } -const { NC_USER, NC_API_KEY, NC_DOMAIN, IP_ADDRESS } = process.env; +const { DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DOMAIN, DOMAIN_API_HOST, DOMAIN_API_PORT } = process.env; const IS_TEST = ENV === 'test'; module.exports = { ENV, VALID_RECORD_TYPES: ['CNAME', 'A', 'ALIAS', 'URL'], - NC_DOMAIN: NC_DOMAIN || 'booboo.xyz', - NC_USER: IS_TEST ? 'testuser' : NC_USER, - NC_API_KEY: IS_TEST ? 'testkey' : NC_API_KEY, - IP_ADDRESS, - TTL: 5*60, + DOMAIN_DOMAIN: DOMAIN_DOMAIN || 'booboo.xyz', + DOMAIN_USER: IS_TEST ? 'testuser' : DOMAIN_USER, + DOMAIN_API_KEY: IS_TEST ? 'testkey' : DOMAIN_API_KEY, + DOMAIN_API_HOST: IS_TEST ? 'example.com' : DOMAIN_API_HOST, + DOMAIN_API_PORT: IS_TEST ? 6969 : DOMAIN_API_PORT, + TTL: 5*60, // TODO: Increase ttl }; diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js index cadca4d4b..cc19e2233 100644 --- a/utils/lib/cpanel.js +++ b/utils/lib/cpanel.js @@ -1,9 +1,10 @@ const R = require('ramda'); const fetch = require('node-fetch'); const qs = require('qs'); -const { DOMAIN_API_HOST, DOMAIN_API_PORT, DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DOMAIN } = require('../constants'); +const { DOMAIN_API_HOST, DOMAIN_API_PORT, DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DOMAIN, ...c } = require('../constants'); const CpanelClient = (options) => { + // TODO: Make defaultQuery functional const api = (module, func, defaultQuery = {}) => (q = {}) => { const query = { ...defaultQuery, From 79b46ef8b5c44cbf3a72b47c62ec823f8797ff52 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 15:21:15 +0530 Subject: [PATCH 084/108] Changes example env config --- .env | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.env b/.env index f87d42da0..26270e769 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ -NC_USER=xxx -NC_API_KEY=xxxxxxxxxxxxxxx -NC_DOMAIN=domain.com -IP_ADDRESS=100.100.100.100 +DOMAIN_USER=username +DOMAIN_API_KEY=apikey +DOMAIN_API_HOST=api-example.com +DOMAIN_API_PORT=2087 +DOMAIN_DOMAIN=example.com From 28c0f7301a03e5b67b52188d2fdf5eb89b1a95b6 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 16:27:47 +0530 Subject: [PATCH 085/108] Refactors some of domain service with fetch records and add record --- package.json | 2 +- tests/domain-service.test.js | 39 ++++++++++++++++++------------------ tests/register.test.js | 1 + utils/domain-service.js | 30 +++++++-------------------- utils/lib/cpanel.js | 7 ++++++- yarn.lock | 10 ++++----- 6 files changed, 39 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index e7f7277a1..055959d8c 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "author": "Akshay Nair ", "license": "GPL-3.0", "dependencies": { - "@rqt/namecheap": "^2.4.2", "dotenv": "^8.2.0", "jest": "^26.4.2", + "node-fetch": "^2.6.1", "ramda": "^0.27.1" } } diff --git a/tests/domain-service.test.js b/tests/domain-service.test.js index 08e49e9b6..87b09319d 100644 --- a/tests/domain-service.test.js +++ b/tests/domain-service.test.js @@ -1,27 +1,25 @@ const R = require('ramda'); const { getDomainService } = require('../utils/domain-service'); -const getNc = ({ onSet, onGet } = {}) => ({ - dns: { - setHosts: (_, list) => onSet(list), - getHosts: (_) => onGet(), - }, +const getCpanel = ({ onSet, onGet } = {}) => ({ + addZoneRecord: (host) => onSet(host), + fetchZoneRecords: (_) => onGet(), }); describe('Domain service', () => { describe('getHosts', () => { it('should resolve with a list of hosts', async () => { const hosts = [ - { Name: 'xx', Type: 'CNAME', Address: 'fck.com.' }, - { Name: 'xx', Type: 'A', Address: '111.1.1212.1' }, + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xx', type: 'A', address: '111.1.1212.1' }, ]; - const onGet = async () => ({ hosts }) - const mockDomainService = getDomainService({ nc: getNc({ onGet }) }); + const onGet = async () => hosts; + const mockDomainService = getDomainService({ cpanel: getCpanel({ onGet }) }); const list = await mockDomainService.getHosts(); expect(list).toEqual([ - { HostName: 'xx', RecordType: 'CNAME', Address: 'fck.com' }, - { HostName: 'xx', RecordType: 'A', Address: '111.1.1212.1' }, + { name: 'xx', type: 'CNAME', address: 'fck.com' }, + { name: 'xx', type: 'A', address: '111.1.1212.1' }, ]); }); }); @@ -30,17 +28,18 @@ describe('Domain service', () => { it('should resolve with a list of hosts', async () => { const records = [ { x: 'y' }, { z: 'a' } ]; - const onSet = jest.fn((list) => { - expect(list).toBe(records); - return Promise.resolve(null); - }); + const onSet = jest.fn(async () => {}); - const mockDomainService = getDomainService({ nc: getNc({ onSet }) }); + const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet }) }); await mockDomainService.setHosts(records); - expect(onSet).toBeCalledTimes(1); + + expect(onSet).toBeCalledTimes(2); + expect(onSet.mock.calls.map(R.head)).toEqual([ { x: 'y' }, { z: 'a' } ]); }); }); + return; + describe('updateHosts', () => { it('should append new hosts with existing ones and set it', async () => { const records = [ @@ -51,7 +50,7 @@ describe('Domain service', () => { const onGet = () => Promise.resolve({ hosts: records }); const onSet = jest.fn(async () => ({})); - const mockDomainService = getDomainService({ nc: getNc({ onSet, onGet }) }); + const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet, onGet }) }); await mockDomainService.updateHosts([ { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, { HostName: 'b', RecordType: 'CNAME', Address: 'goo' }, @@ -76,7 +75,7 @@ describe('Domain service', () => { const onGet = () => Promise.resolve({ hosts: records }); const onSet = jest.fn(async () => ({})); - const mockDomainService = getDomainService({ nc: getNc({ onSet, onGet }) }); + const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet, onGet }) }); await mockDomainService.updateHosts([ { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, { HostName: 'b', RecordType: 'CNAME', Address: 'googoogaga' }, @@ -100,7 +99,7 @@ describe('Domain service', () => { const onGet = () => Promise.resolve({ hosts: records }); const onSet = jest.fn(async () => ({})); - const mockDomainService = getDomainService({ nc: getNc({ onSet, onGet }) }); + const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet, onGet }) }); await mockDomainService.updateHosts([ { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, { HostName: 'b', RecordType: 'CNAME', Address: 'googoogaga' }, diff --git a/tests/register.test.js b/tests/register.test.js index 23d1ffd43..8a24e0dec 100644 --- a/tests/register.test.js +++ b/tests/register.test.js @@ -28,6 +28,7 @@ describe('toHostList', () => { }); describe('registerDomains', () => { + return; it('should register the new set of hosts generated from domains list', async () => { const localHosts = [ { name: 'a', record: { CNAME: 'hello' } }, diff --git a/utils/domain-service.js b/utils/domain-service.js index 0831f3cb2..391705937 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -1,29 +1,25 @@ const R = require('ramda'); -const Namecheap = require('@rqt/namecheap'); -const { NC_DOMAIN, NC_USER, NC_API_KEY, ENV, IP_ADDRESS } = require('../utils/constants'); +const { cpanel } = require('./lib/cpanel'); -const IS_SANDBOX = ENV === 'sandbox'; +const flattenPromise = xs => Promise.all(xs); -const getDomainService = ({ nc }) => { +const getDomainService = ({ cpanel }) => { let hostList = []; const getHosts = async () => { if (hostList.length) return hostList; - const list = await nc.dns.getHosts(NC_DOMAIN) - .then(R.propOr([], 'hosts')) + const list = await cpanel.fetchZoneRecords() .then(R.map(host => R.omit(['Name', 'Type'], { ...host, - HostName: host.Name, - RecordType: host.Type, - Address: `${host.Address}`.replace(/\.$/g, ''), + address: `${host.cname || host.address}`.replace(/\.$/g, ''), }))); hostList = list; return list; }; - const setHosts = hosts => nc.dns.setHosts(NC_DOMAIN, hosts); + const setHosts = R.compose(flattenPromise, R.map(cpanel.addZoneRecord)); const getHostKey = host => `${host.HostName}--${host.RecordType}`; const toHostMap = hosts => hosts.reduce((acc, host) => { @@ -52,19 +48,7 @@ const getDomainService = ({ nc }) => { return { getHosts, setHosts, updateHosts }; }; -if (!NC_API_KEY) { - console.error('NC_API_KEY cannot be empty'); - process.exit(1); -} - -const nc = new Namecheap({ - user: NC_USER, - key: NC_API_KEY, - ip: IP_ADDRESS, - sandbox: IS_SANDBOX, -}); - -const domainService = getDomainService({ nc }); +const domainService = getDomainService({ cpanel }); module.exports = { getDomainService, diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js index cc19e2233..ac5620424 100644 --- a/utils/lib/cpanel.js +++ b/utils/lib/cpanel.js @@ -32,7 +32,10 @@ const CpanelClient = (options) => { return { // { customonly, domain } // -> { cpanelresult: { data[{ class, ttl, name, line, Line, cname, type, record }] } } - fetchZoneRecords: api('ZoneEdit', 'fetchzone_records', { customonly: 1, domain: options.domain }), + fetchZoneRecords: R.compose( + p => p.then(R.pathOr([], ['cpanelresult', 'data'])), + api('ZoneEdit', 'fetchzone_records', { customonly: 1, domain: options.domain }) + ), // { domain, name, type, cname, address, ttl } // -> { result: { status } } addZoneRecord: api('ZoneEdit', 'add_zone_record', { domain: options.domain }), @@ -53,6 +56,8 @@ const cpanel = CpanelClient({ dependencies: { fetch }, }); +// cpanel.fetchZoneRecords().then(hosts => console.log(JSON.stringify(hosts, null, 2))); + module.exports = { cpanel, CpanelClient, diff --git a/yarn.lock b/yarn.lock index 2cb029d01..fb8f6f11e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -458,11 +458,6 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@rqt/namecheap@^2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@rqt/namecheap/-/namecheap-2.4.2.tgz#8537eea6efbe7ac4fd449e3aee5f2c1d80986fcf" - integrity sha512-RfrK7ywOraz0nR/BlQt8fJQDcOfI9cLSTpa6l9JS9ER0HJ6t1FQ8Pxmplj/lVQv8rkczuVADdZVC3HlL98Q31w== - "@sinonjs/commons@^1.7.0": version "1.8.1" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217" @@ -2468,6 +2463,11 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" From fa9ad8baef2aec7f087ef062d1f14a21343baeef Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 17:33:26 +0530 Subject: [PATCH 086/108] Adds redirection api for cpanel (via uapi) + refactors cpanel --- tests/cpanel.test.js | 6 +++--- utils/lib/cpanel.js | 35 +++++++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/tests/cpanel.test.js b/tests/cpanel.test.js index 083a09e17..a32c562cf 100644 --- a/tests/cpanel.test.js +++ b/tests/cpanel.test.js @@ -12,7 +12,7 @@ describe('Cpanel client', () => { describe('fetchzonerecords', () => { it('should make the correct request', async () => { const fetch = mockFetch((url, request) => { - expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=a.b&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); + expect(url).toBe('https://example.com:2000/json-api/cpanel?customonly=1&domain=a.b&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); expect(request).toEqual({ headers: { Authorization: 'cpanel boy:boybyebye', @@ -35,7 +35,7 @@ describe('Cpanel client', () => { it('should make the correct request with query', async () => { const fetch = mockFetch((url, request) => { - expect(url).toBe('https://example.com:2000//json-api/cpanel?customonly=1&domain=foobar.boeey&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); + expect(url).toBe('https://example.com:2000/json-api/cpanel?customonly=1&domain=foobar.boeey&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); expect(request).toEqual({ headers: { Authorization: 'cpanel boy:boybyebye', @@ -60,7 +60,7 @@ describe('Cpanel client', () => { describe('addzonerecord', () => { it('should make the correct request', async () => { const fetch = mockFetch((url, request) => { - expect(url).toBe('https://example.com:2000//json-api/cpanel?domain=a.b&name=googo&type=CNAME&cname=beey&ttl=2020&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_apiversion=2'); + expect(url).toBe('https://example.com:2000/json-api/cpanel?domain=a.b&name=googo&type=CNAME&cname=beey&ttl=2020&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_apiversion=2'); expect(request).toEqual({ headers: { Authorization: 'cpanel boy:boybyebye', diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js index ac5620424..f075e035b 100644 --- a/utils/lib/cpanel.js +++ b/utils/lib/cpanel.js @@ -5,7 +5,7 @@ const { DOMAIN_API_HOST, DOMAIN_API_PORT, DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DO const CpanelClient = (options) => { // TODO: Make defaultQuery functional - const api = (module, func, defaultQuery = {}) => (q = {}) => { + const api = ({ basePath = '', action = '' }) => (module, func, defaultQuery = {}) => (q = {}) => { const query = { ...defaultQuery, ...q, @@ -22,23 +22,36 @@ const CpanelClient = (options) => { rejectUnauthorized: false, }; - const path = `${options.path || '/json-api'}/cpanel?${qs.stringify(query)}`; + const path = `${basePath}/${action}?${qs.stringify(query)}`; const reqUrl = `https://${options.host}:${options.port}/${path}`; const { fetch } = options.dependencies; return fetch(reqUrl, request).then(res => res.json()); }; + const api2 = api({ basePath: 'json-api', action: 'cpanel' }); + const uapi = (module, func, defaultQuery) => + api({ basePath: 'execute', action: `${module}/${func}` })(module, func, defaultQuery); + return { // { customonly, domain } // -> { cpanelresult: { data[{ class, ttl, name, line, Line, cname, type, record }] } } fetchZoneRecords: R.compose( p => p.then(R.pathOr([], ['cpanelresult', 'data'])), - api('ZoneEdit', 'fetchzone_records', { customonly: 1, domain: options.domain }) + api2('ZoneEdit', 'fetchzone_records', { customonly: 1, domain: options.domain }) ), - // { domain, name, type, cname, address, ttl } + + // { domain, name, type(A|CNAME), cname, address, ttl } // -> { result: { status } } - addZoneRecord: api('ZoneEdit', 'add_zone_record', { domain: options.domain }), + addZoneRecord: api2('ZoneEdit', 'add_zone_record', { domain: options.domain }), + + // { domain, redirect, type(permanent|tmp), redirect_wildcard(0|1), redirect(0|1|2) } + // -> {} + addRedirection: uapi('Mime', 'add_redirect'), + + // {} + // -> { } + fetchRedirections: uapi('Mime', 'list_redirects'), }; }; @@ -56,7 +69,17 @@ const cpanel = CpanelClient({ dependencies: { fetch }, }); -// cpanel.fetchZoneRecords().then(hosts => console.log(JSON.stringify(hosts, null, 2))); +//cpanel.fetchZoneRecords() +//cpanel.addRedirection({ + //domain: 'hello.is-a.dev', + //redirect: 'https://googole.com', + //type: 'permanent', + //redirect_wildcard: 1, + //redirect_www: 0, +//}) +//cpanel.fetchRedirections() + //.then(d => console.log(JSON.stringify(d, null, 2))) + //.catch(console.error); module.exports = { cpanel, From 49e8dd7fd0a69eb432301ae69b7bf2bf92f7dad3 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 17:50:29 +0530 Subject: [PATCH 087/108] Aggregates fetching of records from zone and redirections --- tests/domain-service.test.js | 60 ++++++++++++++++++++++++++---------- utils/domain-service.js | 20 +++++++++--- utils/lib/cpanel.js | 5 ++- 3 files changed, 62 insertions(+), 23 deletions(-) diff --git a/tests/domain-service.test.js b/tests/domain-service.test.js index 87b09319d..85992fc91 100644 --- a/tests/domain-service.test.js +++ b/tests/domain-service.test.js @@ -1,20 +1,24 @@ const R = require('ramda'); const { getDomainService } = require('../utils/domain-service'); -const getCpanel = ({ onSet, onGet } = {}) => ({ - addZoneRecord: (host) => onSet(host), - fetchZoneRecords: (_) => onGet(), +const getCpanel = ({ zone, redir, setZone, setRedir } = {}) => ({ + addZoneRecord: (host) => setZone(host), + addRedirection: (_) => setRedir(), + fetchZoneRecords: (_) => zone(), + fetchRedirections: (_) => redir(), }); describe('Domain service', () => { describe('getHosts', () => { it('should resolve with a list of hosts', async () => { - const hosts = [ + const zones = [ { name: 'xx', type: 'CNAME', address: 'fck.com.' }, { name: 'xx', type: 'A', address: '111.1.1212.1' }, ]; - const onGet = async () => hosts; - const mockDomainService = getDomainService({ cpanel: getCpanel({ onGet }) }); + const redirections = []; + const zone = async () => zones; + const redir = async () => redirections; + const mockDomainService = getDomainService({ cpanel: getCpanel({ zone, redir }) }); const list = await mockDomainService.getHosts(); expect(list).toEqual([ @@ -22,23 +26,45 @@ describe('Domain service', () => { { name: 'xx', type: 'A', address: '111.1.1212.1' }, ]); }); - }); - describe('setHosts', () => { - it('should resolve with a list of hosts', async () => { - const records = [ { x: 'y' }, { z: 'a' } ]; + it('should resolve with a redirections', async () => { + const zones = [ + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xx', type: 'A', address: '111.1.1212.1' }, + ]; + const redirections = [ + { domain: 'foo.booboo.xyz', destination: 'https://google.com' }, + { domain: 'foo1.booboo.xyz', destination: 'https://duck.com' }, + ]; + const zone = async () => zones; + const redir = async () => redirections; + const mockDomainService = getDomainService({ cpanel: getCpanel({ zone, redir }) }); + const list = await mockDomainService.getHosts(); - const onSet = jest.fn(async () => {}); - - const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet }) }); - await mockDomainService.setHosts(records); - - expect(onSet).toBeCalledTimes(2); - expect(onSet.mock.calls.map(R.head)).toEqual([ { x: 'y' }, { z: 'a' } ]); + expect(list).toEqual([ + { name: 'xx', type: 'CNAME', address: 'fck.com' }, + { name: 'xx', type: 'A', address: '111.1.1212.1' }, + { name: 'foo', type: 'URL', address: 'https://google.com' }, + { name: 'foo1', type: 'URL', address: 'https://duck.com' }, + ]); }); }); return; + describe('setHosts', () => { + it('should resolve with a list of hosts', async () => { + const records = [ { x: 'y' }, { z: 'a' } ]; + + const setZone = jest.fn(async () => {}); + + const mockDomainService = getDomainService({ cpanel: getCpanel({ setZone }) }); + await mockDomainService.setHosts(records); + + expect(setZone).toBeCalledTimes(2); + expect(setZone.mock.calls.map(R.head)).toEqual([ { x: 'y' }, { z: 'a' } ]); + }); + }); + describe('updateHosts', () => { it('should append new hosts with existing ones and set it', async () => { diff --git a/utils/domain-service.js b/utils/domain-service.js index 391705937..d71cac3f1 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -1,19 +1,29 @@ const R = require('ramda'); const { cpanel } = require('./lib/cpanel'); +const {DOMAIN_DOMAIN} = require('./constants'); const flattenPromise = xs => Promise.all(xs); const getDomainService = ({ cpanel }) => { let hostList = []; + const fetchZoneRecords = () => cpanel.fetchZoneRecords().then(R.map(host => ({ + ...host, + name: `${host.name}`, + type: `${host.type}`, + address: `${host.cname || host.address}`.replace(/\.$/g, ''), + }))); + + const fetchRedirections = () => cpanel.fetchRedirections().then(R.map(host => ({ + name: `${host.domain}`.replace('.' + DOMAIN_DOMAIN, ''), + type: 'URL', + address: `${host.destination}`, + }))); + const getHosts = async () => { if (hostList.length) return hostList; - const list = await cpanel.fetchZoneRecords() - .then(R.map(host => R.omit(['Name', 'Type'], { - ...host, - address: `${host.cname || host.address}`.replace(/\.$/g, ''), - }))); + const list = await Promise.all([fetchZoneRecords(), fetchRedirections()]).then(R.flatten); hostList = list; return list; diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js index f075e035b..2da03c2a3 100644 --- a/utils/lib/cpanel.js +++ b/utils/lib/cpanel.js @@ -51,7 +51,10 @@ const CpanelClient = (options) => { // {} // -> { } - fetchRedirections: uapi('Mime', 'list_redirects'), + fetchRedirections: R.compose( + p => p.then(R.pathOr([], ['data'])), + uapi('Mime', 'list_redirects'), + ), }; }; From c63e8c4562438e0df5f3532991e96f34d8a92e48 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 18:08:37 +0530 Subject: [PATCH 088/108] Aggregates setting zone changes to server --- tests/domain-service.test.js | 38 +++++++++++++++++++++++++++------ utils/domain-service.js | 41 +++++++++++++++++++++++++----------- utils/lib/cpanel.js | 12 +++++------ 3 files changed, 67 insertions(+), 24 deletions(-) diff --git a/tests/domain-service.test.js b/tests/domain-service.test.js index 85992fc91..dd814737d 100644 --- a/tests/domain-service.test.js +++ b/tests/domain-service.test.js @@ -2,8 +2,8 @@ const R = require('ramda'); const { getDomainService } = require('../utils/domain-service'); const getCpanel = ({ zone, redir, setZone, setRedir } = {}) => ({ - addZoneRecord: (host) => setZone(host), - addRedirection: (_) => setRedir(), + addZoneRecord: (rec) => setZone(rec), + addRedirection: (rec) => setRedir(rec), fetchZoneRecords: (_) => zone(), fetchRedirections: (_) => redir(), }); @@ -50,21 +50,47 @@ describe('Domain service', () => { }); }); - return; describe('setHosts', () => { it('should resolve with a list of hosts', async () => { - const records = [ { x: 'y' }, { z: 'a' } ]; + const records = [ + { name: 'xx', type: 'CNAME', address: 'fck.com' }, + { name: 'xx', type: 'A', address: '111.1.1212.1' }, + { name: 'foo', type: 'URL', address: 'https://google.com' }, + { name: 'foo1', type: 'URL', address: 'https://duck.com' }, + ]; const setZone = jest.fn(async () => {}); + const setRedir = jest.fn(async () => {}); - const mockDomainService = getDomainService({ cpanel: getCpanel({ setZone }) }); + const mockDomainService = getDomainService({ cpanel: getCpanel({ setZone, setRedir }) }); await mockDomainService.setHosts(records); expect(setZone).toBeCalledTimes(2); - expect(setZone.mock.calls.map(R.head)).toEqual([ { x: 'y' }, { z: 'a' } ]); + expect(setRedir).toBeCalledTimes(2); + expect(setZone.mock.calls.map(R.head)).toEqual([ + { name: 'xx', type: 'CNAME', address: 'fck.com' }, + { name: 'xx', type: 'A', address: '111.1.1212.1' }, + ]); + expect(setRedir.mock.calls.map(R.head)).toEqual([ + { + domain: 'foo.booboo.xyz', + redirect: 'https://google.com', + redirect_wildcard: 1, + redirect_www: 0, + type: 'permanent', + }, + { + domain: 'foo1.booboo.xyz', + redirect: 'https://duck.com', + redirect_wildcard: 1, + redirect_www: 0, + type: 'permanent', + }, + ]); }); }); + return; describe('updateHosts', () => { it('should append new hosts with existing ones and set it', async () => { diff --git a/utils/domain-service.js b/utils/domain-service.js index d71cac3f1..c4e520b6d 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -4,21 +4,35 @@ const {DOMAIN_DOMAIN} = require('./constants'); const flattenPromise = xs => Promise.all(xs); +const recordToRedirection = ({ name, address }) => ({ + domain: `${name}.${DOMAIN_DOMAIN}`, + redirect: address, + type: 'permanent', + redirect_wildcard: 1, + redirect_www: 0, +}); +const recordToZone = R.identity; + +const zoneToRecord = ({ name, type, cname, address, ...host }) => ({ + ...host, + name: `${name}`, + type: `${type}`, + address: `${cname || address}`.replace(/\.$/g, ''), +}); +const redirectionToRecord = ({ domain, destination }) => ({ + name: `${domain}`.replace('.' + DOMAIN_DOMAIN, ''), + type: 'URL', + address: `${destination}`, +}); + const getDomainService = ({ cpanel }) => { let hostList = []; - const fetchZoneRecords = () => cpanel.fetchZoneRecords().then(R.map(host => ({ - ...host, - name: `${host.name}`, - type: `${host.type}`, - address: `${host.cname || host.address}`.replace(/\.$/g, ''), - }))); + const fetchZoneRecords = () => cpanel.fetchZoneRecords().then(R.map(zoneToRecord)); + const fetchRedirections = () => cpanel.fetchRedirections().then(R.map(redirectionToRecord)); - const fetchRedirections = () => cpanel.fetchRedirections().then(R.map(host => ({ - name: `${host.domain}`.replace('.' + DOMAIN_DOMAIN, ''), - type: 'URL', - address: `${host.destination}`, - }))); + const addZoneRecord = R.compose(cpanel.addZoneRecord, recordToZone); + const addRedirection = R.compose(cpanel.addRedirection, recordToRedirection); const getHosts = async () => { if (hostList.length) return hostList; @@ -29,7 +43,10 @@ const getDomainService = ({ cpanel }) => { return list; }; - const setHosts = R.compose(flattenPromise, R.map(cpanel.addZoneRecord)); + const setHosts = R.compose(flattenPromise, R.map(R.cond([ + [ R.propEq('type', 'URL'), addRedirection ], + [ R.T, addZoneRecord ], + ]))); const getHostKey = host => `${host.HostName}--${host.RecordType}`; const toHostMap = hosts => hosts.reduce((acc, host) => { diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js index 2da03c2a3..0c575fa2c 100644 --- a/utils/lib/cpanel.js +++ b/utils/lib/cpanel.js @@ -42,19 +42,19 @@ const CpanelClient = (options) => { ), // { domain, name, type(A|CNAME), cname, address, ttl } - // -> { result: { status } } + // -> {} addZoneRecord: api2('ZoneEdit', 'add_zone_record', { domain: options.domain }), - // { domain, redirect, type(permanent|tmp), redirect_wildcard(0|1), redirect(0|1|2) } - // -> {} - addRedirection: uapi('Mime', 'add_redirect'), - // {} - // -> { } + // -> { domain, destination } fetchRedirections: R.compose( p => p.then(R.pathOr([], ['data'])), uapi('Mime', 'list_redirects'), ), + + // { domain, redirect, type(permanent|tmp), redirect_wildcard(0|1), redirect(0|1|2) } + // -> {} + addRedirection: uapi('Mime', 'add_redirect'), }; }; From fea85040cebf9391277807fa44dc1e9798add2e1 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 19:51:55 +0530 Subject: [PATCH 089/108] Adds records diffing function with test --- tests/domain-service.test.js | 157 +++++++++++++++++++++++++---------- utils/domain-service.js | 40 +++++++-- 2 files changed, 148 insertions(+), 49 deletions(-) diff --git a/tests/domain-service.test.js b/tests/domain-service.test.js index dd814737d..46c5a06d8 100644 --- a/tests/domain-service.test.js +++ b/tests/domain-service.test.js @@ -1,5 +1,5 @@ const R = require('ramda'); -const { getDomainService } = require('../utils/domain-service'); +const { getDomainService, diffRecords } = require('../utils/domain-service'); const getCpanel = ({ zone, redir, setZone, setRedir } = {}) => ({ addZoneRecord: (rec) => setZone(rec), @@ -8,7 +8,85 @@ const getCpanel = ({ zone, redir, setZone, setRedir } = {}) => ({ fetchRedirections: (_) => redir(), }); +describe('diffRecords', () => { + it('should show added record', () => { + const oldRecords = [ + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xa', type: 'A', address: '111.1.1212.1' }, + ]; + const newRecords = [ + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xa', type: 'A', address: '111.1.1212.1' }, + { name: 'boo', type: 'CNAME', address: 'x.com' }, + ]; + + const result = diffRecords(oldRecords, newRecords); + expect(result).toEqual({ + edit: [], + add: [ + { name: 'boo', type: 'CNAME', address: 'x.com' }, + ], + }); + }); + + it('should show edited records', () => { + const oldRecords = [ + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xa', type: 'A', address: '111.1.1212.1' }, + ]; + const newRecords = [ + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xa', type: 'A', address: '69.69.69.69' }, + ]; + + const result = diffRecords(oldRecords, newRecords); + expect(result).toEqual({ + edit: [ + { name: 'xa', type: 'A', address: '69.69.69.69' }, + ], + add: [], + }); + }); + + it('should show added records with the same name and record type', () => { + const oldRecords = [ + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xa', type: 'A', address: '69.69.69.69' }, + ]; + const newRecords = [ + { name: 'xx', type: 'CNAME', address: 'fck.com.' }, + { name: 'xa', type: 'A', address: '69.69.69.69' }, + { name: 'xa', type: 'A', address: '69.69.4.20' }, + ]; + + const result = diffRecords(oldRecords, newRecords); + expect(result).toEqual({ + edit: [], + add: [ + { name: 'xa', type: 'A', address: '69.69.4.20' }, + ], + }); + }); +}); + describe('Domain service', () => { + const setZone = jest.fn(async () => ({})); + const setRedir = jest.fn(async () => ({})); + + const mockDS = ({ zones, redirections }) => getDomainService({ cpanel: getCpanel({ + zone: async () => ({ hosts: zones }), + redir: async () => ({ hosts: redirections }), + setZone, + setRedir, + }) }); + + const getZoneCalls = () => setZone.mock.calls.map(R.head).map(R.pick(['name', 'type', 'address'])); + + beforeEach(() => { + setZone.mockClear(); + setRedir.mockClear(); + }); + describe('getHosts', () => { it('should resolve with a list of hosts', async () => { const zones = [ @@ -90,62 +168,55 @@ describe('Domain service', () => { }); }); - return; - describe('updateHosts', () => { + return; + it('should append new hosts with existing ones and set it', async () => { - const records = [ - { HostId: 1, Name: 'a', Type: 'CNAME', Address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'goo' }, + const zones = [ + { HostId: 1, name: 'a', type: 'CNAME', address: 'boo' }, + { HostId: 2, name: 'b', type: 'CNAME', address: 'goo' }, ]; + const redirections = []; - const onGet = () => Promise.resolve({ hosts: records }); - const onSet = jest.fn(async () => ({})); - - const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet, onGet }) }); + const mockDomainService = mockDS({ zones, redirections });; await mockDomainService.updateHosts([ - { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'goo' }, - { HostName: 'c', RecordType: 'A', Address: '12.131321.213' }, + { name: 'a', type: 'CNAME', address: 'boo' }, + { name: 'b', type: 'CNAME', address: 'goo' }, + { name: 'c', type: 'A', address: '12.131321.213' }, ]); - const [hosts] = onSet.mock.calls[0]; - - expect(hosts.map(R.pick(['HostName', 'RecordType', 'Address']))).toEqual([ - { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'goo' }, - { HostName: 'c', RecordType: 'A', Address: '12.131321.213' }, + expect(setZone).toBeCalledTimes(1); + expect(getZoneCalls()).toEqual([ + { name: 'c', type: 'A', address: '12.131321.213' }, ]); }); it('should update matching host and set it', async () => { - const records = [ - { HostId: 1, Name: 'a', Type: 'CNAME', Address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'goo' }, + const zones = [ + { HostId: 1, Name: 'a', Type: 'CNAME', address: 'boo' }, + { HostId: 2, Name: 'b', Type: 'CNAME', address: 'goo' }, ]; + const redirections = []; - const onGet = () => Promise.resolve({ hosts: records }); - const onSet = jest.fn(async () => ({})); - - const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet, onGet }) }); + const mockDomainService = mockDS({ zones, redirections });; await mockDomainService.updateHosts([ - { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'googoogaga' }, + { name: 'a', type: 'CNAME', address: 'boo' }, + { name: 'b', type: 'CNAME', address: 'googoogaga' }, ]); - const [hosts] = onSet.mock.calls[0]; - - expect(hosts.map(R.pick(['HostName', 'RecordType', 'Address']))).toEqual([ - { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'googoogaga' }, + expect(setZone).toBeCalledTimes(2); + expect(getZoneCalls()).toEqual([ + { name: 'a', type: 'CNAME', address: 'boo' }, + { name: 'b', type: 'CNAME', address: 'googoogaga' }, ]); }); + return; it('should update matching host and set it', async () => { const records = [ - { HostId: 1, Name: 'a', Type: 'CNAME', Address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'goo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'xaa' }, + { HostId: 1, Name: 'a', Type: 'CNAME', address: 'boo' }, + { HostId: 2, Name: 'b', Type: 'CNAME', address: 'goo' }, + { HostId: 2, Name: 'b', Type: 'CNAME', address: 'xaa' }, ]; const onGet = () => Promise.resolve({ hosts: records }); @@ -153,17 +224,17 @@ describe('Domain service', () => { const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet, onGet }) }); await mockDomainService.updateHosts([ - { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'googoogaga' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'farboo' }, + { name: 'a', type: 'CNAME', address: 'boo' }, + { name: 'b', type: 'CNAME', address: 'googoogaga' }, + { name: 'b', type: 'CNAME', address: 'farboo' }, ]); const [hosts] = onSet.mock.calls[0]; - expect(hosts.map(R.pick(['HostName', 'RecordType', 'Address']))).toEqual([ - { HostName: 'a', RecordType: 'CNAME', Address: 'boo' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'googoogaga' }, - { HostName: 'b', RecordType: 'CNAME', Address: 'farboo' }, + expect(hosts.map(R.pick(['name', 'type', 'address']))).toEqual([ + { name: 'a', type: 'CNAME', address: 'boo' }, + { name: 'b', type: 'CNAME', address: 'googoogaga' }, + { name: 'b', type: 'CNAME', address: 'farboo' }, ]); }); }); diff --git a/utils/domain-service.js b/utils/domain-service.js index c4e520b6d..0c6964ae8 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -25,6 +25,13 @@ const redirectionToRecord = ({ domain, destination }) => ({ address: `${destination}`, }); +const getHostKey = host => `${host.name}##${host.type}`; + +const toHostMap = hosts => hosts.reduce((acc, host) => { + const key = getHostKey(host); + return { ...acc, [key]: [ ...(acc[key] || []), host ] }; +}, {}); + const getDomainService = ({ cpanel }) => { let hostList = []; @@ -48,12 +55,6 @@ const getDomainService = ({ cpanel }) => { [ R.T, addZoneRecord ], ]))); - const getHostKey = host => `${host.HostName}--${host.RecordType}`; - const toHostMap = hosts => hosts.reduce((acc, host) => { - const key = getHostKey(host); - return { ...acc, [key]: [ ...(acc[key] || []), host ] }; - }, {}); - const updateHosts = async hosts => { const hostList = await getHosts(); const remoteHostMap = toHostMap(hostList); @@ -75,9 +76,36 @@ const getDomainService = ({ cpanel }) => { return { getHosts, setHosts, updateHosts }; }; +const diffRecords = (oldRecords, newRecords) => { + const remoteHostMap = toHostMap(oldRecords); + const localHostMap = toHostMap(newRecords); + + return R.toPairs(localHostMap).reduce((acc, [key, local]) => { + const remote = remoteHostMap[key]; + + if (remote) { + let adds = []; + let edits = []; + + const diff = R.differenceWith((a, b) => a.address === b.address, local, remote); + + if (diff.length === local.length - remote.length) { + adds = diff; + } else { + edits = diff; + } + + return { ...acc, add: acc.add.concat(adds), edit: acc.edit.concat(edits) }; + } + + return { ...acc, add: acc.add.concat(local) }; + }, { add: [], edit: [] }); +}; + const domainService = getDomainService({ cpanel }); module.exports = { getDomainService, domainService, + diffRecords, }; From 281f88ea5f4a3a0bc7d89199fe4b12dafcfda297 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 21:56:29 +0530 Subject: [PATCH 090/108] Adds simple diffing for records + updateRecords --- tests/domain-service.test.js | 104 +++++++++++++++++++---------------- utils/domain-service.js | 86 ++++++++++++++--------------- utils/lib/cpanel.js | 44 +++++++++------ 3 files changed, 124 insertions(+), 110 deletions(-) diff --git a/tests/domain-service.test.js b/tests/domain-service.test.js index 46c5a06d8..fe74c6ec5 100644 --- a/tests/domain-service.test.js +++ b/tests/domain-service.test.js @@ -1,14 +1,22 @@ const R = require('ramda'); const { getDomainService, diffRecords } = require('../utils/domain-service'); +const {DOMAIN_DOMAIN} = require('../utils/constants'); -const getCpanel = ({ zone, redir, setZone, setRedir } = {}) => ({ - addZoneRecord: (rec) => setZone(rec), - addRedirection: (rec) => setRedir(rec), - fetchZoneRecords: (_) => zone(), - fetchRedirections: (_) => redir(), +const getCpanel = ({ zone, addZone, editZone, redir, addRedir, editRedir } = {}) => ({ + zone: { + fetch: (_) => zone(), + add: (rec) => addZone(rec), + edit: (rec) => editZone(rec), + }, + redirection: { + fetch: (_) => redir(), + add: (rec) => addRedir(rec), + edit: (rec) => editZone(rec), + }, }); describe('diffRecords', () => { + return; it('should show added record', () => { const oldRecords = [ { name: 'xx', type: 'CNAME', address: 'fck.com.' }, @@ -70,21 +78,28 @@ describe('diffRecords', () => { }); describe('Domain service', () => { - const setZone = jest.fn(async () => ({})); - const setRedir = jest.fn(async () => ({})); + const addZone = jest.fn(async () => ({})); + const editZone = jest.fn(async () => ({})); + const addRedir = jest.fn(async () => ({})); + const editRedir = jest.fn(async () => ({})); const mockDS = ({ zones, redirections }) => getDomainService({ cpanel: getCpanel({ - zone: async () => ({ hosts: zones }), - redir: async () => ({ hosts: redirections }), - setZone, - setRedir, + zone: async () => zones, + redir: async () => redirections, + addZone, + addRedir, + editZone, + editRedir, }) }); - const getZoneCalls = () => setZone.mock.calls.map(R.head).map(R.pick(['name', 'type', 'address'])); + const getRecordCalls = recfn => recfn.mock.calls.map(R.head).map(R.pick(['name', 'type', 'address'])); + const getZoneCalls = () => getRecordCalls(addZone); beforeEach(() => { - setZone.mockClear(); - setRedir.mockClear(); + addZone.mockClear(); + editZone.mockClear(); + addRedir.mockClear(); + editRedir.mockClear(); }); describe('getHosts', () => { @@ -137,19 +152,19 @@ describe('Domain service', () => { { name: 'foo1', type: 'URL', address: 'https://duck.com' }, ]; - const setZone = jest.fn(async () => {}); - const setRedir = jest.fn(async () => {}); + const addZone = jest.fn(async () => {}); + const addRedir = jest.fn(async () => {}); - const mockDomainService = getDomainService({ cpanel: getCpanel({ setZone, setRedir }) }); + const mockDomainService = getDomainService({ cpanel: getCpanel({ addZone, addRedir }) }); await mockDomainService.setHosts(records); - expect(setZone).toBeCalledTimes(2); - expect(setRedir).toBeCalledTimes(2); - expect(setZone.mock.calls.map(R.head)).toEqual([ + expect(addZone).toBeCalledTimes(2); + expect(addRedir).toBeCalledTimes(2); + expect(addZone.mock.calls.map(R.head)).toEqual([ { name: 'xx', type: 'CNAME', address: 'fck.com' }, { name: 'xx', type: 'A', address: '111.1.1212.1' }, ]); - expect(setRedir.mock.calls.map(R.head)).toEqual([ + expect(addRedir.mock.calls.map(R.head)).toEqual([ { domain: 'foo.booboo.xyz', redirect: 'https://google.com', @@ -169,70 +184,65 @@ describe('Domain service', () => { }); describe('updateHosts', () => { - return; - it('should append new hosts with existing ones and set it', async () => { const zones = [ - { HostId: 1, name: 'a', type: 'CNAME', address: 'boo' }, - { HostId: 2, name: 'b', type: 'CNAME', address: 'goo' }, + { someid: 1, name: 'a', type: 'CNAME', address: 'boo' }, + { someid: 2, name: 'b', type: 'CNAME', address: 'goo' }, ]; const redirections = []; - const mockDomainService = mockDS({ zones, redirections });; + const mockDomainService = mockDS({ zones, redirections }); await mockDomainService.updateHosts([ { name: 'a', type: 'CNAME', address: 'boo' }, { name: 'b', type: 'CNAME', address: 'goo' }, { name: 'c', type: 'A', address: '12.131321.213' }, ]); - expect(setZone).toBeCalledTimes(1); - expect(getZoneCalls()).toEqual([ + expect(addZone).toBeCalledTimes(1); + expect(getRecordCalls(addZone)).toEqual([ { name: 'c', type: 'A', address: '12.131321.213' }, ]); + expect(editZone).toBeCalledTimes(0); }); it('should update matching host and set it', async () => { const zones = [ - { HostId: 1, Name: 'a', Type: 'CNAME', address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', address: 'goo' }, + { someid: 1, name: 'a', type: 'CNAME', address: 'boo' }, + { someid: 2, name: 'b', type: 'CNAME', address: 'goo' }, ]; const redirections = []; - const mockDomainService = mockDS({ zones, redirections });; + const mockDomainService = mockDS({ zones, redirections }); await mockDomainService.updateHosts([ { name: 'a', type: 'CNAME', address: 'boo' }, { name: 'b', type: 'CNAME', address: 'googoogaga' }, ]); - expect(setZone).toBeCalledTimes(2); - expect(getZoneCalls()).toEqual([ - { name: 'a', type: 'CNAME', address: 'boo' }, + expect(addZone).toBeCalledTimes(0); + expect(editZone).toBeCalledTimes(1); + expect(getRecordCalls(editZone)).toEqual([ { name: 'b', type: 'CNAME', address: 'googoogaga' }, ]); }); - return; it('should update matching host and set it', async () => { - const records = [ - { HostId: 1, Name: 'a', Type: 'CNAME', address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', address: 'goo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', address: 'xaa' }, + const zones = [ + { someid: 1, name: 'a', type: 'CNAME', address: 'boo' }, + { someid: 2, name: 'b', type: 'CNAME', address: 'goo' }, + { someid: 2, name: 'b', type: 'CNAME', address: 'xaa' }, ]; + const redirections = []; - const onGet = () => Promise.resolve({ hosts: records }); - const onSet = jest.fn(async () => ({})); - - const mockDomainService = getDomainService({ cpanel: getCpanel({ onSet, onGet }) }); + const mockDomainService = mockDS({ zones, redirections }); await mockDomainService.updateHosts([ { name: 'a', type: 'CNAME', address: 'boo' }, { name: 'b', type: 'CNAME', address: 'googoogaga' }, { name: 'b', type: 'CNAME', address: 'farboo' }, ]); - const [hosts] = onSet.mock.calls[0]; - - expect(hosts.map(R.pick(['name', 'type', 'address']))).toEqual([ - { name: 'a', type: 'CNAME', address: 'boo' }, + expect(addZone).toBeCalledTimes(0); + expect(editZone).toBeCalledTimes(2); + expect(getRecordCalls(editZone)).toEqual([ { name: 'b', type: 'CNAME', address: 'googoogaga' }, { name: 'b', type: 'CNAME', address: 'farboo' }, ]); diff --git a/utils/domain-service.js b/utils/domain-service.js index 0c6964ae8..5ffe0a8e8 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -1,6 +1,6 @@ const R = require('ramda'); const { cpanel } = require('./lib/cpanel'); -const {DOMAIN_DOMAIN} = require('./constants'); +const { DOMAIN_DOMAIN } = require('./constants'); const flattenPromise = xs => Promise.all(xs); @@ -32,50 +32,6 @@ const toHostMap = hosts => hosts.reduce((acc, host) => { return { ...acc, [key]: [ ...(acc[key] || []), host ] }; }, {}); -const getDomainService = ({ cpanel }) => { - let hostList = []; - - const fetchZoneRecords = () => cpanel.fetchZoneRecords().then(R.map(zoneToRecord)); - const fetchRedirections = () => cpanel.fetchRedirections().then(R.map(redirectionToRecord)); - - const addZoneRecord = R.compose(cpanel.addZoneRecord, recordToZone); - const addRedirection = R.compose(cpanel.addRedirection, recordToRedirection); - - const getHosts = async () => { - if (hostList.length) return hostList; - - const list = await Promise.all([fetchZoneRecords(), fetchRedirections()]).then(R.flatten); - - hostList = list; - return list; - }; - - const setHosts = R.compose(flattenPromise, R.map(R.cond([ - [ R.propEq('type', 'URL'), addRedirection ], - [ R.T, addZoneRecord ], - ]))); - - const updateHosts = async hosts => { - const hostList = await getHosts(); - const remoteHostMap = toHostMap(hostList); - const localHostMap = toHostMap(hosts); - - const newHostList = R.toPairs(localHostMap).reduce((acc, [key, local]) => { - const remote = remoteHostMap[key]; - - if (remote) { - return acc.concat(local.map((localItem, index) => R.merge(remote[index], localItem))); - } - - return [...acc, ...local]; - }, []); - - return setHosts(newHostList); - }; - - return { getHosts, setHosts, updateHosts }; -}; - const diffRecords = (oldRecords, newRecords) => { const remoteHostMap = toHostMap(oldRecords); const localHostMap = toHostMap(newRecords); @@ -102,6 +58,46 @@ const diffRecords = (oldRecords, newRecords) => { }, { add: [], edit: [] }); }; +const getDomainService = ({ cpanel }) => { + let hostList = []; + + const fetchZoneRecords = () => cpanel.zone.fetch().then(R.map(zoneToRecord)); + const fetchRedirections = () => cpanel.redirection.fetch().then(R.map(redirectionToRecord)); + + const addZoneRecord = R.compose(cpanel.zone.add, recordToZone); + const addRedirection = R.compose(cpanel.redirection.add, recordToRedirection); + + const editZoneRecord = R.compose(cpanel.zone.edit, recordToZone); + const editRedirection = R.compose(cpanel.redirection.edit, recordToRedirection); + + const getHosts = async () => { + if (hostList.length) return hostList; + + const list = await Promise.all([fetchZoneRecords(), fetchRedirections()]).then(R.flatten); + + hostList = list; + return list; + }; + + const addRecords = R.compose(flattenPromise, R.map(R.cond([ + [ R.propEq('type', 'URL'), addRedirection ], + [ R.T, addZoneRecord ], + ]))); + const editRecords = R.compose(flattenPromise, R.map(R.cond([ + [ R.propEq('type', 'URL'), editRedirection ], + [ R.T, editZoneRecord ], + ]))); + + const updateHosts = async hosts => { + const remoteHostList = await getHosts(); + const { add, edit } = diffRecords(remoteHostList, hosts); + + return Promise.all([ addRecords(add), editRecords(edit) ]); + }; + + return { getHosts, setHosts: addRecords, updateHosts }; +}; + const domainService = getDomainService({ cpanel }); module.exports = { diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js index 0c575fa2c..9a4ad2e19 100644 --- a/utils/lib/cpanel.js +++ b/utils/lib/cpanel.js @@ -34,27 +34,35 @@ const CpanelClient = (options) => { api({ basePath: 'execute', action: `${module}/${func}` })(module, func, defaultQuery); return { - // { customonly, domain } - // -> { cpanelresult: { data[{ class, ttl, name, line, Line, cname, type, record }] } } - fetchZoneRecords: R.compose( - p => p.then(R.pathOr([], ['cpanelresult', 'data'])), - api2('ZoneEdit', 'fetchzone_records', { customonly: 1, domain: options.domain }) - ), + zone: { + // { customonly, domain } + // -> { cpanelresult: { data[{ class, ttl, name, line, Line, cname, type, record }] } } + fetch: R.compose( + p => p.then(R.pathOr([], ['cpanelresult', 'data'])), + api2('ZoneEdit', 'fetchzone_records', { customonly: 1, domain: options.domain }) + ), - // { domain, name, type(A|CNAME), cname, address, ttl } - // -> {} - addZoneRecord: api2('ZoneEdit', 'add_zone_record', { domain: options.domain }), + // { name, type(A|CNAME), cname, address, ttl } + // -> {} + add: api2('ZoneEdit', 'add_zone_record', { domain: options.domain }), - // {} - // -> { domain, destination } - fetchRedirections: R.compose( - p => p.then(R.pathOr([], ['data'])), - uapi('Mime', 'list_redirects'), - ), + // { name, type(A|CNAME), cname, address, ttl } + // -> {} + edit: api2('ZoneEdit', 'edit_zone_record', { domain: options.domain }), + }, + redirection: { + // {} + // -> { domain, destination } + fetch: R.compose( + p => p.then(R.pathOr([], ['data'])), + uapi('Mime', 'list_redirects'), + ), - // { domain, redirect, type(permanent|tmp), redirect_wildcard(0|1), redirect(0|1|2) } - // -> {} - addRedirection: uapi('Mime', 'add_redirect'), + // { domain, redirect, type(permanent|tmp), redirect_wildcard(0|1), redirect(0|1|2) } + // -> {} + add: uapi('Mime', 'add_redirect'), + edit: uapi('Mime', 'add_redirect'), // NOTE: adding new updates exisiting + }, }; }; From 3cdad9b28db829fd396b42e43bd8fc844c24624b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 22:17:29 +0530 Subject: [PATCH 091/108] Adds complicated test case --- tests/domain-service.test.js | 53 +++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/tests/domain-service.test.js b/tests/domain-service.test.js index fe74c6ec5..554089466 100644 --- a/tests/domain-service.test.js +++ b/tests/domain-service.test.js @@ -11,12 +11,11 @@ const getCpanel = ({ zone, addZone, editZone, redir, addRedir, editRedir } = {}) redirection: { fetch: (_) => redir(), add: (rec) => addRedir(rec), - edit: (rec) => editZone(rec), + edit: (rec) => editRedir(rec), }, }); describe('diffRecords', () => { - return; it('should show added record', () => { const oldRecords = [ { name: 'xx', type: 'CNAME', address: 'fck.com.' }, @@ -92,8 +91,7 @@ describe('Domain service', () => { editRedir, }) }); - const getRecordCalls = recfn => recfn.mock.calls.map(R.head).map(R.pick(['name', 'type', 'address'])); - const getZoneCalls = () => getRecordCalls(addZone); + const getRecordCalls = recfn => recfn.mock.calls.map(R.head).map(R.pick(['name', 'type', 'address', 'redirect', 'domain'])); beforeEach(() => { addZone.mockClear(); @@ -247,6 +245,53 @@ describe('Domain service', () => { { name: 'b', type: 'CNAME', address: 'farboo' }, ]); }); + + it('should workout this complex example', async () => { + const zones = [ + { someid: 1, name: 'a', type: 'CNAME', address: 'world' }, + { someid: 2, name: 'b', type: 'A', address: '1' }, + { someid: 2, name: 'b', type: 'A', address: '2' }, + { someid: 2, name: 'c', type: 'CNAME', address: 'hello.com' }, + ]; + const redirections = [ + { domain: `b.${DOMAIN_DOMAIN}`, destination: 'https://foobar.com' }, + { domain: `c.${DOMAIN_DOMAIN}`, destination: 'https://goobar.com' }, + { domain: `x.${DOMAIN_DOMAIN}`, destination: 'https://example.com' }, + ]; + + const mockDomainService = mockDS({ zones, redirections }); + await mockDomainService.updateHosts([ + { name: 'a', type: 'CNAME', address: 'boo' }, + { name: 'b', type: 'A', address: '1' }, + { name: 'b', type: 'A', address: '2' }, + { name: 'b', type: 'A', address: '3' }, + { name: 'b', type: 'URL', address: 'https://wowow.com' }, + { name: 'c', type: 'CNAME', address: 'hello.com' }, + { name: 'c', type: 'URL', address: 'https://goobar.com' }, + { name: 'd', type: 'CNAME', address: 'helo.com' }, + { name: 'd', type: 'URL', address: 'https://hhh.com' }, + { name: 'x', type: 'URL', address: 'https://example69.com' }, + ]); + + expect(addZone).toBeCalledTimes(2); + expect(editZone).toBeCalledTimes(1); + expect(addRedir).toBeCalledTimes(1); + expect(editRedir).toBeCalledTimes(2); + expect(getRecordCalls(addZone)).toEqual([ + { name: 'b', type: 'A', address: '3' }, + { name: 'd', type: 'CNAME', address: 'helo.com' } + ]); + expect(getRecordCalls(editZone)).toEqual([ + { name: 'a', type: 'CNAME', address: 'boo' }, + ]); + expect(getRecordCalls(addRedir)).toEqual([ + { domain: `d.${DOMAIN_DOMAIN}`, type: 'permanent', redirect: 'https://hhh.com' }, + ]); + expect(getRecordCalls(editRedir)).toEqual([ + { domain: `b.${DOMAIN_DOMAIN}`, type: 'permanent', redirect: 'https://wowow.com' }, + { domain: `x.${DOMAIN_DOMAIN}`, type: 'permanent', redirect: 'https://example69.com' }, + ]); + }); }); }); From bd3a5a5043230d8bf23e769bf6c956584ea2d82b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 22:22:28 +0530 Subject: [PATCH 092/108] Adds req test cases for redirection fetch --- tests/cpanel.test.js | 58 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/tests/cpanel.test.js b/tests/cpanel.test.js index a32c562cf..f92ce51d3 100644 --- a/tests/cpanel.test.js +++ b/tests/cpanel.test.js @@ -30,7 +30,7 @@ describe('Cpanel client', () => { dependencies: { fetch }, }); - await cpanel.fetchZoneRecords(); + await cpanel.zone.fetch(); }); it('should make the correct request with query', async () => { @@ -53,7 +53,7 @@ describe('Cpanel client', () => { dependencies: { fetch }, }); - await cpanel.fetchZoneRecords({ domain: 'foobar.boeey' }); + await cpanel.zone.fetch({ domain: 'foobar.boeey' }); }); }); @@ -78,7 +78,7 @@ describe('Cpanel client', () => { dependencies: { fetch }, }); - await cpanel.addZoneRecord({ + await cpanel.zone.add({ name: 'googo', type: 'boyee', cname: 'beey', @@ -87,5 +87,57 @@ describe('Cpanel client', () => { }); }); }); + + describe('fetchredirections', () => { + it('should make the correct request', async () => { + const fetch = mockFetch((url, request) => { + expect(url).toBe('https://example.com:2000/execute/Mime/list_redirects?cpanel_jsonapi_user=boy&cpanel_jsonapi_module=Mime&cpanel_jsonapi_func=list_redirects&cpanel_jsonapi_apiversion=2'); + expect(request).toEqual({ + headers: { + Authorization: 'cpanel boy:boybyebye', + }, + rejectUnauthorized: false, + }); + }); + + const cpanel = CpanelClient({ + host: 'example.com', + port: 2000, + username: 'boy', + apiKey: 'boybyebye', + domain: 'a.b', + dependencies: { fetch }, + }); + + await cpanel.redirection.fetch(); + }); + }); + describe('addredirection', () => { + it('should make the correct request', async () => { + const fetch = mockFetch((url, request) => { + expect(url).toBe('https://example.com:2000/execute/Mime/add_redirect?domain=googo&destination=https%3A%2F%2Foodf.com&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=Mime&cpanel_jsonapi_func=add_redirect&cpanel_jsonapi_apiversion=2'); + expect(request).toEqual({ + headers: { + Authorization: 'cpanel boy:boybyebye', + }, + rejectUnauthorized: false, + }); + }); + + const cpanel = CpanelClient({ + host: 'example.com', + port: 2000, + username: 'boy', + apiKey: 'boybyebye', + domain: 'a.b', + dependencies: { fetch }, + }); + + await cpanel.redirection.add({ + domain: 'googo', + destination: 'https://oodf.com' + }); + }); + }); }); From 85e5181327810b35bbcf8783b9a48d533c9c62d4 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 22:33:21 +0530 Subject: [PATCH 093/108] Removes redundant test for register-dmains --- scripts/register-domains.js | 8 +-- tests/register.test.js | 120 ++---------------------------------- 2 files changed, 9 insertions(+), 119 deletions(-) diff --git a/scripts/register-domains.js b/scripts/register-domains.js index 73186f79a..4d2941c83 100644 --- a/scripts/register-domains.js +++ b/scripts/register-domains.js @@ -10,10 +10,10 @@ const toHostList = R.chain(data => { return R.chain(([recordType, urls]) => (Array.isArray(urls) ? urls : [urls]).map(url => ({ - HostName: data.name, - RecordType: recordType, - Address: url, - TTL, + name: data.name, + type: recordType, + address: url, + ttl: TTL, })) , rs); }); diff --git a/tests/register.test.js b/tests/register.test.js index 8a24e0dec..57a68ac38 100644 --- a/tests/register.test.js +++ b/tests/register.test.js @@ -1,13 +1,5 @@ const { toHostList, registerDomains } = require('../scripts/register-domains'); const { TTL } = require('../utils/constants'); -const { getDomainService } = require('../utils/domain-service'); - -const getNc = ({ onSet, onGet } = {}) => ({ - dns: { - setHosts: (_, list) => onSet(list), - getHosts: (_) => onGet(), - }, -}); describe('toHostList', () => { it('should flatten domain data to list of hosts (without https)', () => { @@ -18,113 +10,11 @@ describe('toHostList', () => { ]); expect(res).toEqual([ - { HostName: 'akshay', RecordType: 'CNAME', Address: 'phenax.github.io', TTL }, - { HostName: 'foobar', RecordType: 'CNAME', Address: 'v.io', TTL }, - { HostName: 'xx', RecordType: 'A', Address: '1.2.3.4', TTL }, - { HostName: 'xx', RecordType: 'A', Address: '5.6.3.2', TTL }, - { HostName: 'xx', RecordType: 'A', Address: '1.2.31.1', TTL }, - ]); - }); -}); - -describe('registerDomains', () => { - return; - it('should register the new set of hosts generated from domains list', async () => { - const localHosts = [ - { name: 'a', record: { CNAME: 'hello' } }, - { name: 'b', record: { CNAME: 'xaa' } }, - ]; - const remoteHosts = [ - { HostId: 1, Name: 'a', Type: 'CNAME', Address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'goo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'xaa' }, - ]; - - const onSet = jest.fn(async () => ({})); - - const domainService = getDomainService({ nc: getNc({ onSet, onGet: async () => ({ hosts: remoteHosts }) }) }); - await registerDomains({ getDomains: async () => localHosts, domainService }); - - expect(onSet).toBeCalledTimes(1); - - const [hosts] = onSet.mock.calls[0]; - expect(hosts).toEqual([ - { HostId: 1, Address: 'hello', HostName: 'a', RecordType: 'CNAME', TTL }, - { HostId: 2, Address: 'xaa', HostName: 'b', RecordType: 'CNAME', TTL }, - ]); - }); - - it('should add the new set hosts', async () => { - const localHosts = [ - { name: 'a', record: { CNAME: 'boo' } }, - { name: 'b', record: { CNAME: 'xaa' } }, - { name: 'c', record: { CNAME: 'yello' } }, - ]; - const remoteHosts = [ - { HostId: 1, Name: 'a', Type: 'CNAME', Address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'xaa' }, - ]; - - const onSet = jest.fn(async () => ({})); - - const domainService = getDomainService({ nc: getNc({ onSet, onGet: async () => ({ hosts: remoteHosts }) }) }); - await registerDomains({ getDomains: async () => localHosts, domainService }); - - expect(onSet).toBeCalledTimes(1); - - const [hosts] = onSet.mock.calls[0]; - expect(hosts).toEqual([ - { HostId: 1, Address: 'boo', HostName: 'a', RecordType: 'CNAME', TTL }, - { HostId: 2, Address: 'xaa', HostName: 'b', RecordType: 'CNAME', TTL }, - { Address: 'yello', HostName: 'c', RecordType: 'CNAME', TTL }, - ]); - }); - - it('should remove unlisted hosts', async () => { - const localHosts = [ - { name: 'a', record: { CNAME: 'boo' } }, - ]; - const remoteHosts = [ - { HostId: 1, Name: 'a', Type: 'CNAME', Address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'xaa' }, - ]; - - const onSet = jest.fn(async () => ({})); - - const domainService = getDomainService({ nc: getNc({ onSet, onGet: async () => ({ hosts: remoteHosts }) }) }); - await registerDomains({ getDomains: async () => localHosts, domainService }); - - expect(onSet).toBeCalledTimes(1); - - const [hosts] = onSet.mock.calls[0]; - expect(hosts).toEqual([ - { HostId: 1, Address: 'boo', HostName: 'a', RecordType: 'CNAME', TTL }, - ]); - }); - - it('should change record type from cname to a', async () => { - const localHosts = [ - { name: 'a', record: { CNAME: 'boo' } }, - { name: 'b', record: { A: ['1', '2', '3'] } }, - ]; - const remoteHosts = [ - { HostId: 1, Name: 'a', Type: 'CNAME', Address: 'boo' }, - { HostId: 2, Name: 'b', Type: 'CNAME', Address: 'xaa' }, - ]; - - const onSet = jest.fn(async () => ({})); - - const domainService = getDomainService({ nc: getNc({ onSet, onGet: async () => ({ hosts: remoteHosts }) }) }); - await registerDomains({ getDomains: async () => localHosts, domainService }); - - expect(onSet).toBeCalledTimes(1); - - const [hosts] = onSet.mock.calls[0]; - expect(hosts).toEqual([ - { HostId: 1, Address: 'boo', HostName: 'a', RecordType: 'CNAME', TTL }, - { Address: '1', HostName: 'b', RecordType: 'A', TTL }, - { Address: '2', HostName: 'b', RecordType: 'A', TTL }, - { Address: '3', HostName: 'b', RecordType: 'A', TTL }, + { name: 'akshay', type: 'CNAME', address: 'phenax.github.io', ttl: TTL }, + { name: 'foobar', type: 'CNAME', address: 'v.io', ttl: TTL }, + { name: 'xx', type: 'A', address: '1.2.3.4', ttl: TTL }, + { name: 'xx', type: 'A', address: '5.6.3.2', ttl: TTL }, + { name: 'xx', type: 'A', address: '1.2.31.1', ttl: TTL }, ]); }); }); From 44287b850e05e7d025c2398b6b766a0378bbc016 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 23:04:24 +0530 Subject: [PATCH 094/108] Registerdomain tests --- scripts/register-domains.js | 6 +-- tests/register.test.js | 87 ++++++++++++++++++++++++++++++++++++- 2 files changed, 89 insertions(+), 4 deletions(-) diff --git a/scripts/register-domains.js b/scripts/register-domains.js index 4d2941c83..42b184baa 100644 --- a/scripts/register-domains.js +++ b/scripts/register-domains.js @@ -18,19 +18,19 @@ const toHostList = R.chain(data => { , rs); }); -const registerDomains = async ({ domainService, getDomains }) => { +const registerDomains = async ({ domainService, getDomains, log = () => {} }) => { const domains = await getDomains().then(toHostList); if (domains.length === 0) return Promise.reject(new Error('Nothing to register')); - console.log(`Publishing ${domains.length} records...`); + log(`Publishing ${domains.length} records...`); return domainService.updateHosts(domains); }; const main = async () => { console.log(`Running in ${ENV} mode`); - const result = await registerDomains({ domainService: dc, getDomains: gd }); + const result = await registerDomains({ domainService: dc, getDomains: gd, log: console.log }); console.log(result); }; diff --git a/tests/register.test.js b/tests/register.test.js index 57a68ac38..2101bcc85 100644 --- a/tests/register.test.js +++ b/tests/register.test.js @@ -1,5 +1,20 @@ +const R = require('ramda'); const { toHostList, registerDomains } = require('../scripts/register-domains'); -const { TTL } = require('../utils/constants'); +const { TTL, DOMAIN_DOMAIN } = require('../utils/constants'); +const { getDomainService } = require('../utils/domain-service'); + +const getCpanel = ({ zone, addZone, editZone, redir, addRedir, editRedir } = {}) => ({ + zone: { + fetch: (_) => zone(), + add: (rec) => addZone(rec), + edit: (rec) => editZone(rec), + }, + redirection: { + fetch: (_) => redir(), + add: (rec) => addRedir(rec), + edit: (rec) => editRedir(rec), + }, +}); describe('toHostList', () => { it('should flatten domain data to list of hosts (without https)', () => { @@ -19,3 +34,73 @@ describe('toHostList', () => { }); }); +describe('registerDomains', () => { + const addZone = jest.fn(async () => ({})); + const editZone = jest.fn(async () => ({})); + const addRedir = jest.fn(async () => ({})); + const editRedir = jest.fn(async () => ({})); + + const mockDS = ({ zones, redirections }) => getDomainService({ cpanel: getCpanel({ + zone: async () => zones, + redir: async () => redirections, + addZone, + addRedir, + editZone, + editRedir, + }) }); + + const getRecordCalls = recfn => recfn.mock.calls.map(R.head).map(R.pick(['name', 'type', 'address', 'redirect', 'domain'])); + + beforeEach(() => { + addZone.mockClear(); + editZone.mockClear(); + addRedir.mockClear(); + editRedir.mockClear(); + }); + + it('should register the new set of hosts generated from domains list', async () => { + const localHosts = [ + { name: 'a', record: { CNAME: 'hello' } }, + { name: 'b', record: { CNAME: 'xaa' } }, + ]; + const remoteHosts = [ + { someididk: 1, name: 'a', type: 'CNAME', address: 'hello' }, + { someididk: 2, name: 'b', type: 'CNAME', address: 'goo' }, + { someididk: 2, name: 'b', type: 'CNAME', address: 'xaa' }, + ]; + const remoteRedirections = []; + + const domainService = mockDS({ zones: remoteHosts, redirections: remoteRedirections }); + await registerDomains({ getDomains: async () => localHosts, domainService }); + + expect(addZone).toBeCalledTimes(0); + expect(editZone).toBeCalledTimes(0); + expect(addRedir).toBeCalledTimes(0); + expect(editRedir).toBeCalledTimes(0); + }); + + it('should add the new set hosts', async () => { + const localHosts = [ + { name: 'a', record: { CNAME: 'boo', URL: 'z' } }, + { name: 'b', record: { CNAME: 'xaa', URL: 'x' } }, + { name: 'c', record: { CNAME: 'yello', URL: 'https://google.com' } }, + ]; + const remoteHosts = [ + { someididk: 1, name: 'a', type: 'CNAME', address: 'boo' }, + { someididk: 2, name: 'b', type: 'CNAME', address: 'xaa' }, + ]; + const remoteRedirections = [ + { domain: `b.${DOMAIN_DOMAIN}`, destination: 'x' }, + { domain: `a.${DOMAIN_DOMAIN}`, destination: 'y' }, + ]; + + const domainService = mockDS({ zones: remoteHosts, redirections: remoteRedirections }); + await registerDomains({ getDomains: async () => localHosts, domainService }); + + expect(addZone).toBeCalledTimes(1); + expect(editZone).toBeCalledTimes(0); + expect(addRedir).toBeCalledTimes(1); + expect(editRedir).toBeCalledTimes(1); + }); +}); + From b7741e02ff2928fcfabfde0bb58dc3732f0e2e5b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 23:06:27 +0530 Subject: [PATCH 095/108] cleanup --- scripts/register-domains.js | 2 +- tests/register.test.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/register-domains.js b/scripts/register-domains.js index 42b184baa..30567eb33 100644 --- a/scripts/register-domains.js +++ b/scripts/register-domains.js @@ -24,7 +24,7 @@ const registerDomains = async ({ domainService, getDomains, log = () => {} }) => if (domains.length === 0) return Promise.reject(new Error('Nothing to register')); - log(`Publishing ${domains.length} records...`); + log(`${domains.length} records found`); return domainService.updateHosts(domains); }; diff --git a/tests/register.test.js b/tests/register.test.js index 2101bcc85..0a87f2f4e 100644 --- a/tests/register.test.js +++ b/tests/register.test.js @@ -49,8 +49,6 @@ describe('registerDomains', () => { editRedir, }) }); - const getRecordCalls = recfn => recfn.mock.calls.map(R.head).map(R.pick(['name', 'type', 'address', 'redirect', 'domain'])); - beforeEach(() => { addZone.mockClear(); editZone.mockClear(); From 0938dff85a3ace287419b024ab416d44f5575ea2 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 23:31:12 +0530 Subject: [PATCH 096/108] Adds simple batching --- tests/domain-service.test.js | 40 ------------------------------------ utils/domain-service.js | 34 ++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 49 deletions(-) diff --git a/tests/domain-service.test.js b/tests/domain-service.test.js index 554089466..19154db6e 100644 --- a/tests/domain-service.test.js +++ b/tests/domain-service.test.js @@ -141,46 +141,6 @@ describe('Domain service', () => { }); }); - describe('setHosts', () => { - it('should resolve with a list of hosts', async () => { - const records = [ - { name: 'xx', type: 'CNAME', address: 'fck.com' }, - { name: 'xx', type: 'A', address: '111.1.1212.1' }, - { name: 'foo', type: 'URL', address: 'https://google.com' }, - { name: 'foo1', type: 'URL', address: 'https://duck.com' }, - ]; - - const addZone = jest.fn(async () => {}); - const addRedir = jest.fn(async () => {}); - - const mockDomainService = getDomainService({ cpanel: getCpanel({ addZone, addRedir }) }); - await mockDomainService.setHosts(records); - - expect(addZone).toBeCalledTimes(2); - expect(addRedir).toBeCalledTimes(2); - expect(addZone.mock.calls.map(R.head)).toEqual([ - { name: 'xx', type: 'CNAME', address: 'fck.com' }, - { name: 'xx', type: 'A', address: '111.1.1212.1' }, - ]); - expect(addRedir.mock.calls.map(R.head)).toEqual([ - { - domain: 'foo.booboo.xyz', - redirect: 'https://google.com', - redirect_wildcard: 1, - redirect_www: 0, - type: 'permanent', - }, - { - domain: 'foo1.booboo.xyz', - redirect: 'https://duck.com', - redirect_wildcard: 1, - redirect_www: 0, - type: 'permanent', - }, - ]); - }); - }); - describe('updateHosts', () => { it('should append new hosts with existing ones and set it', async () => { const zones = [ diff --git a/utils/domain-service.js b/utils/domain-service.js index 5ffe0a8e8..9aacbee6e 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -2,7 +2,7 @@ const R = require('ramda'); const { cpanel } = require('./lib/cpanel'); const { DOMAIN_DOMAIN } = require('./constants'); -const flattenPromise = xs => Promise.all(xs); +const promiseAll = xs => Promise.all(xs); const recordToRedirection = ({ name, address }) => ({ domain: `${name}.${DOMAIN_DOMAIN}`, @@ -58,17 +58,33 @@ const diffRecords = (oldRecords, newRecords) => { }, { add: [], edit: [] }); }; +const lazyTask = fn => data => () => fn(data); + +const batchLazyTasks = count => tasks => tasks.reduce((batches, task) => { + if (batches.length === 0) return [[task]]; + + const full = R.init(batches); + const last = R.last(batches); + + if (last.length >= count) return [...batches, [task]]; + return [...full, [...last, task]]; +}, []); + +const executeBatch = (batches) => batches.reduce((promise, batch) => { + return promise.then(() => Promise.all(batch.map(fn => fn()))); +}, Promise.resolve()); + const getDomainService = ({ cpanel }) => { let hostList = []; const fetchZoneRecords = () => cpanel.zone.fetch().then(R.map(zoneToRecord)); const fetchRedirections = () => cpanel.redirection.fetch().then(R.map(redirectionToRecord)); - const addZoneRecord = R.compose(cpanel.zone.add, recordToZone); - const addRedirection = R.compose(cpanel.redirection.add, recordToRedirection); + const addZoneRecord = lazyTask(R.compose(cpanel.zone.add, recordToZone)); + const addRedirection = lazyTask(R.compose(cpanel.redirection.add, recordToRedirection)); - const editZoneRecord = R.compose(cpanel.zone.edit, recordToZone); - const editRedirection = R.compose(cpanel.redirection.edit, recordToRedirection); + const editZoneRecord = lazyTask(R.compose(cpanel.zone.edit, recordToZone)); + const editRedirection = lazyTask(R.compose(cpanel.redirection.edit, recordToRedirection)); const getHosts = async () => { if (hostList.length) return hostList; @@ -79,11 +95,11 @@ const getDomainService = ({ cpanel }) => { return list; }; - const addRecords = R.compose(flattenPromise, R.map(R.cond([ + const addRecords = R.compose(batchLazyTasks(10), R.map(R.cond([ [ R.propEq('type', 'URL'), addRedirection ], [ R.T, addZoneRecord ], ]))); - const editRecords = R.compose(flattenPromise, R.map(R.cond([ + const editRecords = R.compose(batchLazyTasks(10), R.map(R.cond([ [ R.propEq('type', 'URL'), editRedirection ], [ R.T, editZoneRecord ], ]))); @@ -92,10 +108,10 @@ const getDomainService = ({ cpanel }) => { const remoteHostList = await getHosts(); const { add, edit } = diffRecords(remoteHostList, hosts); - return Promise.all([ addRecords(add), editRecords(edit) ]); + return executeBatch(addRecords(add).concat(editRecords(edit))); }; - return { getHosts, setHosts: addRecords, updateHosts }; + return { getHosts, updateHosts }; }; const domainService = getDomainService({ cpanel }); From dda977068af804c5e66ceefff757634b7ff4e633 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 23:51:56 +0530 Subject: [PATCH 097/108] Refactors batching --- utils/domain-service.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/utils/domain-service.js b/utils/domain-service.js index 9aacbee6e..358c98ed6 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -2,8 +2,6 @@ const R = require('ramda'); const { cpanel } = require('./lib/cpanel'); const { DOMAIN_DOMAIN } = require('./constants'); -const promiseAll = xs => Promise.all(xs); - const recordToRedirection = ({ name, address }) => ({ domain: `${name}.${DOMAIN_DOMAIN}`, redirect: address, @@ -11,7 +9,13 @@ const recordToRedirection = ({ name, address }) => ({ redirect_wildcard: 1, redirect_www: 0, }); -const recordToZone = R.identity; +const recordToZone = ({ name, type, address, ...rec }) => ({ + ...rec, + name, + type, + address, + cname: type === 'CNAME' ? address : undefined, +}) const zoneToRecord = ({ name, type, cname, address, ...host }) => ({ ...host, @@ -71,7 +75,12 @@ const batchLazyTasks = count => tasks => tasks.reduce((batches, task) => { }, []); const executeBatch = (batches) => batches.reduce((promise, batch) => { - return promise.then(() => Promise.all(batch.map(fn => fn()))); + return promise.then(() => { + console.log('>>> Running batch', batch.length); + return Promise.all(batch.map(fn => fn().catch(e => { + console.error(e); + }))); + }); }, Promise.resolve()); const getDomainService = ({ cpanel }) => { @@ -95,11 +104,13 @@ const getDomainService = ({ cpanel }) => { return list; }; - const addRecords = R.compose(batchLazyTasks(10), R.map(R.cond([ + const BATCH_SIZE = 10; + + const addRecords = R.compose(batchLazyTasks(BATCH_SIZE), R.map(R.cond([ [ R.propEq('type', 'URL'), addRedirection ], [ R.T, addZoneRecord ], ]))); - const editRecords = R.compose(batchLazyTasks(10), R.map(R.cond([ + const editRecords = R.compose(batchLazyTasks(BATCH_SIZE), R.map(R.cond([ [ R.propEq('type', 'URL'), editRedirection ], [ R.T, editZoneRecord ], ]))); @@ -108,7 +119,8 @@ const getDomainService = ({ cpanel }) => { const remoteHostList = await getHosts(); const { add, edit } = diffRecords(remoteHostList, hosts); - return executeBatch(addRecords(add).concat(editRecords(edit))); + await executeBatch(addRecords(add).concat(editRecords(edit))); + return { additions: add.length, edits: edit.length }; }; return { getHosts, updateHosts }; From e142b024b55a7dbba2958fc63ddd0ba9f0127ded Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 11 Oct 2020 23:56:32 +0530 Subject: [PATCH 098/108] Adds json file extension test case --- tests/domains.test.js | 7 +++++++ utils/constants.js | 5 ++++- utils/domain.js | 4 +--- utils/lib/cpanel.js | 14 +------------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/tests/domains.test.js b/tests/domains.test.js index 37c59575e..7f219fec4 100644 --- a/tests/domains.test.js +++ b/tests/domains.test.js @@ -1,7 +1,14 @@ const R = require('ramda'); +const fs = require('fs'); const { getDomains, validateDomainData } = require('../utils/domain'); +const { DOMAINS_PATH } = require('../utils/constants'); describe('Domains', () => { + it('should all be json', async () => { + const files = await fs.promises.readdir(DOMAINS_PATH, {}); + expect(files.filter(f => !/\.json$/g.test(f)).length).toBe(0); + }); + it('should be valid', (done) => { getDomains() .then(R.map(data => { diff --git a/utils/constants.js b/utils/constants.js index bc7643150..92b835ffb 100644 --- a/utils/constants.js +++ b/utils/constants.js @@ -10,6 +10,8 @@ const { DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DOMAIN, DOMAIN_API_HOST, DOMAIN_API_ const IS_TEST = ENV === 'test'; +const DOMAINS_PATH = require('path').resolve('domains'); + module.exports = { ENV, VALID_RECORD_TYPES: ['CNAME', 'A', 'ALIAS', 'URL'], @@ -18,5 +20,6 @@ module.exports = { DOMAIN_API_KEY: IS_TEST ? 'testkey' : DOMAIN_API_KEY, DOMAIN_API_HOST: IS_TEST ? 'example.com' : DOMAIN_API_HOST, DOMAIN_API_PORT: IS_TEST ? 6969 : DOMAIN_API_PORT, - TTL: 5*60, // TODO: Increase ttl + DOMAINS_PATH, + TTL: 5*60*60, }; diff --git a/utils/domain.js b/utils/domain.js index 089bde425..0dad1536c 100644 --- a/utils/domain.js +++ b/utils/domain.js @@ -1,9 +1,7 @@ const fs = require('fs'); const path = require('path'); const R = require('ramda'); -const { VALID_RECORD_TYPES } = require('./constants'); - -const DOMAINS_PATH = path.resolve('domains'); +const { VALID_RECORD_TYPES, DOMAINS_PATH } = require('./constants'); const log = m => x => console.log(m, x) || x; diff --git a/utils/lib/cpanel.js b/utils/lib/cpanel.js index 9a4ad2e19..c29c10145 100644 --- a/utils/lib/cpanel.js +++ b/utils/lib/cpanel.js @@ -1,7 +1,7 @@ const R = require('ramda'); const fetch = require('node-fetch'); const qs = require('qs'); -const { DOMAIN_API_HOST, DOMAIN_API_PORT, DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DOMAIN, ...c } = require('../constants'); +const { DOMAIN_API_HOST, DOMAIN_API_PORT, DOMAIN_USER, DOMAIN_API_KEY, DOMAIN_DOMAIN } = require('../constants'); const CpanelClient = (options) => { // TODO: Make defaultQuery functional @@ -80,18 +80,6 @@ const cpanel = CpanelClient({ dependencies: { fetch }, }); -//cpanel.fetchZoneRecords() -//cpanel.addRedirection({ - //domain: 'hello.is-a.dev', - //redirect: 'https://googole.com', - //type: 'permanent', - //redirect_wildcard: 1, - //redirect_www: 0, -//}) -//cpanel.fetchRedirections() - //.then(d => console.log(JSON.stringify(d, null, 2))) - //.catch(console.error); - module.exports = { cpanel, CpanelClient, From d7d2ee6ef44bfb5946ff201e7797dbc98f778fe3 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 00:00:40 +0530 Subject: [PATCH 099/108] Removes alias record type --- domains/bradley.json | 2 +- utils/constants.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/domains/bradley.json b/domains/bradley.json index d2137d61b..29a3966c1 100644 --- a/domains/bradley.json +++ b/domains/bradley.json @@ -5,6 +5,6 @@ "email": "bradley73@gmail.com" }, "record": { - "ALIAS": "bradleyholbrook.com" + "CNAME": "bradleyholbrook.com" } } diff --git a/utils/constants.js b/utils/constants.js index 92b835ffb..a2a22d408 100644 --- a/utils/constants.js +++ b/utils/constants.js @@ -14,7 +14,7 @@ const DOMAINS_PATH = require('path').resolve('domains'); module.exports = { ENV, - VALID_RECORD_TYPES: ['CNAME', 'A', 'ALIAS', 'URL'], + VALID_RECORD_TYPES: ['CNAME', 'A', 'URL'], DOMAIN_DOMAIN: DOMAIN_DOMAIN || 'booboo.xyz', DOMAIN_USER: IS_TEST ? 'testuser' : DOMAIN_USER, DOMAIN_API_KEY: IS_TEST ? 'testkey' : DOMAIN_API_KEY, From 512c20ac9f6a7bcf36cd15a376132840a7705774 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 00:01:25 +0530 Subject: [PATCH 100/108] Removes alias type from docs --- API.md | 7 +++---- utils/domain.js | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/API.md b/API.md index 47d125c53..abf70250d 100644 --- a/API.md +++ b/API.md @@ -63,12 +63,11 @@ This is a link to your website repository or your github account. This is purely ### record (required) This is where you specify how you want to link to your server/webpage. -Currently, only `CNAME`, `ALIAS`, `A`, `URL` record types are supported. +Currently, only `CNAME`, `A`, `URL` record types are supported. Here's a few different use cases for the given record types - -* **CNAME/ALIAS** -Replace CNAME with ALIAS for alias record type +* **CNAME** ```json { "record": { @@ -100,7 +99,7 @@ Replace CNAME with ALIAS for alias record type } ``` -* **Force HTTPS on your CNAME (or ALIAS or A) record** +* **Force HTTPS on your CNAME (or or A) record** ```json { "record": { diff --git a/utils/domain.js b/utils/domain.js index 0dad1536c..85419a025 100644 --- a/utils/domain.js +++ b/utils/domain.js @@ -60,7 +60,6 @@ const validateDomainData = validate({ R.compose(R.isEmpty, R.flip(R.difference)(VALID_RECORD_TYPES), R.keys), R.cond([ [R.prop('CNAME'), validateNameRecord('CNAME')], - [R.prop('ALIAS'), validateNameRecord('ALIAS')], [R.prop('A'), R.propSatisfies(R.is(Array), 'A')], [R.prop('URL'), R.propSatisfies(R.is(String), 'URL')], [R.T, R.T], From 77f0979100f927d55c651917d872db01432bb53b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 00:29:57 +0530 Subject: [PATCH 101/108] Removes upper case from name validation --- utils/domain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/domain.js b/utils/domain.js index 85419a025..f7819f02a 100644 --- a/utils/domain.js +++ b/utils/domain.js @@ -36,7 +36,7 @@ const validateDomainData = validate({ R.equals('@'), R.allPass([ R.compose(between(2, 100), R.length), - str => str && str.match(/^[A-Za-z0-9\-]+$/ig), + str => str && str.match(/^[a-z0-9\-]+$/ig), ]) ]), }, From e69eff33a3e588548d5fb8627c69a86a03e677d3 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 00:46:19 +0530 Subject: [PATCH 102/108] Fixes diff issues with sanitizations --- scripts/register-domains.js | 2 +- utils/domain-service.js | 29 +++++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/scripts/register-domains.js b/scripts/register-domains.js index 30567eb33..00626092f 100644 --- a/scripts/register-domains.js +++ b/scripts/register-domains.js @@ -12,7 +12,7 @@ const toHostList = R.chain(data => { (Array.isArray(urls) ? urls : [urls]).map(url => ({ name: data.name, type: recordType, - address: url, + address: (recordType === 'CNAME' ? `${url}`.toLowerCase() : `${url}`).replace(/\/$/g, ''), ttl: TTL, })) , rs); diff --git a/utils/domain-service.js b/utils/domain-service.js index 358c98ed6..e1e9abf2a 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -10,23 +10,24 @@ const recordToRedirection = ({ name, address }) => ({ redirect_www: 0, }); const recordToZone = ({ name, type, address, ...rec }) => ({ - ...rec, + ...rec, //line name, type, - address, - cname: type === 'CNAME' ? address : undefined, -}) + ...(type === 'CNAME' ? { cname: address } : { address }), +}); -const zoneToRecord = ({ name, type, cname, address, ...host }) => ({ +const cleanName = name => `${name}`.replace(new RegExp(`\.${DOMAIN_DOMAIN}\.?$`), '').toLowerCase(); + +const zoneToRecord = ({ name, type, cname, address, record, ...host }) => ({ ...host, - name: `${name}`, + name: cleanName(name), type: `${type}`, - address: `${cname || address}`.replace(/\.$/g, ''), + address: `${cname || address || record}`.replace(/\.$/g, '').toLowerCase(), }); const redirectionToRecord = ({ domain, destination }) => ({ - name: `${domain}`.replace('.' + DOMAIN_DOMAIN, ''), + name: cleanName(domain), type: 'URL', - address: `${destination}`, + address: `${destination}`.replace(/\/$/g, ''), }); const getHostKey = host => `${host.name}##${host.type}`; @@ -79,7 +80,12 @@ const executeBatch = (batches) => batches.reduce((promise, batch) => { console.log('>>> Running batch', batch.length); return Promise.all(batch.map(fn => fn().catch(e => { console.error(e); - }))); + }))).then(values => { + const results = values.map(R.pathOr([], ['cpanelresult', 'data', 0])); + const failed = results.filter(x => (x.result || {}).status != 1); + console.log(`${values.length - failed.length}/${values.length}`); + failed.length && console.log(failed); + }); }); }, Promise.resolve()); @@ -90,9 +96,8 @@ const getDomainService = ({ cpanel }) => { const fetchRedirections = () => cpanel.redirection.fetch().then(R.map(redirectionToRecord)); const addZoneRecord = lazyTask(R.compose(cpanel.zone.add, recordToZone)); - const addRedirection = lazyTask(R.compose(cpanel.redirection.add, recordToRedirection)); - const editZoneRecord = lazyTask(R.compose(cpanel.zone.edit, recordToZone)); + const addRedirection = lazyTask(R.compose(cpanel.redirection.add, recordToRedirection)); const editRedirection = lazyTask(R.compose(cpanel.redirection.edit, recordToRedirection)); const getHosts = async () => { From 36f97c8d06fc64db55581bb4c46ec32e6d0026f0 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 01:18:12 +0530 Subject: [PATCH 103/108] Refactors batching --- utils/constants.js | 1 + utils/domain-service.js | 36 +++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/utils/constants.js b/utils/constants.js index a2a22d408..086bb0f29 100644 --- a/utils/constants.js +++ b/utils/constants.js @@ -14,6 +14,7 @@ const DOMAINS_PATH = require('path').resolve('domains'); module.exports = { ENV, + IS_TEST, VALID_RECORD_TYPES: ['CNAME', 'A', 'URL'], DOMAIN_DOMAIN: DOMAIN_DOMAIN || 'booboo.xyz', DOMAIN_USER: IS_TEST ? 'testuser' : DOMAIN_USER, diff --git a/utils/domain-service.js b/utils/domain-service.js index e1e9abf2a..f78652740 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -1,6 +1,8 @@ const R = require('ramda'); const { cpanel } = require('./lib/cpanel'); -const { DOMAIN_DOMAIN } = require('./constants'); +const { DOMAIN_DOMAIN, IS_TEST } = require('./constants'); + +const log = IS_TEST ? () => {} : console.log; const recordToRedirection = ({ name, address }) => ({ domain: `${name}.${DOMAIN_DOMAIN}`, @@ -13,7 +15,8 @@ const recordToZone = ({ name, type, address, ...rec }) => ({ ...rec, //line name, type, - ...(type === 'CNAME' ? { cname: address } : { address }), + address, + ...(type === 'CNAME' ? { cname: address } : {}), }); const cleanName = name => `${name}`.replace(new RegExp(`\.${DOMAIN_DOMAIN}\.?$`), '').toLowerCase(); @@ -75,17 +78,19 @@ const batchLazyTasks = count => tasks => tasks.reduce((batches, task) => { return [...full, [...last, task]]; }, []); -const executeBatch = (batches) => batches.reduce((promise, batch) => { - return promise.then(() => { - console.log('>>> Running batch', batch.length); - return Promise.all(batch.map(fn => fn().catch(e => { - console.error(e); - }))).then(values => { - const results = values.map(R.pathOr([], ['cpanelresult', 'data', 0])); - const failed = results.filter(x => (x.result || {}).status != 1); - console.log(`${values.length - failed.length}/${values.length}`); - failed.length && console.log(failed); - }); +const executeBatch = (batches) => batches.reduce((promise, batch, index) => { + return promise.then(async () => { + log('>>> Running batch number:', index + 1, `(size: ${batch.length})`); + + const values = await Promise.all(batch.map(fn => fn().catch(e => console.error(e)))); + + const results = values.map(R.pathOr({}, ['cpanelresult', 'data', 0])); + const failed = results.filter(x => (x.result || {}).status != 1); + + log(`${values.length - failed.length}/${values.length}`); + failed.length && log(failed); + + return null; }); }, Promise.resolve()); @@ -109,9 +114,10 @@ const getDomainService = ({ cpanel }) => { return list; }; - const BATCH_SIZE = 10; + const BATCH_SIZE = 1; - const addRecords = R.compose(batchLazyTasks(BATCH_SIZE), R.map(R.cond([ + const addRecords = R.compose(batchLazyTasks(BATCH_SIZE), R.filter(Boolean), R.map(R.cond([ + [ R.propEq('name', 'www'), () => null ], [ R.propEq('type', 'URL'), addRedirection ], [ R.T, addZoneRecord ], ]))); From d432edce5e2651708fa5f63a506e4af15f7d90e8 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 01:19:41 +0530 Subject: [PATCH 104/108] Adds missing domain records back --- domains/abhishek.json | 12 ++++++++++++ domains/adarshs.json | 12 ++++++++++++ domains/anoop.json | 12 ++++++++++++ domains/arya.json | 12 ++++++++++++ domains/ashish.json | 12 ++++++++++++ domains/bhadra.json | 12 ++++++++++++ domains/brandon.json | 12 ++++++++++++ domains/govind.json | 12 ++++++++++++ domains/shibiliya.json | 12 ++++++++++++ 9 files changed, 108 insertions(+) create mode 100644 domains/abhishek.json create mode 100644 domains/adarshs.json create mode 100644 domains/anoop.json create mode 100644 domains/arya.json create mode 100644 domains/ashish.json create mode 100644 domains/bhadra.json create mode 100644 domains/brandon.json create mode 100644 domains/govind.json create mode 100644 domains/shibiliya.json diff --git a/domains/abhishek.json b/domains/abhishek.json new file mode 100644 index 000000000..22545cd82 --- /dev/null +++ b/domains/abhishek.json @@ -0,0 +1,12 @@ +{ + "description": "Abhishek's personal website", + "repo": "https://github.com/nullpointxr", + "owner": { + "username": "nullpointxr", + "email": "abhishek.sankar.in@protonmail.com" + }, + "record": { + "CNAME": "nullpointxr.github.io", + "URL": "https://abhishek.is-a.dev" + } +} diff --git a/domains/adarshs.json b/domains/adarshs.json new file mode 100644 index 000000000..47670879b --- /dev/null +++ b/domains/adarshs.json @@ -0,0 +1,12 @@ +{ + "description": "The portfolio of Adarsh S", + "repo": "https://github.com/adarshsuresh07", + "owner": { + "username": "adarshsuresh07", + "email": "adarshsuresh@cet.ac.in" + }, + "record": { + "CNAME":"adarshsuresh07.github.io", + "URL": "https://adarshs.is-a.dev" + } +} diff --git a/domains/anoop.json b/domains/anoop.json new file mode 100644 index 000000000..53c1c378c --- /dev/null +++ b/domains/anoop.json @@ -0,0 +1,12 @@ +{ + "description": "Anoop's blog", + "repo": "https://gitlab.com/anoopmsivadas/anoopmsivadas.gitlab.io", + "owner": { + "username": "anoopmsivadas", + "email": "anoopms@disroot.org" + }, + "record": { + "CNAME": "anoopmsivadas.gitlab.io", + "URL": "https://anoop.is-a.dev" + } +} diff --git a/domains/arya.json b/domains/arya.json new file mode 100644 index 000000000..7510a71e2 --- /dev/null +++ b/domains/arya.json @@ -0,0 +1,12 @@ +{ + "description": "Arya Vinodan's Website", + "repo": "https://github.com/aryavinodan", + "owner": { + "username": "aryavinodan", + "email": "aryavinodan2000@gmail.com" + }, + "record": { + "CNAME": "aryavinodan2000.github.io", + "URL": "https://arya.is-a.dev" + } +} diff --git a/domains/ashish.json b/domains/ashish.json new file mode 100644 index 000000000..a1d6e2498 --- /dev/null +++ b/domains/ashish.json @@ -0,0 +1,12 @@ +{ + "description": "Ashish's personal developer website", + "repo": "https://github.com/ashiishme", + "owner": { + "username": "ashiishme", + "email": "contact@ashiish.me" + }, + "record": { + "CNAME": "ashiish.me", + "URL": "https://ashish.is-a.dev" + } +} diff --git a/domains/bhadra.json b/domains/bhadra.json new file mode 100644 index 000000000..69b9a8fd1 --- /dev/null +++ b/domains/bhadra.json @@ -0,0 +1,12 @@ +{ + "description": "Personal Website", + "repo": "https://github.com/BhadraJayakumarSandhya/BhadraJayakumarSandhya.github.io", + "owner": { + "username": "BhadraJayakumarSandhya", + "email": "tomjerryparu@gmail.com" + }, + "record": { + "CNAME": "BhadraJayakumarSandhya.github.io", + "URL": "https://bhadra.is-a.dev" + } +} diff --git a/domains/brandon.json b/domains/brandon.json new file mode 100644 index 000000000..b533a756a --- /dev/null +++ b/domains/brandon.json @@ -0,0 +1,12 @@ +{ + "description": "Brandons's personal developer website", + "repo": "https://github.com/b-hexsoul", + "owner": { + "username": "b-hexsoul", + "email": "brandon.hexsel@gmail.com" + }, + "record": { + "CNAME": "b-hexsoul.github.io", + "URL": "https://brandon.is-a.dev" + } +} diff --git a/domains/govind.json b/domains/govind.json new file mode 100644 index 000000000..32732a21d --- /dev/null +++ b/domains/govind.json @@ -0,0 +1,12 @@ +{ + "description": "Govind's personal developer website", + "repo": "https://github.com/govind-shenoy", + "owner": { + "username": "govind-shenoy", + "email": "govindvshenoy@gmail.com" + }, + "record": { + "CNAME": "govind-shenoy.github.io", + "URL": "https://govind.is-a.dev" + } +} diff --git a/domains/shibiliya.json b/domains/shibiliya.json new file mode 100644 index 000000000..4c3104986 --- /dev/null +++ b/domains/shibiliya.json @@ -0,0 +1,12 @@ +{ + "description": "Shibiliya's personal developer website", + "repo": "https://github.com/duaboola", + "owner": { + "username": "duaboola", + "email": "ismailshibiliya@gmail.com" + }, + "record": { + "CNAME": "duaboola.github.io", + "URL": "https://shibiliya.is-a.dev" + } +} From c4302c392fdefccc38954790fb54bc6746ac64b6 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 02:11:47 +0530 Subject: [PATCH 105/108] Changes text on pr auto reply --- scripts/reply.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/reply.js b/scripts/reply.js index e1ae2d25c..b4fad71ae 100644 --- a/scripts/reply.js +++ b/scripts/reply.js @@ -1,6 +1,6 @@ const getInstructions = () => ` -The changes you have made will soon be reflected!! +The changes have been published!! It should reflect in less than 24 hours. ## Here\'s what you need to do next @@ -16,7 +16,7 @@ If your domain points to a server you own, add \`domain-name.is-a.dev\` to your ## Need support with your domain? -If you are having trouble setting up your domain, [create an issue](https://github.com/is-a-dev/register/issues/new/choose) and pick the \`support\` template. Describe any issue you are facing there. I\'ll try my best to get back to you asap! +If you are having trouble setting up your domain, [create an issue](https://github.com/is-a-dev/register/issues/new/choose). I\'ll try my best to get back to you asap! ## Love/Hate the service? From a56a3534179bc25c9c13ad4f115cf8d614b5b159 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 02:14:15 +0530 Subject: [PATCH 106/108] Fixes manual publish action --- .github/workflows/publish-records.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-records.yml b/.github/workflows/publish-records.yml index 17bb7bdc0..f7b49f627 100644 --- a/.github/workflows/publish-records.yml +++ b/.github/workflows/publish-records.yml @@ -10,10 +10,11 @@ jobs: env: CI: '1' ENV: production - NC_USER: ${{ secrets.NC_USER }} - NC_API_KEY: ${{ secrets.NC_API_KEY }} - NC_DOMAIN: ${{ secrets.NC_DOMAIN }} - IP_ADDRESS: ${{ secrets.IP_ADDRESS }} + DOMAIN_USER: ${{ secrets.DOMAIN_USER }} + DOMAIN_API_KEY: ${{ secrets.DOMAIN_API_KEY }} + DOMAIN_API_HOST: ${{ secrets.DOMAIN_API_HOST }} + DOMAIN_API_PORT: ${{ secrets.DOMAIN_API_PORT }} + DOMAIN_DOMAIN: ${{ secrets.DOMAIN_DOMAIN }} steps: - uses: actions/checkout@v2 - uses: borales/actions-yarn@v2.0.0 From aecce11b2a20bfc8525114d110ea0e13cebaf190 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 02:16:27 +0530 Subject: [PATCH 107/108] Removes force https --- API.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/API.md b/API.md index abf70250d..746f953f1 100644 --- a/API.md +++ b/API.md @@ -17,8 +17,7 @@ "email": "any@email" }, "record": { - "CNAME": "github-username.github.io", - "URL": "https://your-domain.is-a.dev" + "CNAME": "github-username.github.io" } } ``` @@ -99,13 +98,3 @@ Here's a few different use cases for the given record types - } ``` -* **Force HTTPS on your CNAME (or or A) record** -```json -{ - "record": { - "CNAME": "username.github.io", - "URL": "https://your-domain.is-a.dev" - } -} -``` - From 1423eeddad2c91fa6aa54960377a2adc9b7eb8c8 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 12 Oct 2020 02:32:09 +0530 Subject: [PATCH 108/108] Update domains/alestor123.json --- domains/alestor123.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/alestor123.json b/domains/alestor123.json index 7fef3325e..b9ae0804e 100644 --- a/domains/alestor123.json +++ b/domains/alestor123.json @@ -6,7 +6,7 @@ "email": "alestoraldous@gmail.com" }, "record": { - "CNAME": "http://alestor123.github.io/", + "CNAME": "alestor123.github.io", "URL": "https://alestor123.is-a.dev" } }