mirror of
https://github.com/tiennm99/thedev.id.git
synced 2026-10-11 03:13:45 +00:00
Merge branch 'main' into patch-1
This commit is contained in:
4 files changed
+37
-1768
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
+37
-6
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"a2a": "aykuttasil.github.io",
|
||||
"aalfiann": "aalfiann.github.io",
|
||||
"abibas": "41a900ff-6550-4b35-862e-99f1d21678bc.repl.co",
|
||||
"abhay": "032b2239-308b-43b4-ada1-c7e546fa62e6.id.repl.co",
|
||||
@@ -7,62 +8,88 @@
|
||||
"ahmadhayyan": "ahmadhayyan.github.io",
|
||||
"ahmedazhar05": "ahmedazhar05.github.io",
|
||||
"ahskript": "ahskript.github.io",
|
||||
"ali": "hmd-ali.github.io",
|
||||
"anamolsapkota": "anamolsapkota.github.io",
|
||||
"andy": "bungandy.github.io",
|
||||
"anil": "anilseervi.github.io",
|
||||
"anon": "glitch.edgeapp.net",
|
||||
"anon": "anondev.up.railway.app",
|
||||
"asacanell": "asacanell.github.io",
|
||||
"ash-hnry": "ash-hnry.github.io",
|
||||
"ashutosh": "ashutoshcoder.github.io",
|
||||
"ashwin" : "ashwin3082002.github.io",
|
||||
"asim": "asimbera.pages.dev",
|
||||
"asy": "asy.github.io",
|
||||
"appls": "appls2appls.github.io",
|
||||
"avyanshralph": "avyansh0001.github.io",
|
||||
"ayush": "iddev5.github.io",
|
||||
"bal": "vps35.heliohost.us",
|
||||
"boredcodebyk": "boredcodebyk.github.io",
|
||||
"breadomaticc": "breadomaticc.github.io",
|
||||
"cozmo": "cozmodev.github.io",
|
||||
"crispy": "crispy-cream.github.io",
|
||||
"cozymy": "cozymy.github.io",
|
||||
"d4rk":"divrk.github.io",
|
||||
"darren":"reroute-cf-cname.darrennathanael.com",
|
||||
"demonkingswarn": "glitch.edgeapp.net",
|
||||
"dendydharmawan": "dendydharmawan.vercel.app",
|
||||
"descendo": "hayden-droid.github.io",
|
||||
"duckinc": "0e139846-5714-4001-a085-6fe24b982068.id.repl.co",
|
||||
"asep": "ruw3t.github.io",
|
||||
"dontkill": "dontkill.github.io",
|
||||
"dvd": "arnon001.github.io/dvd"
|
||||
"drmonocle": "monocledr.github.io",
|
||||
"edrea": "edrea.netlify.app",
|
||||
"empun": "empun.github.io",
|
||||
"fadla": "muhamad-fadla.github.io",
|
||||
"faris": "glitch.edgeapp.net",
|
||||
"fivenine": "fivenine01.github.io",
|
||||
"focus": "ffork.github.io",
|
||||
"goose": "scalgoon.github.io",
|
||||
"hansen": "hansenkhi.github.io",
|
||||
"homelyseven250": "cname.vercel-dns.com",
|
||||
"hugotorres": "hugotorres.github.io",
|
||||
"hycord": "hycord.github.io",
|
||||
"ibrahim": "minidevz.github.io",
|
||||
"icm": "icm185.github.io"
|
||||
"ilham25": "ilham25.github.io",
|
||||
"ik3": "ik3.github.io",
|
||||
"imjustchew":"imjustchew.vercel.app",
|
||||
"joe": "joetancy.github.io",
|
||||
"joyghosh": "joyghoshs.github.io",
|
||||
"kaleko": "descriptive-elephant-q5l96t4xzbgih08kbc33zhaq.herokudns.com",
|
||||
"kev": "kevinle108.github.io",
|
||||
"keystove": "keystove.github.io",
|
||||
"kkdesigns": "kkdesigns.plasmic.site",
|
||||
"koji": "portfolio-nextjs-gdm7chx6i-kojikanao.vercel.app",
|
||||
"lo0": "loralighte.github.io",
|
||||
"lord-xenon": "lord-xenon.vercel.app",
|
||||
"mariusvw": "mariusvw.github.io",
|
||||
"martinproject": "martinproject.github.io",
|
||||
"minlaxz": "minlaxz-info.web.app",
|
||||
"minlaxz": "minlaxz.github.io",
|
||||
"nien": "nien.netlify.app",
|
||||
"nigelrex":"nigelrex.netlify.app",
|
||||
"nikhil": "nikhilmwarrier.github.io",
|
||||
"noel": "noeljacob.github.io",
|
||||
"o": "owlg.github.io",
|
||||
"op": "op-bot.github.io",
|
||||
"pablo": "itspablo.glitch.me",
|
||||
"penguin": "bcyayay14.github.io",
|
||||
"pers0n": "pers0n-dev.github.io",
|
||||
"phelix": "phelixdusengimanaweb.vercel.app",
|
||||
"pitermarx": "pitermarx.com",
|
||||
"piyush": "officialpiyush.github.io",
|
||||
"ponomarevlad": "ponomarevlad.github.io",
|
||||
"proudmuslim": "proudmuslim-dev.github.io",
|
||||
"richie": "richiesuper.github.io",
|
||||
"rogerp": "rogerpanza.github.io",
|
||||
"rohmadkur": "rohmadkur.netlify.app",
|
||||
"roshan" : "roshan1337d.github.io",
|
||||
"rhysjames": "rhysjamesmason.github.io",
|
||||
"sazid": "palstheintrovert.github.io",
|
||||
"senhan07": "senhan07.github.io",
|
||||
"smartman": "smartmanru.github.io",
|
||||
"subtra3t": "subtra3t.github.io",
|
||||
"sulthan": "sulthan16.github.io",
|
||||
"syofyanzuhad": "syofyanzuhad.github.io",
|
||||
"suman": "thatsuman.github.io",
|
||||
"syofyanzuhad": "syofyanzuhad.my.id",
|
||||
"tanilayagirlar": "tanilayagirlar.github.io",
|
||||
"techout": "proxy.techout.tech",
|
||||
"tejas": "992489e4-a9ae-485c-8a7e-e4c7bde03642.repl.co",
|
||||
@@ -72,11 +99,15 @@
|
||||
"tudor": "artsui.github.io",
|
||||
"uki": "uki.vercel.app",
|
||||
"vcharpentier": "vcharpentier.vercel.app",
|
||||
"vishnu":"vishnu012.github.io",
|
||||
"wassim": "wassimbenzarti.github.io",
|
||||
"ionettyis": "api.has-cool.pics",
|
||||
"fastering": "fastering18.github.io",
|
||||
"voltic": "jokerxtd.github.io/voltic.thedev.id",
|
||||
"wiktor": "wiktorwojcik112.github.io",
|
||||
"yeff": "yeffycodegit.github.io",
|
||||
"youngchief": "youngchief.duckdns.org",
|
||||
"zen": "zen-sveltekit.vercel.app",
|
||||
"zh": "zh.github.io"
|
||||
"zh": "zh.github.io",
|
||||
"zarconweb": "zaxyan.github.io"
|
||||
}
|
||||
Reference in new issue
Block a user