mirror of
https://github.com/tiennm99/thedev.id.git
synced 2026-10-11 03:13:45 +00:00
Merge branch 'main' into main
This commit is contained in:
4 files changed
+61
-1769
No files matched your search
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"require": {
|
|
||||||
"cloudflare/sdk": "^1.1",
|
|
||||||
"mailgun/mailgun-php": "^3.5",
|
|
||||||
"kriswallsmith/buzz": "^1.2",
|
|
||||||
"nyholm/psr7": "^1.4"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
-1664
File diff suppressed because it is too large.
Load diff
@@ -1,90 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
require 'vendor/autoload.php';
|
|
||||||
|
|
||||||
use Mailgun\Mailgun;
|
|
||||||
|
|
||||||
// set variables
|
|
||||||
$email = getenv('CF_EMAIL');
|
|
||||||
$apiKey = getenv('CF_API_KEY');
|
|
||||||
$zoneID = getenv('CF_ZONE_ID');
|
|
||||||
$mailgunDomain = getenv('MG_DOMAIN');
|
|
||||||
$mailgunKey = getenv('MG_KEY');
|
|
||||||
$mailFrom = getenv('MAIL_FROM');
|
|
||||||
$mailTo = getenv('MAIL_TO');
|
|
||||||
|
|
||||||
// instantiation
|
|
||||||
$key = new Cloudflare\API\Auth\APIKey($email, $apiKey);
|
|
||||||
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
|
|
||||||
$dns = new Cloudflare\API\Endpoints\DNS($adapter);
|
|
||||||
$mg = Mailgun::create($mailgunKey);
|
|
||||||
|
|
||||||
// get subdomains
|
|
||||||
$json = file_get_contents('./subdomains.json');
|
|
||||||
$data = json_decode($json, true);
|
|
||||||
|
|
||||||
function send_mail($subject, $text) {
|
|
||||||
global $mg;
|
|
||||||
global $mailgunDomain;
|
|
||||||
global $mailFrom;
|
|
||||||
global $mailTo;
|
|
||||||
$mg->messages()->send($mailgunDomain, [
|
|
||||||
'from' => $mailFrom,
|
|
||||||
'to' => $mailTo,
|
|
||||||
'subject' => $subject,
|
|
||||||
'text' => $text
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_status($url) {
|
|
||||||
$ch = curl_init();
|
|
||||||
|
|
||||||
curl_setopt_array($ch, [
|
|
||||||
CURLOPT_URL => $url,
|
|
||||||
CURLOPT_NOBODY => 1,
|
|
||||||
CURLOPT_RETURNTRANSFER => 1,
|
|
||||||
CURLOPT_HEADER => 1,
|
|
||||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
||||||
CURLOPT_SSL_VERIFYHOST => 0,
|
|
||||||
CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36 thedev.id-status-check',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$response = curl_exec($ch);
|
|
||||||
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
|
||||||
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
return $status;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($data as $subdomain => $cname) {
|
|
||||||
$domain = $subdomain . '.thedev.id';
|
|
||||||
$recordID = $dns->getRecordID($zoneID, 'CNAME', $domain);
|
|
||||||
$updatedRecord = [
|
|
||||||
'type' => 'CNAME',
|
|
||||||
'name' => $domain,
|
|
||||||
'content' => $cname,
|
|
||||||
'ttl' => 0,
|
|
||||||
'proxied' => false
|
|
||||||
];
|
|
||||||
$status = get_status("https://$domain/");
|
|
||||||
|
|
||||||
// get & check record ID
|
|
||||||
if ($recordID == true) {
|
|
||||||
echo "The subdomain $domain already exist.\n";
|
|
||||||
// if record exist, update content
|
|
||||||
if ($dns->updateRecordDetails($zoneID, $recordID, $updatedRecord) == true) {
|
|
||||||
echo "Updated the subdomain $domain with new content $cname.\n";
|
|
||||||
|
|
||||||
if ($status != '200') {
|
|
||||||
echo "Status for $domain is $status.\n";
|
|
||||||
send_mail("$domain is not configured properly!", "Please check if the domain $domain is still valid before removing it from the list.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// add new CNAME record
|
|
||||||
if ($dns->addRecord($zoneID, "CNAME", $subdomain, $cname, 0, false) === true) {
|
|
||||||
echo "A new CNAME record created for $domain.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+61
-7
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"1minus4": "1minus4.github.io",
|
||||||
|
"a2a": "aykuttasil.github.io",
|
||||||
"aalfiann": "aalfiann.github.io",
|
"aalfiann": "aalfiann.github.io",
|
||||||
"abibas": "41a900ff-6550-4b35-862e-99f1d21678bc.repl.co",
|
"abibas": "41a900ff-6550-4b35-862e-99f1d21678bc.repl.co",
|
||||||
"abhay": "032b2239-308b-43b4-ada1-c7e546fa62e6.id.repl.co",
|
"abhay": "032b2239-308b-43b4-ada1-c7e546fa62e6.id.repl.co",
|
||||||
@@ -7,76 +9,128 @@
|
|||||||
"ahmadhayyan": "ahmadhayyan.github.io",
|
"ahmadhayyan": "ahmadhayyan.github.io",
|
||||||
"ahmedazhar05": "ahmedazhar05.github.io",
|
"ahmedazhar05": "ahmedazhar05.github.io",
|
||||||
"ahskript": "ahskript.github.io",
|
"ahskript": "ahskript.github.io",
|
||||||
|
"ali": "hmd-ali.github.io",
|
||||||
|
"alicedtrh": "thedevid.alicedtrh.xyz",
|
||||||
"anamolsapkota": "anamolsapkota.github.io",
|
"anamolsapkota": "anamolsapkota.github.io",
|
||||||
|
"andy": "bungandy.github.io",
|
||||||
"anil": "anilseervi.github.io",
|
"anil": "anilseervi.github.io",
|
||||||
"anon": "glitch.edgeapp.net",
|
"anon": "anondev.up.railway.app",
|
||||||
|
"arya": "58cf7859-eb63-422a-bc7e-fee1f2f8801d.id.repl.co",
|
||||||
"asacanell": "asacanell.github.io",
|
"asacanell": "asacanell.github.io",
|
||||||
"ash-hnry": "ash-hnry.github.io",
|
"ash-hnry": "ash-hnry.github.io",
|
||||||
"ashutosh": "ashutoshcoder.github.io",
|
"ashutosh": "ashutoshcoder.github.io",
|
||||||
|
"ashwin" : "ashwin3082002.github.io",
|
||||||
"asim": "asimbera.pages.dev",
|
"asim": "asimbera.pages.dev",
|
||||||
|
"asy": "asy.github.io",
|
||||||
"appls": "appls2appls.github.io",
|
"appls": "appls2appls.github.io",
|
||||||
|
"avyanshralph": "avyansh0001.github.io",
|
||||||
"ayush": "iddev5.github.io",
|
"ayush": "iddev5.github.io",
|
||||||
"bal": "vps35.heliohost.us",
|
"barbarbar338": "barbarbar338.fly.dev",
|
||||||
"bipul": "bipuldey-portfolio.netlify.app",
|
"bipul": "bipuldey-portfolio.netlify.app",
|
||||||
|
"boredcodebyk": "boredcodebyk.github.io",
|
||||||
|
"breadomaticc": "breadomaticc.github.io",
|
||||||
"cozmo": "cozmodev.github.io",
|
"cozmo": "cozmodev.github.io",
|
||||||
"crispy": "crispy-cream.github.io",
|
"crispy": "crispy-cream.github.io",
|
||||||
|
"cozymy": "cozymy.github.io",
|
||||||
|
"cyber": "cyberdream.cf",
|
||||||
"d4rk":"divrk.github.io",
|
"d4rk":"divrk.github.io",
|
||||||
"darren":"reroute-cf-cname.darrennathanael.com",
|
"darren":"reroute-cf-cname.darrennathanael.com",
|
||||||
"demonkingswarn": "glitch.edgeapp.net",
|
"demonkingswarn": "glitch.edgeapp.net",
|
||||||
"dendydharmawan": "dendydharmawan.vercel.app",
|
"dendydharmawan": "dendydharmawan.vercel.app",
|
||||||
|
"descendo": "hayden-droid.github.io",
|
||||||
|
"duckinc": "0e139846-5714-4001-a085-6fe24b982068.id.repl.co",
|
||||||
"asep": "ruw3t.github.io",
|
"asep": "ruw3t.github.io",
|
||||||
"dontkill": "dontkill.github.io",
|
"dontkill": "dontkill.github.io",
|
||||||
|
"dvd": "arnon001.github.io/dvd"
|
||||||
"drmonocle": "monocledr.github.io",
|
"drmonocle": "monocledr.github.io",
|
||||||
|
"edrea": "edrea.netlify.app",
|
||||||
"empun": "empun.github.io",
|
"empun": "empun.github.io",
|
||||||
"fadla": "muhamad-fadla.github.io",
|
"fadla": "muhamad-fadla.github.io",
|
||||||
|
"farhan418": "farhan418.github.io",
|
||||||
"faris": "glitch.edgeapp.net",
|
"faris": "glitch.edgeapp.net",
|
||||||
|
"fcircle-doc": "hexo-circle-of-friends-doc.vercel.app",
|
||||||
"fivenine": "fivenine01.github.io",
|
"fivenine": "fivenine01.github.io",
|
||||||
"focus": "ffork.github.io",
|
"focus": "ffork.github.io",
|
||||||
|
"gnataraj": "gnataraj.github.io",
|
||||||
"goose": "scalgoon.github.io",
|
"goose": "scalgoon.github.io",
|
||||||
|
"gski": "matt-gski.github.io",
|
||||||
|
"hansen": "hansenkhi.github.io",
|
||||||
|
"homelyseven250": "cname.vercel-dns.com",
|
||||||
|
"hugotorres": "hugotorres.github.io",
|
||||||
|
"hycord": "hycord.github.io",
|
||||||
"ibrahim": "minidevz.github.io",
|
"ibrahim": "minidevz.github.io",
|
||||||
|
"icm": "icm185.github.io"
|
||||||
"ilham25": "ilham25.github.io",
|
"ilham25": "ilham25.github.io",
|
||||||
"ik3": "ik3.github.io",
|
"ik3": "ik3.github.io",
|
||||||
"imjustchew":"imjustchew.vercel.app",
|
"imjustchew":"imjustchew.vercel.app",
|
||||||
|
"joe": "overloaded.netlify.app",
|
||||||
"joyghosh": "joyghoshs.github.io",
|
"joyghosh": "joyghoshs.github.io",
|
||||||
"kaleko": "descriptive-elephant-q5l96t4xzbgih08kbc33zhaq.herokudns.com",
|
|
||||||
"kev": "kevinle108.github.io",
|
"kev": "kevinle108.github.io",
|
||||||
"keystove": "keystove.github.io",
|
"keystove": "keystove.github.io",
|
||||||
"kkdesigns": "kkdesigns.plasmic.site",
|
"kkdesigns": "kkdesigns.plasmic.site",
|
||||||
"koji": "portfolio-nextjs-gdm7chx6i-kojikanao.vercel.app",
|
"koji": "portfolio-nextjs-gdm7chx6i-kojikanao.vercel.app",
|
||||||
"lo0": "loralighte.github.io",
|
"lo0": "loralighte.github.io",
|
||||||
"lord-xenon": "lord-xenon.vercel.app",
|
"lord-xenon": "lord-xenon.vercel.app",
|
||||||
|
"mariusvw": "mariusvw.github.io",
|
||||||
"martinproject": "martinproject.github.io",
|
"martinproject": "martinproject.github.io",
|
||||||
"minlaxz": "minlaxz-info.web.app",
|
"mazengohar": "mazen-gohar-dev.onrender.com",
|
||||||
|
"mhmdrameez":"mhmdrameez.github.io",
|
||||||
|
"minlaxz": "minlaxz.github.io",
|
||||||
"nien": "nien.netlify.app",
|
"nien": "nien.netlify.app",
|
||||||
|
"nigelrex":"nigelrex.netlify.app",
|
||||||
"nikhil": "nikhilmwarrier.github.io",
|
"nikhil": "nikhilmwarrier.github.io",
|
||||||
|
"ninjaasmoke": "ninjaasmoke.github.io",
|
||||||
"noel": "noeljacob.github.io",
|
"noel": "noeljacob.github.io",
|
||||||
|
"o": "owlg.github.io",
|
||||||
"op": "op-bot.github.io",
|
"op": "op-bot.github.io",
|
||||||
|
"pablo": "itspablo.glitch.me",
|
||||||
|
"penguin": "bcyayay14.github.io",
|
||||||
"pers0n": "pers0n-dev.github.io",
|
"pers0n": "pers0n-dev.github.io",
|
||||||
|
"phelix": "phelixdusengimanaweb.vercel.app",
|
||||||
"pitermarx": "pitermarx.com",
|
"pitermarx": "pitermarx.com",
|
||||||
"piyush": "officialpiyush.github.io",
|
"piyush": "officialpiyush.github.io",
|
||||||
|
"rahulsya":"rahulsya.netlify.app",
|
||||||
|
"ponomarevlad": "ponomarevlad.github.io",
|
||||||
|
"proudmuslim": "proudmuslim-dev.github.io",
|
||||||
|
"quartz": "chrissquartz.cf",
|
||||||
|
"raiyan": "legendlife.github.io",
|
||||||
"richie": "richiesuper.github.io",
|
"richie": "richiesuper.github.io",
|
||||||
"rogerp": "rogerpanza.github.io",
|
"rogerp": "rogerpanza.github.io",
|
||||||
"rohmadkur": "rohmadkur.netlify.app",
|
"rohmadkur": "rohmadkur.netlify.app",
|
||||||
|
"roshan" : "roshan1337d.github.io",
|
||||||
"rhysjames": "rhysjamesmason.github.io",
|
"rhysjames": "rhysjamesmason.github.io",
|
||||||
"sazid": "palstheintrovert.github.io",
|
"sazid": "palstheintrovert.github.io",
|
||||||
|
"senhan07": "senhan07.github.io",
|
||||||
|
"sg":"sancho1952007.github.io",
|
||||||
"smartman": "smartmanru.github.io",
|
"smartman": "smartmanru.github.io",
|
||||||
"subtra3t": "subtra3t.github.io",
|
"subtra3t": "subtra3t.github.io",
|
||||||
"sulthan": "sulthan16.github.io",
|
"sulthan": "sulthan16.github.io",
|
||||||
"syofyanzuhad": "syofyanzuhad.github.io",
|
"shwampy": "shwamphub.github.io",
|
||||||
|
"suman": "thatsuman.github.io",
|
||||||
|
"syofyanzuhad": "syofyanzuhad.my.id",
|
||||||
"tanilayagirlar": "tanilayagirlar.github.io",
|
"tanilayagirlar": "tanilayagirlar.github.io",
|
||||||
"techout": "proxy.techout.tech",
|
"techout": "proxy.techout.tech",
|
||||||
"tejas": "992489e4-a9ae-485c-8a7e-e4c7bde03642.repl.co",
|
"tejas": "992489e4-a9ae-485c-8a7e-e4c7bde03642.repl.co",
|
||||||
"thanoskoutr": "thanoskoutr.github.io",
|
"thanoskoutr": "thanoskoutr.github.io",
|
||||||
"themoddedchicken": "themoddedchicken.github.io",
|
"themoddedchicken": "themoddedchicken.github.io",
|
||||||
|
"tilak": "perry-xd.github.io",
|
||||||
"tavignesh": "tavignesh-thedev-id.pages.dev",
|
"tavignesh": "tavignesh-thedev-id.pages.dev",
|
||||||
"tudor": "artsui.github.io",
|
"tudor": "artsui.github.io",
|
||||||
"uki": "uki.vercel.app",
|
"uki": "uki.vercel.app",
|
||||||
|
"vamshi":"vamshi126.github.io",
|
||||||
"vcharpentier": "vcharpentier.vercel.app",
|
"vcharpentier": "vcharpentier.vercel.app",
|
||||||
|
"victoneux": "victoneux.github.io",
|
||||||
|
"vishnu":"vishnu012.github.io",
|
||||||
"wassim": "wassimbenzarti.github.io",
|
"wassim": "wassimbenzarti.github.io",
|
||||||
"ionettyis": "api.has-cool.pics",
|
"ionettyis": "api.has-cool.pics",
|
||||||
"voltic": "jokerxtd.github.io/voltic.thedev.id",
|
"fastering": "fastering18.github.io",
|
||||||
|
"voltic": "jokerxtd.github.io",
|
||||||
|
"warr":"sweetchild08.github.io",
|
||||||
"wiktor": "wiktorwojcik112.github.io",
|
"wiktor": "wiktorwojcik112.github.io",
|
||||||
"yeff": "yeffycodegit.github.io",
|
"yeff": "yeffycodegit.github.io",
|
||||||
|
"youngchief": "youngchief.duckdns.org",
|
||||||
|
"zarconweb": "zaxyan.github.io",
|
||||||
"zen": "zen-sveltekit.vercel.app",
|
"zen": "zen-sveltekit.vercel.app",
|
||||||
"zh": "zh.github.io"
|
"zh": "zh.github.io",
|
||||||
|
"zuhaib": "powrhouseofthecell.github.io"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user