Free domain registration and practical DNS learning resources for everyone.
Markdown digitalplatdnsdns-tutorialdocumentationdomaindomain-platformdomain-registrationdomainnamedomainseducationfreefree-domainfreedomaininternet-infrastructurenameserver
add open source part
Edward Hsing0541f1562ac1
diff --git a/opensource/email_template/email_template.html b/opensource/email_template/email_template.htmlnew file mode 100644index 0000000..a9622f9--- /dev/null+++ b/opensource/email_template/email_template.html@@ -0,0 +1,72 @@++<!doctype html>+<html>+<head>+ <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">+ <style>+ body {+ background-color: #f9f9f9;+ font-family: Arial, sans-serif;+ margin: 0;+ padding: 0;+ }+ .container {+ max-width: 600px;+ margin: 20px auto;+ padding: 20px;+ background-color: #fff;+ border-radius: 10px;+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);+ }+ h1 {+ color: #333;+ font-size: 24px;+ margin-bottom: 10px;+ }+ p {+ color: #666;+ font-size: 16px;+ margin-bottom: 20px;+ }+ footer {+ margin-top: 20px;+ }+ .alert {+ background-color: #f5f5f5;+ border: 1px solid #ddd;+ padding: 15px;+ border-radius: 5px;+ color: #666;+ font-size: 14px;+ }+ a {+ color: #007bff;+ text-decoration: none;+ }+ a:hover {+ text-decoration: underline;+ }+ </style>+</head>+<body>+ <div class="container">+ <header>+ <h1>US.KG NIC</h1>+ <p>Registry Website: <a href="https://register.us.kg" target="_blank">register.us.kg</a></p>+ </header>+ <div>+ <h3>{{message}}</h3>+ </div>+ <footer>+ <div class="alert" role="alert">+ <br>+ This email is system-generated. Please do not reply. Have questions? Contact us at <a href="mailto:[email protected]">[email protected]</a>.+ <br>+ US.KG NIC+ <br>+ If you did not request this email, please disregard it.+ </div>+ </footer>+ </div>+</body>+</html>\ No newline at end of filediff --git a/opensource/frontend/domain_view.html b/opensource/frontend/domain_view.htmlnew file mode 100644index 0000000..d34a989--- /dev/null+++ b/opensource/frontend/domain_view.html@@ -0,0 +1,225 @@+<!doctype html>+<html lang="en">++<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>Manage Your Domain: {{domain_name}}</title>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">++ <!-- Bootstrap CSS -->+ <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #f1f3f4;+ display: flex;+ justify-content: center;+ align-items: center;+ min-height: 100vh;+ margin: 0;+ padding: 0;+ }++ .container {+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);+ padding: 30px;+ width: 100%;+ max-width: 900px;+ margin: 20px;+ }++ .nav-tabs .nav-link.active {+ background-color: #1a73e8;+ color: #ffffff;+ }++ .nav-tabs .nav-link {+ border-radius: 8px;+ margin-bottom: 10px;+ font-weight: 500;+ font-size: 1rem;+ }++ .tab-content {+ padding: 20px;+ background-color: #f1f3f4;+ border-radius: 8px;+ margin-left: 20px;+ flex-grow: 1;+ }++ .btn {+ background-color: #1a73e8;+ color: #ffffff;+ padding: 10px 20px;+ border-radius: 8px;+ transition: background-color 0.3s;+ }++ .btn:hover {+ background-color: #185abc;+ }++ .btn-warning {+ background-color: #fbbc04;+ color: #ffffff;+ }++ .btn-warning:hover {+ background-color: #e37400;+ }++ .btn-danger {+ background-color: #ea4335;+ color: #ffffff;+ }++ .btn-danger:hover {+ background-color: #c5221f;+ }+ </style>+</head>++<body>+ <div class="container">+ <div class="text-center mb-6">+ <h1 class="text-2xl font-semibold text-gray-900">Manage Your Domain: {{domain_name}}</h1>+ </div>+ <div class="bg-blue-100 text-gray-900 p-4 rounded-lg mb-6">+ <h3 class="font-medium">Your Domain Information:</h3>+ <ul class="list-disc pl-6 mt-2 space-y-2">+ <li><strong>Name:</strong> {{domain_name}}</li>+ <li><strong>Administrator:</strong> {{fullname}} ({{username}})</li>+ <li><strong>Renew:</strong> Always Free, renewal for the next year if there's less than 180 days left until expiry</li>+ <li><strong>Registration Date:</strong> {{regdate_show}}</li>+ <li><strong>Expire Date:</strong> {{expdate_show}}</li>+ </ul>+ </div>+ <div class="d-flex">+ <ul class="nav flex-column nav-tabs" id="myTab" role="tablist" style="width: 180px;">+ <li class="nav-item">+ <a class="nav-link active" id="ns-records-tab" data-toggle="tab" href="#ns-records" role="tab" aria-controls="ns-records" aria-selected="true">NS Records</a>+ </li>+ <li class="nav-item">+ <a class="nav-link" id="renew-tab" data-toggle="tab" href="#renew" role="tab" aria-controls="renew" aria-selected="false">Renew</a>+ </li>+ <li class="nav-item">+ <a class="nav-link" id="whois-privacy-tab" data-toggle="tab" href="#whois-privacy" role="tab" aria-controls="whois-privacy" aria-selected="false">WHOIS Privacy Protection</a>+ </li>+ <li class="nav-item">+ <a class="nav-link" id="cancel-domain-tab" data-toggle="tab" href="#cancel-domain" role="tab" aria-controls="cancel-domain" aria-selected="false">Cancel This Domain</a>+ </li>+ </ul>+ <div class="tab-content" id="myTabContent">+ <div class="tab-pane fade show active" id="ns-records" role="tabpanel" aria-labelledby="ns-records-tab">+ <p>The DNS server needs to be valid for the resolution to take effect and display correctly; otherwise, it will remain blank. Please allow up to several minutes for the NS records to update and appear after submission.</p>+ <form action="/panel/nameserver/update" method="GET">+ <div class="form-group">+ <label for="ns1"><span class="text-red-500">*</span> Name Server 1</label>+ <input type="text" name="ns1" id="ns1" value="{{ns1}}" placeholder="NS1" required class="form-control">+ </div>+ <div class="form-group">+ <label for="ns2"><span class="text-red-500">*</span> Name Server 2</label>+ <input type="text" name="ns2" id="ns2" value="{{ns2}}" placeholder="NS2" required class="form-control">+ </div>+ <div class="form-group">+ <label for="ns3">Name Server 3</label>+ <input type="text" name="ns3" id="ns3" value="{{ns3}}" placeholder="NS3" class="form-control">+ </div>+ <div class="form-group">+ <label for="ns4">Name Server 4</label>+ <input type="text" name="ns4" id="ns4" value="{{ns4}}" placeholder="NS4" class="form-control">+ </div>+ <input type="hidden" name="name" value="{{domain_name}}">+ <button type="submit" class="btn">Update</button>+ </form>+ </div>+ <div class="tab-pane fade" id="renew" role="tabpanel" aria-labelledby="renew-tab">+ <form action="/panel/renew/update" method="GET" target="_blank" class="mt-4">+ <input type="hidden" name="name" value="{{domain_name}}">+ <button type="submit" class="btn">Renew (if there's less than 180 days left until expiry)</button>+ </form>+ </div>+ <div class="tab-pane fade" id="whois-privacy" role="tabpanel" aria-labelledby="whois-privacy-tab">+ <p>WHOIS Privacy Protection is a service to protect your personal information from being publicly available through the WHOIS database. If you enable this service, your information won't be accessible through WHOIS queries.</p>+ <h5 class="mt-2">Current Status: <span class="badge text-bg-{{whois_protection_badge}}">{{whois_protection_status}}</span></h5>+ <form action="/panel/manager/enable_whois_protection" method="GET" target="_blank" class="mt-4">+ <input type="hidden" name="domain" value="{{domain_name}}">+ <button type="submit" class="btn btn-warning">Enable (After enabling, your information won't be accessible through WHOIS queries)</button>+ </form>+ <form action="/panel/manager/disable_whois_protection" method="GET" target="_blank" class="mt-4">+ <input type="hidden" name="domain" value="{{domain_name}}">+ <button type="submit" class="btn btn-warning">Disable WHOIS Protection</button>+ </form>+ </div>+ <div class="tab-pane fade" id="cancel-domain" role="tabpanel" aria-labelledby="cancel-domain-tab">+ <p>To free up unused domain names, we're introducing a new feature: you can now cancel domain names that you no longer need (i.e., delete this domain). Once a domain is canceled, your registration limit will be reset, allowing you to register new domains. When you request a cancellation, your domain will be immediately removed from the DNS root. After the global DNS sync completes (typically within 5-30 minutes), the domain name will be available for registration by you or anyone else. Please note that once you cancel a domain name, you will lose all management rights to it. Once released, anyone can register the domain name. Proceed with caution, as we will not be able to help you retrieve the domain name once it is canceled.</p>+ <button type="button" class="btn btn-danger" onclick="showCancelModal()">Danger Zone: Cancel this domain</button>++ <!-- Cancel Domain Modal -->+ <div class="modal fade" id="cancelModal" tabindex="-1" role="dialog" aria-labelledby="cancelModalLabel" aria-hidden="true">+ <div class="modal-dialog" role="document">+ <div class="modal-content">+ <div class="modal-header">+ <h5 class="modal-title" id="cancelModalLabel">Confirm Domain Cancellation</h5>+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">+ <span aria-hidden="true">×</span>+ </button>+ </div>+ <div class="modal-body">+ <p>To confirm the cancellation of the domain, please enter the domain name <strong>{{domain_name}}</strong> below:</p>+ <input type="text" id="confirmDomainName" class="form-control" placeholder="Enter domain name">+ <p class="mt-3 text-danger">Warning: This action is irreversible. Once canceled, the domain will be immediately available for registration by others.</p>+ </div>+ <div class="modal-footer">+ <form action="/panel/manager/cancel_domain" method="GET" id="cancelDomainForm" onsubmit="handleCancelDomainSubmit(event)">+ <input type="hidden" name="domain" value="{{domain_name}}">+ <button type="submit" class="btn btn-danger" id="confirmCancelBtn" disabled>Cancel Domain</button>+ </form>+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>+ </div>+ </div>+ </div>+ </div>++ </div>+ </div>+ </div>+ </div>++ <!-- Bootstrap JS and dependencies -->+ <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>+ <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>++ <script>+ function showCancelModal() {+ $('#cancelModal').modal('show');+ }++ document.getElementById('confirmDomainName').addEventListener('input', function () {+ const confirmBtn = document.getElementById('confirmCancelBtn');+ if (this.value === '{{domain_name}}') {+ confirmBtn.removeAttribute('disabled');+ } else {+ confirmBtn.setAttribute('disabled', 'true');+ }+ });++ function handleCancelDomainSubmit(event) {+ event.preventDefault();+ const confirmBtn = document.getElementById('confirmCancelBtn');+ confirmBtn.setAttribute('disabled', 'true');+ confirmBtn.textContent = 'Please wait...';+ document.getElementById('cancelDomainForm').submit();+ }+ </script>+</body>++</html>diff --git a/opensource/frontend/domainmgr.html b/opensource/frontend/domainmgr.htmlnew file mode 100644index 0000000..491eb78--- /dev/null+++ b/opensource/frontend/domainmgr.html@@ -0,0 +1,114 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>US.KG Domain Dashboard</title>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <!-- Font Awesome -->+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #f3f4f6;+ margin: 0;+ padding: 0;+ display: flex;+ flex-direction: column;+ min-height: 100vh;+ }+ .header {+ background-color: #1f2937;+ color: #ffffff;+ padding: 20px;+ text-align: center;+ }+ .container {+ flex: 1;+ display: flex;+ justify-content: center;+ align-items: center;+ padding: 20px;+ }+ .card {+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ padding: 20px;+ width: 100%;+ max-width: 600px;+ }+ .card-header {+ border-bottom: 1px solid #e2e8f0;+ padding-bottom: 10px;+ margin-bottom: 20px;+ text-align: center;+ }+ .card-header h1 {+ font-size: 1.5rem;+ font-weight: 600;+ color: #1a202c;+ }+ .list-group {+ list-style: none;+ padding: 0;+ margin: 0;+ }+ .list-group-item {+ padding: 10px 15px;+ border: 1px solid #e2e8f0;+ border-radius: 8px;+ margin-bottom: 10px;+ transition: background-color 0.3s, color 0.3s;+ }+ .list-group-item a {+ text-decoration: none;+ color: #1a202c;+ font-weight: 500;+ display: block;+ }+ .list-group-item:hover {+ background-color: #edf2f7;+ color: #2d3748;+ }+ .footer {+ background-color: #1f2937;+ color: #ffffff;+ text-align: center;+ padding: 10px;+ }+ </style>+</head>+<body>++ <div class="container">+ <div class="card">+ <div class="card-header">+ <h1>Your Domains</h1>+ </div>+ <ul class="list-group">+ {% for domain in domain_list %}+ <li class="list-group-item">+ <a href="/panel/manager/{{domain}}">{{domain}}</a>+ </li>+ {% endfor %}+ </ul>+ </div>+ </div>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+</script>+<script defer src="/_vercel/insights/script.js"></script>+<script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+</script>+<script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>\ No newline at end of filediff --git a/opensource/frontend/domainreg.html b/opensource/frontend/domainreg.htmlnew file mode 100644index 0000000..d9f5535--- /dev/null+++ b/opensource/frontend/domainreg.html@@ -0,0 +1,94 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>US.KG Domain Dashboard</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Font Awesome -->+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .container {+ width: 100%;+ max-width: 600px;+ margin: auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ transition: all 0.5s ease;+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .footer {+ background-color: #1a202c;+ color: #cbd5e0;+ padding: 20px;+ font-size: 14px;+ border-radius: 0 0 12px 12px;+ margin-top: auto;+ text-align: center;+ }+ footer a {+ color: #63b3ed;+ }+ footer a:hover {+ text-decoration: underline;+ }+ .input-group {+ display: flex;+ align-items: center;+ margin-bottom: 20px;+ }+ .input-group-prepend {+ background-color: #edf2f7;+ border: 1px solid #cbd5e0;+ padding: 10px;+ border-radius: 0 5px 5px 0;+ color: #4a5568;+ }+ </style>+</head>+<body>+ <div class="container mt-5">+ <h1 class="text-2xl font-semibold">Get a new domain</h1>+ <p>By continuing you agree to our <a href="https://nic.us.kg/terms-of-service/">Terms of Service</a>, <a href="https://nic.us.kg/privacy-policy/">Privacy Policy</a> and <a href="https://nic.us.kg/acceptable-use-policy/">Acceptable Use Policy</a></p>+ <p>Let's check if your domain name is available</p>+ <form action="/panel/register/check" method="GET">+ <label class="sr-only" for="name">Domain name</label>+ <div class="input-group mb-2">+ <input type="text" name="name" class="form-input block w-full px-4 py-3 mb-3 leading-tight text-gray-700 border rounded-lg focus:outline-none focus:bg-white" id="name" placeholder="Domain name" required>+ <div class="input-group-prepend">.us.kg</div>+ </div>+ <div class="flex justify-center">+ <button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Check</button>+ </div>+ </form>+ <br>+ <p>Domain name unavailable? Have a question? Contact: <a href="mailto:[email protected]" class="text-blue-500">[email protected]</a><br>If you encounter any problems, please create a new issue: <a href="https://github.com/DigitalPlatDev/US.KG-Issues/issues/new/choose" class="text-blue-500" target="_blank">Issue Report</a><br></p>+ </div>+</body>+</html>diff --git a/opensource/frontend/domainreg_check.html b/opensource/frontend/domainreg_check.htmlnew file mode 100644index 0000000..9d4d1cf--- /dev/null+++ b/opensource/frontend/domainreg_check.html@@ -0,0 +1,139 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>US.KG Domain Registration</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .container {+ width: 100%;+ max-width: 1000px;+ margin: auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ transition: all 0.5s ease;+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .title {+ font-size: 1.2rem;+ font-weight: 600;+ margin-left: 20px;+ color: #1a202c;+ }+ .alert {+ padding: 15px;+ border-radius: 5px;+ margin-bottom: 20px;+ }+ .alert-success {+ background-color: #d4edda;+ color: #155724;+ }+ .alert-light {+ background-color: #f8f9fa;+ color: #818182;+ }+ .domain-info-heading {+ font-size: 1.5rem;+ margin-bottom: 10px;+ }+ .domain-info-list {+ list-style-type: none;+ padding-left: 0;+ }+ .domain-info-list li {+ margin-bottom: 5px;+ }+ .domain-info-list li strong {+ width: 150px;+ display: inline-block;+ }+ .domain-name,+ .username {+ font-weight: bold;+ }+ </style>+</head>+<body>+ <div class="header">+ <div class="title">US.KG Domain Registration - Checkout</div>+ </div>+ <div class="container mx-auto px-4">+ <h2 class="text-xl font-bold mb-4">Domain Checkout</h2>+ <div class="alert alert-success" role="alert">+ {{regtips}}+ </div>+ <div class="alert alert-light" role="alert">+ <h3 class="domain-info-heading">Your domain information:</h3>+ <ul class="domain-info-list">+ <li><strong>Name:</strong> <span class="domain-name">{{domain_name}}.us.kg</span></li>+ <li><strong>Administrator:</strong> <span class="username">{{username}}</span></li>+ <li><strong>Price:</strong> Always free, with a default registration period of one year (365 days). Renewal is available for the next year when there are fewer than 180 days remaining until expiry. </li>+ </ul>+ </div>++ <form id="registrationForm" action="/panel/register/buy" method="POST" class="space-y-4">+ <div>+ <label for="ns1" class="block text-gray-700 font-bold mb-2"><span class="text-red-500">*</span> Name Server 1</label>+ <input type="text" name="ns1" id="ns1" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="NS1" required>+ </div>+ <div>+ <label for="ns2" class="block text-gray-700 font-bold mb-2"><span class="text-red-500">*</span> Name Server 2</label>+ <input type="text" name="ns2" id="ns2" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="NS2" required>+ </div>+ <div>+ <label for="ns3" class="block text-gray-700 font-bold mb-2">Name Server 3</label>+ <input type="text" name="ns3" id="ns3" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="NS3">+ </div>+ <div>+ <label for="ns4" class="block text-gray-700 font-bold mb-2">Name Server 4</label>+ <input type="text" name="ns4" id="ns4" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="NS4">+ </div>+ <input type="hidden" name="name" id="name" value="{{domain_name}}" required>+ <button id="registerButton" type="submit" class="w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">Register!</button>+ </form>+ </div>++ <script>+ document.getElementById("registrationForm").addEventListener("submit", function(event) {+ var registerButton = document.getElementById("registerButton");+ registerButton.disabled = true;+ registerButton.textContent = "Submitting...";+ });+ </script>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>+ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>diff --git a/opensource/frontend/domainreg_check_public.html b/opensource/frontend/domainreg_check_public.htmlnew file mode 100644index 0000000..17f0aa7--- /dev/null+++ b/opensource/frontend/domainreg_check_public.html@@ -0,0 +1,109 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>US.KG Domain Registration</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .container {+ width: 100%;+ max-width: 1000px;+ margin: auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ transition: all 0.5s ease;+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .title {+ font-size: 1.2rem;+ font-weight: 600;+ margin-left: 20px;+ color: #1a202c;+ }+ .alert {+ padding: 15px;+ border-radius: 5px;+ margin-bottom: 20px;+ }+ .alert-success {+ background-color: #d4edda;+ color: #155724;+ }+ .alert-light {+ background-color: #f8f9fa;+ color: #818182;+ }+ .domain-info-heading {+ font-size: 1.5rem;+ margin-bottom: 10px;+ }+ .domain-info-list {+ list-style-type: none;+ padding-left: 0;+ }+ .domain-info-list li {+ margin-bottom: 5px;+ }+ .domain-info-list li strong {+ width: 150px;+ display: inline-block;+ }+ .domain-name {+ font-weight: bold;+ }+ </style>+</head>+<body>+ <div class="header">+ <div class="title">US.KG Domain Registration - Check Domain Availability</div>+ </div>+ <div class="container mx-auto px-4">+ <h2 class="text-xl font-bold mb-4">Check Domain Availability</h2>+ <div class="alert alert-success" role="alert">+ {{regtips}}+ </div>+ <div class="alert alert-light" role="alert">+ <h3 class="domain-info-heading">Your domain information:</h3>+ <ul class="domain-info-list">+ <li><strong>Name:</strong> <span class="domain-name">{{domain_name}}.us.kg</span></li>+ <li><strong>Price:</strong> Always Free, Renewal for the Next Year if under 180 Days until Expiry</li>+ </ul>+ </div>+ <h4 class="domain-info-heading text-center mt-4">Sign up for a new account now! It only takes five minutes! And it's always free!</h4>+ </div>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>+ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>diff --git a/opensource/frontend/error.html b/opensource/frontend/error.htmlnew file mode 100644index 0000000..f29b6d3--- /dev/null+++ b/opensource/frontend/error.html@@ -0,0 +1,72 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta http-equiv="X-UA-Compatible" content="IE=edge">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Error!</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ justify-content: center;+ align-items: center;+ }+ .container {+ width: 100%;+ max-width: 600px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ padding: 20px;+ text-align: center;+ }+ .header__title h1 {+ font-size: 3rem;+ font-weight: 700;+ margin-bottom: 20px;+ }+ .header__text {+ font-size: 1.25rem;+ margin-bottom: 20px;+ }+ .header__button {+ background-color: #1a202c;+ color: #ffffff;+ padding: 10px 20px;+ border-radius: 5px;+ text-decoration: none;+ font-weight: 500;+ transition: background-color 0.3s;+ }+ .header__button:hover {+ background-color: #2d3748;+ }+ </style>+</head>+<body>+ <main class="container">+ <div class="content">+ <div class="header">+ <div class="header__title">+ <h1 class="header__h1">Error!</h1>+ </div>+ <p class="header__text">{{info}}</p>+ <a class="header__button" href="javascript:history.back()">Back</a>+ </div>+ </div>+ </main>+ <script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-fountain@2/tsparticles.preset.fountain.bundle.min.js"></script>+</body>+</html>diff --git a/opensource/frontend/info.html b/opensource/frontend/info.htmlnew file mode 100644index 0000000..3472112--- /dev/null+++ b/opensource/frontend/info.html@@ -0,0 +1,73 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta http-equiv="X-UA-Compatible" content="IE=edge">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>INFO!</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ justify-content: center;+ align-items: center;+ }+ .container {+ width: 100%;+ max-width: 600px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ padding: 20px;+ text-align: center;+ }+ .header__title h1 {+ font-size: 3rem;+ font-weight: 700;+ margin-bottom: 20px;+ }+ .header__text {+ font-size: 1.25rem;+ margin-bottom: 20px;+ }+ .header__button {+ background-color: #1a202c;+ color: #ffffff;+ padding: 10px 20px;+ border-radius: 5px;+ text-decoration: none;+ font-weight: 500;+ transition: background-color 0.3s;+ cursor: pointer;+ }+ .header__button:hover {+ background-color: #2d3748;+ }+ </style>+</head>+<body>+ <main class="container">+ <div class="content">+ <div class="header">+ <div class="header__title">+ <h1 class="header__h1">Woah</h1>+ </div>+ <p class="header__text">{{info}}</p>+ <a class="header__button" href="#" onclick="history.back(); return false;">Back</a>+ </div>+ </div>+ </main>+ <script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-fountain@2/tsparticles.preset.fountain.bundle.min.js"></script>+</body>+</html>diff --git a/opensource/frontend/login.html b/opensource/frontend/login.htmlnew file mode 100644index 0000000..e19bc90--- /dev/null+++ b/opensource/frontend/login.html@@ -0,0 +1,212 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>DigitalPlat Domain Registry and Management Authority</title>+ <link rel="icon" type="image/jpeg" href="/static/img/logo.jpg">+ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">+ <!-- Material Icons -->+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />++ <!-- Cloudflare Turnstile -->+ <script src="https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha" async defer></script>++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .container {+ width: 100%;+ max-width: 400px;+ margin: auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ transition: all 0.5s ease;+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .logo img {+ width: 80px;+ height: auto;+ border-radius: 50%;+ }+ .title {+ font-size: 1.2rem;+ font-weight: 600;+ margin-left: 20px;+ color: #1a202c;+ }+ .google-button {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ font-weight: 500;+ background-color: #e2e8f0;+ padding: 10px 15px;+ border-radius: 8px;+ transition: background-color 0.3s;+ }+ .google-button:hover {+ background-color: #cbd5e0;+ }+ .footer {+ background-color: #1a202c;+ color: #cbd5e0;+ padding: 20px;+ font-size: 14px;+ border-radius: 0 0 12px 12px;+ margin-top: auto;+ }+ footer a {+ color: #63b3ed;+ }+ footer a:hover {+ text-decoration: underline;+ }+ .loading-animation {+ border: 4px solid #f3f3f3;+ border-top: 4px solid #3498db;+ border-radius: 50%;+ width: 24px;+ height: 24px;+ animation: spin 2s linear infinite;+ margin: 0 auto 20px;+ display: none;+ }+ @keyframes spin {+ 0% { transform: rotate(0deg); }+ 100% { transform: rotate(360deg); }+ }+ .email-display {+ display: flex;+ align-items: center;+ justify-content: space-between;+ margin-bottom: 20px;+ }+ .email-display .material-symbols-outlined {+ font-size: 40px;+ color: #1a202c;+ margin-right: 10px;+ }+ .email-display p {+ flex-grow: 1;+ margin: 0;+ font-size: 1rem;+ color: #1a202c;+ }+ .email-display a {+ color: #3182ce;+ font-size: 0.875rem;+ }+ </style>+</head>+<body>+ <div class="header">+ <div class="logo">+ <img src="/static/img/logo.jpg" alt="DigitalPlat Domain Registry and Management Authority">+ </div>+ <div class="title">DigitalPlat Domain Registry and Management Authority</div>+ </div>+ <div class="container mx-auto px-4">+ <div id="loading" class="loading-animation"></div>+ <form id="loginForm" action="/auth/login" method="POST">+ <div id="step1">+ <div class="mb-4">+ <label for="email" class="block text-gray-700 text-sm font-bold mb-2">E-Mail</label>+ <input type="email" name="email" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="email" placeholder="Enter your email" required>+ </div>+ <div class="flex items-center justify-between">+ <button type="button" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" onclick="nextStep()">Next</button>+ </div>+ </div>+ <div id="step2" class="hidden opacity-0 transition-opacity duration-500 ease-in-out">+ <div class="email-display">+ <span class="material-symbols-outlined">account_circle</span>+ <p id="displayEmail" class="text-gray-700"></p>+ <a href="javascript:void(0)" onclick="editEmail()">Edit</a>+ </div>+ <div class="mb-4">+ <label for="password" class="block text-gray-700 text-sm font-bold mb-2">Password</label>+ <input type="password" name="password" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="password" placeholder="Enter your password" required>+ </div>+ <!-- Cloudflare Turnstile reCAPTCHA -->+ <div class="g-recaptcha mb-4" data-sitekey="0x4AAAAAAAxuMrGCYFcOwd1N"></div>+ <div class="flex items-center justify-between">+ <button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">+ Login+ </button>+ </div>+ </div>+ <div class="text-center mt-4">+ <small>Don't have an account? <a href="/auth/register" class="text-blue-500">Sign up</a> now!</small><br>+ <small>Forgot password? <a href="/auth/reset-password" class="text-blue-500">Reset Password</a></small>+ </div>+ </form>+ <div class="text-center mt-4">+ <a class="google-button" href="/auth/login/google" role="button">+ <img width="20px" alt="Google sign-in" src="/static/img/login/glogo.webp" />+ Sign in with Google+ </a>+ </div>+ </div>+ <footer class="footer">+ <div class="text-center">+ <small>+ By continuing you agree to our <a href="https://nic.us.kg/terms-of-service/">Terms of Service</a>, <a href="https://nic.us.kg/privacy-policy/">Privacy Policy</a>, and <a href="https://nic.us.kg/acceptable-use-policy/">Acceptable Use Policy</a>.<br>+ If you encounter any problems, please create a new issue: <a href="https://github.com/DigitalPlatDev/US.KG-Issues/issues/new/choose">Issue Report</a><br>+ The 'Sign in with Google' is currently only accessible for accounts registered with Gmail+ </small>+ </div>+ </footer>++ <script>+ function nextStep() {+ const email = document.getElementById('email').value;+ if (email) {+ document.getElementById('step1').classList.add('hidden');+ document.getElementById('loading').style.display = 'block';+ setTimeout(() => {+ document.getElementById('loading').style.display = 'none';+ const step2 = document.getElementById('step2');+ document.getElementById('displayEmail').innerText = email;+ step2.classList.remove('hidden');+ step2.classList.add('opacity-100');+ }, 600); // Simulate a loading time of 0.6 second+ }+ }++ function editEmail() {+ document.getElementById('step2').classList.add('hidden');+ document.getElementById('step1').classList.remove('hidden');+ }++ document.getElementById('email').addEventListener('keypress', function(event) {+ if (event.key === 'Enter') {+ event.preventDefault();+ nextStep();+ }+ });+ </script>+</body>+</html>diff --git a/opensource/frontend/overview.html b/opensource/frontend/overview.htmlnew file mode 100644index 0000000..6047aeb--- /dev/null+++ b/opensource/frontend/overview.html@@ -0,0 +1,176 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <title>DigitalPlat Domain Dashboard</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Font Awesome -->+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #f3f4f6;+ padding: 20px;+ }+ .btn {+ background-color: #1f2937;+ color: #ffffff;+ padding: 10px 20px;+ border-radius: 0.5rem;+ transition: background-color 0.3s;+ }+ .btn:hover {+ background-color: #374151;+ }+ </style>+</head>+<body class="bg-gray-100 text-gray-900">++ <header class="text-center py-10">+ <h1 class="text-4xl font-semibold">Welcome to DigitalPlat Domain Dashboard!</h1>+ </header>++ <main class="container mx-auto px-4">++ <section class="mb-8">+ <h2 class="text-2xl font-semibold mb-4">Overview</h2>+ <div class="alert alert-primary bg-blue-100 text-blue-800 p-4 rounded-md shadow-md mb-6">+ {{notice}}+ </div>+ <div class="alert alert-primary bg-blue-100 text-blue-800 p-4 rounded-md shadow-md mb-6">+ 🆕 Join the official <a href="https://t.me/digitalplatdomain" target="_blank" class="text-blue-600 hover:underline">DigitalPlat FreeDomain Telegram group</a> or <a href="https://discord.gg/7mrqAAqcSa" target="_blank" class="text-blue-600 hover:underline">Discord server</a> today! Be the first to know about the latest updates and happenings! Got questions? Facing challenges? Or simply want to show off your awesome builds? Don’t wait—become part of our community now! 🚀+ </div>+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">+ <div class="small-box bg-blue-600 text-white p-6 rounded-md shadow-md flex items-center justify-between">+ <div>+ <h3 class="text-3xl font-semibold">{{domains}}</h3>+ <p class="mt-2">My domains</p>+ </div>+ <div class="icon text-5xl opacity-75">+ <i class="fas fa-cloud"></i>+ </div>+ </div>++ <div class="small-box bg-green-600 text-white p-6 rounded-md shadow-md flex items-center justify-between">+ <div>+ <h3 class="text-3xl font-semibold">{{max_reg}}</h3>+ <p class="mt-2">Domain name maximum registration limit</p>+ <p class="mt-1 text-sm">Need more? No worries! Click the "Need more domains?" button on the left side of the panel. (Cause we are non-profit!)</p>+ </div>+ <div class="icon text-5xl opacity-75">+ <i class="fas fa-info"></i>+ </div>+ </div>+ </div>+ </section>++ <section class="mb-8">+ <div class="card bg-white shadow-md rounded-md overflow-hidden mb-6">+ <div class="card-header bg-gray-800 text-white p-4">+ <h3 class="text-xl">My Domains:</h3>+ </div>+ <div class="card-body p-4">+ <table class="min-w-full bg-white">+ <thead>+ <tr>+ <th class="py-2 px-4 bg-gray-100 text-left">#</th>+ <th class="py-2 px-4 bg-gray-100 text-left">Domain</th>+ </tr>+ </thead>+ <tbody>+ {% for domain in domains_list %}+ <tr>+ <td class="border-t py-2 px-4">{{ loop.index }}</td>+ <td class="border-t py-2 px-4">{{ domain }}</td>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ </div>++ <div class="card bg-white shadow-md rounded-md overflow-hidden mb-6">+ <div class="card-header bg-gray-800 text-white p-4">+ <h3 class="text-xl">Expire soon:</h3>+ </div>+ <div class="card-body p-4">+ <table class="min-w-full bg-white">+ <thead>+ <tr>+ <th class="py-2 px-4 bg-gray-100 text-left">#</th>+ <th class="py-2 px-4 bg-gray-100 text-left">Domain</th>+ <th class="py-2 px-4 bg-gray-100 text-left">Expire Date</th>+ </tr>+ </thead>+ <tbody>+ {% for key, value in expire_soon.items() %}+ <tr>+ <td class="border-t py-2 px-4">{{ loop.index }}</td>+ <td class="border-t py-2 px-4">{{ key }}</td>+ <td class="border-t py-2 px-4">{{ value }}</td>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ </div>+ </section>++ <section class="mb-8">+ <h2 class="text-2xl font-semibold mb-4">What are you looking for?</h2>+ <div class="flex flex-wrap gap-4 mb-6">+ <button class="btn" onclick="window.location.href = '/panel/register';">Domain name registration</button>+ <button class="btn" onclick="window.location.href = '/panel/domains';">Manage my domains</button>+ </div>++ <h2 class="text-2xl font-semibold mb-4">My Account / WHOIS Information</h2>+ <div class="card bg-white shadow-md rounded-md overflow-hidden mb-6">+ <div class="card-body p-4">+ <table class="min-w-full bg-white">+ <tbody>+ <tr>+ <td class="py-2 px-4 bg-gray-100 text-left font-semibold">Username:</td>+ <td class="py-2 px-4 bg-white">{{username}}</td>+ </tr>+ <tr>+ <td class="py-2 px-4 bg-gray-100 text-left font-semibold">Fullname:</td>+ <td class="py-2 px-4 bg-white">{{fullname}}</td>+ </tr>+ <tr>+ <td class="py-2 px-4 bg-gray-100 text-left font-semibold">Email:</td>+ <td class="py-2 px-4 bg-white">{{email}}</td>+ </tr>+ <tr>+ <td class="py-2 px-4 bg-gray-100 text-left font-semibold">Phone:</td>+ <td class="py-2 px-4 bg-white">{{phone}}</td>+ </tr>+ <tr>+ <td class="py-2 px-4 bg-gray-100 text-left font-semibold">Address:</td>+ <td class="py-2 px-4 bg-white">{{address}}</td>+ </tr>+ <tr>+ <td class="py-2 px-4 bg-gray-100 text-left font-semibold">Account ID:</td>+ <td class="py-2 px-4 bg-white"><b>{{userid}}</b></td>+ </tr>+ </tbody>+ </table>+ </div>+ </div>+ <div class="flex flex-wrap gap-4">+ <button class="btn" onclick="window.location.href = '/auth/user/edit';">Account Information / Edit WHOIS</button>+ <button class="btn" onclick="window.location.href = '/logout';">Logout</button>+ </div>+ </section>++ </main>++</body>+</html>diff --git a/opensource/frontend/panel.html b/opensource/frontend/panel.htmlnew file mode 100644index 0000000..f72235a--- /dev/null+++ b/opensource/frontend/panel.html@@ -0,0 +1,357 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1">+ <link rel="icon" type="image/jpeg" href="/static/img/logo.jpg">+ <title>DigitalPlat Domain Panel</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Font Awesome -->+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #f3f4f6;+ display: flex;+ min-height: 100vh;+ flex-direction: column;+ }+ .sidebar {+ width: 250px;+ background-color: #111827;+ color: #f9fafb;+ padding: 20px;+ position: fixed;+ height: 100vh;+ transition: width 0.3s, transform 0.3s;+ overflow: hidden;+ }+ .sidebar.collapsed {+ width: 70px;+ }+ .sidebar a {+ color: #9ca3af;+ text-decoration: none;+ padding: 10px;+ display: flex;+ align-items: center;+ border-radius: 0.375rem;+ transition: background-color 0.3s, color 0.3s;+ }+ .sidebar a i {+ width: 30px;+ text-align: center;+ }+ .sidebar.collapsed a {+ justify-content: center;+ }+ .sidebar.collapsed a:hover {+ background-color: #1f2937;+ color: #ffffff;+ }+ .sidebar a:hover {+ background-color: #1f2937;+ color: #ffffff;+ }+ .sidebar .brand-logo {+ display: flex;+ align-items: center;+ margin-bottom: 20px;+ gap: 15px;+ }+ .sidebar .brand-logo img {+ border-radius: 50%;+ width: 50px;+ }+ .sidebar.collapsed .brand-logo {+ justify-content: center;+ }+ .sidebar.collapsed .brand-logo span,+ .sidebar.collapsed .nav-text {+ display: none;+ }+ .collapse-btn {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 100%;+ padding: 10px 0;+ border: none;+ background: none;+ color: #9ca3af;+ cursor: pointer;+ transition: color 0.3s;+ margin-bottom: 20px;+ }+ .collapse-btn:hover {+ color: #ffffff;+ }+ .main-content {+ margin-left: 250px;+ padding: 20px;+ flex-grow: 1;+ transition: margin-left 0.3s;+ }+ .main-content.expanded {+ margin-left: 70px;+ }+ .navbar {+ background-color: #ffffff;+ border-bottom: 1px solid #e5e7eb;+ padding: 10px 20px;+ display: flex;+ justify-content: space-between;+ align-items: center;+ }+ .navbar a {+ color: #1f2937;+ text-decoration: none;+ margin-right: 20px;+ font-weight: 500;+ }+ .navbar .dropdown-menu {+ background-color: #ffffff;+ border: 1px solid #e5e7eb;+ border-radius: 0.375rem;+ padding: 10px;+ }+ .footer {+ background-color: #111827;+ color: #f9fafb;+ padding: 10px 20px;+ text-align: center;+ width: 100%;+ position: fixed;+ bottom: 0;+ }+ @media (max-width: 768px) {+ .sidebar {+ width: 100%;+ height: auto;+ position: fixed;+ transform: translateY(-100%);+ top: 0;+ left: 0;+ z-index: 10;+ transition: transform 0.3s;+ }+ .sidebar.visible {+ transform: translateY(0);+ }+ .main-content {+ margin-left: 0;+ }+ .overlay {+ display: none;+ position: fixed;+ top: 0;+ left: 0;+ width: 100%;+ height: 100%;+ background: rgba(0, 0, 0, 0.5);+ z-index: 9;+ }+ .overlay.visible {+ display: block;+ }+ }+ .loading-spinner {+ position: fixed;+ top: 50%;+ left: 50%;+ transform: translate(-50%, -50%);+ border: 4px solid rgba(0, 0, 0, 0.1);+ border-radius: 50%;+ border-top: 4px solid #3498db;+ width: 40px;+ height: 40px;+ -webkit-animation: spin 1s linear infinite;+ animation: spin 1s linear infinite;+ z-index: 9999;+ }++ @-webkit-keyframes spin {+ 0% { -webkit-transform: rotate(0deg); }+ 100% { -webkit-transform: rotate(360deg); }+ }++ @keyframes spin {+ 0% { transform: rotate(0deg); }+ 100% { transform: rotate(360deg); }+ }+ </style>+</head>+<body>+ <div class="overlay" onclick="toggleSidebar()"></div>+ <div id="loading-spinner" class="loading-spinner"></div>+ <aside class="sidebar">+ <div class="brand-logo">+ <img src="/static/img/logo.jpg" alt="USKG LOGO">+ <span class="text-lg font-semibold">DigitalPlat FreeDomain Panel</span>+ </div>+ <button class="collapse-btn" onclick="toggleSidebar()">+ <i class="fas fa-bars"></i>+ </button>+ <nav>+ <a href="#" onclick="loadPage(this, '/panel/overview'); return false;" class="active">+ <i class="fas fa-tachometer-alt"></i> <span class="nav-text">Dashboard</span>+ </a>+ <a href="#" onclick="loadPage(this, '/panel/domains'); return false;">+ <i class="fas fa-globe"></i> <span class="nav-text">My Domains</span>+ </a>+ <a href="#" onclick="loadPage(this, '/panel/register'); return false;">+ <i class="fas fa-edit"></i> <span class="nav-text">Domain Registration</span>+ </a>+ <a href="#" onclick="loadPage(this, '/auth/user/edit'); return false;">+ <i class="fas fa-user"></i> <span class="nav-text">My Account</span>+ </a>+ <a href="#" onclick="loadPage(this, '/whois/ui'); return false;">+ <i class="fas fa-search"></i> <span class="nav-text">Whois</span>+ </a>+ <a href="https://hcb.hackclub.com/donations/start/digitalplat">+ <i class="fas fa-donate"></i> <span class="nav-text">Donate</span>+ </a>+ <a href="https://forms.gle/sUmyMh154Q3G1PU56">+ <i class="fas fa-exclamation"></i> <span class="nav-text">Report Abuse</span>+ </a>+ <a href="https://forms.gle/ASrRCviu16wSc7bc6">+ <i class="fas fa-arrows-alt"></i> <span class="nav-text">Need more domains?</span>+ </a>+ <a href="https://nic.us.kg">+ <i class="fas fa-globe"></i> <span class="nav-text">US.KG NIC</span>+ </a>+ <a href="/logout">+ <i class="fas fa-sign-out-alt"></i> <span class="nav-text">Logout</span>+ </a>+ </nav>+ </aside>+ <div class="main-content">+ <nav class="navbar">+ <div>+ <a href="/">US.KG</a>+ <a href="/panel/domains">Domain List</a>+ <a href="/panel/register">Register</a>+ <a href="/auth/user/edit">My Account</a>+ </div>+ <button class="collapse-btn navbar-toggle-btn md:hidden" onclick="toggleSidebar()">+ <i class="fas fa-bars"></i>+ </button>+ </nav>+ <div class="content-wrapper">+ <iframe src="/panel/overview" id="content-frame" frameborder="0" scrolling="auto" style="width: 100%; height: calc(100vh - 60px);" allowfullscreen onload="hideLoadingSpinner()"></iframe>+ </div>+ </div>+ <footer class="footer">+ <div>+ <b>US.KG Panel</b> Open in <a href="#" onclick="openPageInNewTab()" class="text-blue-500">New Tab</a> <a href="#" onclick="toggleFullscreen()" class="text-blue-500">Fullscreen</a>+ </div>+ </footer>++ <script>+ function toggleSidebar() {+ const sidebar = document.querySelector('.sidebar');+ const overlay = document.querySelector('.overlay');+ const isMobile = window.innerWidth <= 768;++ if (isMobile) {+ sidebar.classList.toggle('visible');+ overlay.classList.toggle('visible');+ } else {+ sidebar.classList.toggle('collapsed');+ const mainContent = document.querySelector('.main-content');+ mainContent.classList.toggle('expanded');+ }+ }++ function loadPage(link, url) {+ const navLinks = document.querySelectorAll('.sidebar a');+ navLinks.forEach(navLink => navLink.classList.remove('active'));+ link.classList.add('active');++ const contentFrame = document.getElementById('content-frame');+ showLoadingSpinner();++ contentFrame.src = url;++ // Hide sidebar and overlay on mobile after selecting a page+ if (window.innerWidth <= 768) {+ const sidebar = document.querySelector('.sidebar');+ const overlay = document.querySelector('.overlay');+ sidebar.classList.remove('visible');+ overlay.classList.remove('visible');+ }+ }++ function showLoadingSpinner() {+ const loadingSpinner = document.getElementById('loading-spinner');+ loadingSpinner.style.display = 'block';+ }++ function hideLoadingSpinner() {+ const loadingSpinner = document.getElementById('loading-spinner');+ loadingSpinner.style.display = 'none';+ }++ function openPageInNewTab() {+ const iframeUrl = document.getElementById('content-frame').src;+ window.open(iframeUrl);+ }++ function toggleFullscreen() {+ const iframe = document.getElementById('content-frame');+ if (iframe.requestFullscreen) {+ if (document.fullscreenElement) {+ document.exitFullscreen();+ } else {+ iframe.requestFullscreen();+ }+ } else if (iframe.mozRequestFullScreen) {+ if (document.mozFullScreenElement) {+ document.mozCancelFullScreen();+ } else {+ iframe.mozRequestFullScreen();+ }+ } else if (iframe.webkitRequestFullscreen) {+ if (document.webkitFullscreenElement) {+ document.webkitExitFullscreen();+ } else {+ iframe.webkitRequestFullscreen();+ }+ } else if (iframe.msRequestFullscreen) {+ if (document.msFullscreenElement) {+ document.msExitFullscreen();+ } else {+ iframe.msRequestFullscreen();+ }+ }+ }++ document.addEventListener('DOMContentLoaded', function () {+ const contentFrame = document.getElementById('content-frame');+ showLoadingSpinner();+ if (contentFrame) {+ contentFrame.addEventListener('load', function () {+ hideLoadingSpinner();+ });+ }+ });+ </script>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>++ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>+diff --git a/opensource/frontend/pay_success.html b/opensource/frontend/pay_success.htmlnew file mode 100644index 0000000..c599cb9--- /dev/null+++ b/opensource/frontend/pay_success.html@@ -0,0 +1,90 @@+<!doctype html>+<html>+<head>+ <!-- Fonts -->+ <link rel="stylesheet" href="/static/css/font.css">+ <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">+ <link href="/static/css/bootstrap.min.css" rel="stylesheet">+ <style>+ .checkout-container {+ max-width: 1000px;+ margin: 10% auto;+ padding: 30px;+ background-color: #ffffff;+ border-radius: 5px;+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);+ }+ .container {+ display: flex;+ justify-content: center;+ align-items: center;+ height: 300px;+ }+ .container img {+ opacity: 0;+ transition: opacity 0.5s;+ }+ .container img.show {+ opacity: 1;+ }+ @keyframes fadeIn {+ from {+ opacity: 0;+ }+ to {+ opacity: 1;+ }+ }+ .image-animation {+ animation: fadeIn 1s ease-in-out;+ }+ </style>+ <meta charset="utf-8">+ <title>Successful purchase!</title>+</head>+<body>+ <div class="checkout-container">+ <nav class="navbar navbar-light bg-light">+ <div class="container-fluid">+ <span class="navbar-brand mb-0 h1">Successful purchase!</span>+ </div>+ </nav>+ <div class="p-5 mb-4 bg-light rounded-3">+ <div class="container-fluid py-5">+ <h1 class="display-5 fw-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Thanks!</font></font></h1>+ <p class="col-md-8 fs-4"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"></font><font style="vertical-align: inherit;">Your domain name has been successfully created and submitted to the root DNS. Kindly allow up to 20 minutes or longer for the domain name resolution record and registration to take effect.</font></font></p>+ </div>+ </div>+ <div class="alert alert-light" role="alert">+ <div class="container">+ <img id="image" src="/static/img/completed.png" alt="completed" width="200" height="200" class="image-animation">+ </div>+ <h3>The domain name will be added to your list, and you'll have full control to manage and operate it.</h3>+ </div>+ <button class="btn btn-primary" onclick="window.location.href='/panel/overview'">Back to panel</button>+ <footer>+ <div class="alert alert-light" role="alert">+ <br>+ If you encounter any problems, please create a new issue: <a href="https://github.com/DigitalPlatDev/US.KG-Issues/issues/new/choose">Issue Report</a><br>+ <br>+ DigitalPlat Foundation+ </div>+ </footer>+ </div>+ <script src="/static/js/bootstrap.bundle.js"></script>+ <script>+ window.addEventListener('DOMContentLoaded', function() {+ var image = document.getElementById('image');+ image.classList.add('show');+ });+ </script>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>+ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>diff --git a/opensource/frontend/register.html b/opensource/frontend/register.htmlnew file mode 100644index 0000000..57fb55a--- /dev/null+++ b/opensource/frontend/register.html@@ -0,0 +1,287 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <link rel="icon" type="image/jpeg" href="/static/img/logo.jpg">+ <title>DigitalPlat FreeDomain - Register</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <!-- Cloudflare Turnstile -->+ <script src="https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha" async defer></script>++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ }+ .container {+ width: 100%;+ max-width: 400px;+ margin: 5% auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .logo img {+ width: 80px; /* Adjusted size */+ height: auto;+ border-radius: 50%; /* Circular border */+ }+ .title {+ font-size: 1.2rem;+ font-weight: 600;+ margin-left: 20px;+ color: #1a202c;+ }+ .google-button {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ font-weight: 500;+ background-color: #e2e8f0; /* Subtle background */+ padding: 10px 15px;+ border-radius: 8px;+ transition: background-color 0.3s;+ }+ .google-button:hover {+ background-color: #cbd5e0;+ }+ .footer {+ background-color: #1a202c;+ color: #cbd5e0;+ padding: 20px;+ font-size: 14px;+ border-radius: 0 0 12px 12px;+ }+ footer a {+ color: #63b3ed;+ }+ footer a:hover {+ text-decoration: underline;+ }+ </style>+</head>+<body>+ <div class="header">+ <div class="logo">+ <img src="/static/img/logo.jpg" alt="DigitalPlat Domain Registry and Management Authority">+ </div>+ <div class="title">DigitalPlat Domain Registry and Management Authority</div>+ </div>+ <div class="container mx-auto px-4">+ <form id="registerForm" action="/auth/register" method="POST">+ <div class="mb-4">+ <label for="username" class="block text-gray-700 text-sm font-bold mb-2">Username</label>+ <input type="text" name="username" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="username" placeholder="Username" required>+ <small id="usernameError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="fullname" class="block text-gray-700 text-sm font-bold mb-2">Legal full name</label>+ <small class="text-gray-600">Once registered, the legal full name cannot be edited! Please ensure it matches the name on the KYC documents you upload after registration, otherwise, KYC verification will fail!</small>+ <input type="text" name="fullname" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="fullname" placeholder="Your Name" required>+ <small id="fullnameError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="email" class="block text-gray-700 text-sm font-bold mb-2">E-Mail</label>+ <small class="text-gray-600"><b>WARNING:</b> Starting from October 22, 2024, if your email domain is on the following list, you can continue using GitHub's free KYC option. The approved domains are:++ gmail.com,+ zoho.com,+ outlook.com,+ yahoo.com,+ yandex.com,+ hotmail.com,+ icloud.com,+ 163.com,+ 126.com,+ qq.com,+ <b>To use our services for free and prevent misuse, please try to use email addresses with these domains.</b>+ </small>+ <input type="email" name="email" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="email" placeholder="[email protected]" required>+ <small id="emailError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="phone" class="block text-gray-700 text-sm font-bold mb-2">Phone (format: +1-3100000000)</label>+ <small class="text-gray-600">Please make sure your phone number is correct, we may contact you via SMS</small>+ <input type="text" name="phone" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="phone" placeholder="+X-XXXXXXXXXX" required>+ <small id="phoneError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="address" class="block text-gray-700 text-sm font-bold mb-2">Full Address</label>+ <textarea id="address" name="address" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="1000 Santa Monica Blvd, Santa Monica, CA 90401, United States" required></textarea>+ <small id="addressError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="password" class="block text-gray-700 text-sm font-bold mb-2">Password</label>+ <input type="password" name="password" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" id="password" placeholder="Password" autocomplete="off" required>+ <small id="passwordHelp" class="form-text text-gray-600">The password must be more than 8 characters long and include uppercase and lowercase letters as well as numbers. It must not include &, *, ', ", <, >, \, /, or spaces.</small>+ </div>+ <div class="mb-4">+ <label for="confirmPassword" class="block text-gray-700 text-sm font-bold mb-2">Confirm Password</label>+ <input type="password" name="confirmPassword" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" id="confirmPassword" placeholder="Confirm Password" autocomplete="off" required>+ <small id="confirmPasswordError" class="text-red-500"></small>+ </div>+ <!-- Cloudflare Turnstile Google reCAPTCHA -->+ <div class="g-recaptcha mb-4" data-sitekey="{{ sitekey }}"></div>+ <small class="text-gray-600">Please ensure that the information provided is genuine and valid. Each individual/organization is strictly limited to a maximum of one account.</small>+ <div class="operation flex justify-center mt-4">+ <button type="submit" id="registerButton" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" disabled>Register!</button>+ </div>+ </form>+ </div>+ <footer class="footer">+ <div class="text-center">+ <small>+ By continuing you agree to our <a href="https://nic.us.kg/terms-of-service/">Terms of Service</a>, <a href="https://nic.us.kg/privacy-policy/">Privacy Policy</a>, and <a href="https://nic.us.kg/acceptable-use-policy/">Acceptable Use Policy</a>.<br>+ If you encounter any problems, please create a new issue: <a href="https://github.com/DigitalPlatDev/US.KG-Issues/issues/new/choose">Issue Report</a><br>+ </small>+ </div>+ </footer>+ <script>+ document.addEventListener('DOMContentLoaded', function () {+ const usernameInput = document.getElementById('username');+ const fullnameInput = document.getElementById('fullname');+ const emailInput = document.getElementById('email');+ const phoneInput = document.getElementById('phone');+ const addressInput = document.getElementById('address');+ const passwordInput = document.getElementById('password');+ const confirmPasswordInput = document.getElementById('confirmPassword');+ const registerButton = document.getElementById('registerButton');++ usernameInput.addEventListener('input', validateForm);+ fullnameInput.addEventListener('input', validateForm);+ emailInput.addEventListener('input', validateForm);+ phoneInput.addEventListener('input', validateForm);+ addressInput.addEventListener('input', validateForm);+ passwordInput.addEventListener('input', validateForm);+ confirmPasswordInput.addEventListener('input', validateForm);++ function validateForm() {+ let isValid = true;++ // Validate Username+ if (usernameInput.value.length < 5) {+ document.getElementById('usernameError').innerText = 'Username must be at least 5 characters long.';+ isValid = false;+ } else if (usernameInput.value.length > 50) {+ document.getElementById('usernameError').innerText = 'Username is too long.';+ isValid = false;+ } else if (/\s/.test(usernameInput.value)) {+ document.getElementById('usernameError').innerText = 'Username must not contain spaces.';+ isValid = false;+ } else {+ document.getElementById('usernameError').innerText = '';+ }++ // Validate Legal Full Name+ if (!fullnameInput.value.includes(' ')) {+ document.getElementById('fullnameError').innerText = 'Legal full name must contain at least one space.';+ isValid = false;+ } else if (fullnameInput.value.length > 50) {+ document.getElementById('fullnameError').innerText = 'Full name is too long.';+ isValid = false;+ } else {+ document.getElementById('fullnameError').innerText = '';+ }++ // Validate Email+ const emailRegex = /^[^.+]*@gmail\.com$/;+ if (emailInput.value.length > 50) {+ document.getElementById('emailError').innerText = 'Email is too long.';+ isValid = false;+ } else if (emailInput.value.endsWith('@gmail.com') && !emailRegex.test(emailInput.value)) {+ document.getElementById('emailError').innerText = 'Gmail addresses cannot contain "." or "+" symbols before the "@". Please remove these symbols.';+ isValid = false;+ } else {+ document.getElementById('emailError').innerText = '';+ }+++ // Validate Phone Number+ const phoneRegex = /^\+\d{1,3}-\d{4,}$/;+ if (!phoneRegex.test(phoneInput.value)) {+ document.getElementById('phoneError').innerText = 'Phone number must be in the format +1-8559805959 and contain at least 4 digits.';+ isValid = false;+ } else if (phoneInput.value.length > 50) {+ document.getElementById('phoneError').innerText = 'Phone number is too long.';+ isValid = false;+ } else {+ document.getElementById('phoneError').innerText = '';+ }++ // Validate Address+ const addressRegex = /^[A-Za-z0-9\s,]*$/;+ if (addressInput.value.length < 20 || (addressInput.value.match(/,/g) || []).length < 2 || !addressRegex.test(addressInput.value)) {+ document.getElementById('addressError').innerText = 'Address must be at least 20 characters long, contain at least 2 commas, and only contain English characters.';+ isValid = false;+ } else if (addressInput.value.length > 200) {+ document.getElementById('addressError').innerText = 'Address is too long.';+ isValid = false;+ } else {+ document.getElementById('addressError').innerText = '';+ }++ // Validate Password+ const passwordRequirements = [+ { regex: /.{8,}/, message: 'at least 8 characters long' },+ { regex: /[A-Z]/, message: 'an uppercase letter' },+ { regex: /[a-z]/, message: 'a lowercase letter' },+ { regex: /\d/, message: 'a number' },+ { regex: /^[^\&\*\''\"<>\\\\/\s]*$/, message: 'must not include &, *, \', ", <, >, \, /, or spaces' }+ ];+ const unmetRequirements = passwordRequirements.filter(req => !req.regex.test(passwordInput.value));+ if (unmetRequirements.length === 0) {+ document.getElementById('passwordHelp').innerHTML = '<span class="text-green-500">Password meets all requirements</span>';+ } else {+ const messages = unmetRequirements.map(req => req.message).join(', ');+ document.getElementById('passwordHelp').innerHTML = `<span class="text-red-500">Password ${messages}</span>`;+ isValid = false;+ }++ if (passwordInput.value.length > 128) {+ document.getElementById('passwordHelp').innerHTML = '<span class="text-red-500">Password is too long.</span>';+ isValid = false;+ }++ // Validate Confirm Password+ if (confirmPasswordInput.value !== passwordInput.value) {+ document.getElementById('confirmPasswordError').innerText = 'Passwords do not match.';+ isValid = false;+ } else {+ document.getElementById('confirmPasswordError').innerText = '';+ }++ registerButton.disabled = !isValid;+ }+ });+ </script>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>+ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+ <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8599203929590914" crossorigin="anonymous"></script>+</body>+</html>diff --git a/opensource/frontend/reset_password.html b/opensource/frontend/reset_password.htmlnew file mode 100644index 0000000..91b1e99--- /dev/null+++ b/opensource/frontend/reset_password.html@@ -0,0 +1,163 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>DigitalPlat Domain Registry and Management Authority</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <!-- Cloudflare Turnstile -->+ <script src="https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha" async defer></script>++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ }+ .container {+ width: 100%;+ max-width: 400px;+ margin: 5% auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .logo img {+ width: 80px; /* Adjusted size */+ height: auto;+ border-radius: 50%; /* Circular border */+ }+ .title {+ font-size: 1.2rem;+ font-weight: 600;+ margin-left: 20px;+ color: #1a202c;+ }+ .google-button {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ font-weight: 500;+ background-color: #e2e8f0; /* Subtle background */+ padding: 10px 15px;+ border-radius: 8px;+ transition: background-color 0.3s;+ }+ .google-button:hover {+ background-color: #cbd5e0;+ }+ .footer {+ background-color: #1a202c;+ color: #cbd5e0;+ padding: 20px;+ font-size: 14px;+ border-radius: 0 0 12px 12px;+ }+ footer a {+ color: #63b3ed;+ }+ footer a:hover {+ text-decoration: underline;+ }+ </style>+</head>+<body>+ <div class="header">+ <div class="logo">+ <img src="https://nic.us.kg/wp-content/uploads/2023/05/IMG_20230511_165610.jpg" alt="DigitalPlat Domain Registry and Management Authority">+ </div>+ <div class="title">DigitalPlat Domain Registry and Management Authority</div>+ </div>+ <div class="container mx-auto px-4">+ <form action="/auth/reset-password" method="POST">+ <div class="mb-4">+ <label for="email" class="block text-gray-700 text-sm font-bold mb-2">E-Mail</label>+ <input type="email" name="email" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="email" placeholder="Enter your email" required>+ </div>+ <div class="mb-4">+ <label for="password" class="block text-gray-700 text-sm font-bold mb-2">New Password</label>+ <input type="password" name="new_password" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="new_password" placeholder="Enter your new password" autocomplete="off" required>+ <small id="passwordHelp" class="form-text text-gray-600">The password must be more than 8 characters long and include uppercase and lowercase letters as well as numbers.</small>+ </div>+ <!-- Cloudflare Turnstile -->+ <div class="g-recaptcha mb-4" data-sitekey="{{ sitekey }}"></div>+ <div class="operation flex justify-center mt-4">+ <button type="submit" id="resetButton" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" disabled>Reset</button>+ </div>+ <div class="text-center mt-4">+ <small>Don't have an account? <a href="/auth/register" class="text-blue-500">Sign up</a></small>+ </div>+ </form>+ </div>+ <footer class="footer">+ <div class="text-center">+ <small>+ By continuing you agree to our <a href="https://nic.us.kg/terms-of-service/">Terms of Service</a>, <a href="https://nic.us.kg/privacy-policy/">Privacy Policy</a>, and <a href="https://nic.us.kg/acceptable-use-policy/">Acceptable Use Policy</a>.<br>+ If you encounter any problems, please create a new issue: <a href="https://github.com/DigitalPlatDev/US.KG-Issues/issues/new/choose">Issue Report</a><br>+ The 'Sign in with Google' is currently only accessible for accounts registered with Gmail+ </small>+ </div>+ </footer>+ <script>+ document.addEventListener('DOMContentLoaded', function () {+ const passwordInput = document.getElementById('new_password');+ const resetButton = document.getElementById('resetButton');++ passwordInput.addEventListener('input', validatePassword);++ function validatePassword() {+ let isValid = true;++ // Validate Password+ const passwordRequirements = [+ { regex: /.{8,}/, message: 'at least 8 characters long' },+ { regex: /[A-Z]/, message: 'an uppercase letter' },+ { regex: /[a-z]/, message: 'a lowercase letter' },+ { regex: /\d/, message: 'a number' }+ ];+ const unmetRequirements = passwordRequirements.filter(req => !req.regex.test(passwordInput.value));+ if (unmetRequirements.length === 0) {+ document.getElementById('passwordHelp').innerHTML = '<span class="text-green-500">Password meets all requirements</span>';+ } else {+ const messages = unmetRequirements.map(req => req.message).join(', ');+ document.getElementById('passwordHelp').innerHTML = `<span class="text-red-500">Password must include: ${messages}</span>`;+ isValid = false;+ }++ if (passwordInput.value.length > 128) {+ document.getElementById('passwordHelp').innerHTML = '<span class="text-red-500">Password is too long.</span>';+ isValid = false;+ }++ resetButton.disabled = !isValid;+ }+ });+ </script>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>+ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>diff --git a/opensource/frontend/success.html b/opensource/frontend/success.htmlnew file mode 100644index 0000000..72b1458--- /dev/null+++ b/opensource/frontend/success.html@@ -0,0 +1,72 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta http-equiv="X-UA-Compatible" content="IE=edge">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Successful!</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ justify-content: center;+ align-items: center;+ }+ .container {+ width: 100%;+ max-width: 600px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ padding: 20px;+ text-align: center;+ }+ .header__title h1 {+ font-size: 3rem;+ font-weight: 700;+ margin-bottom: 20px;+ }+ .header__text {+ font-size: 1.25rem;+ margin-bottom: 20px;+ }+ .header__button {+ background-color: #1a202c;+ color: #ffffff;+ padding: 10px 20px;+ border-radius: 5px;+ text-decoration: none;+ font-weight: 500;+ transition: background-color 0.3s;+ }+ .header__button:hover {+ background-color: #2d3748;+ }+ </style>+</head>+<body>+ <main class="container">+ <div class="content">+ <div class="header">+ <div class="header__title">+ <h1 class="header__h1">Successful!</h1>+ </div>+ <p class="header__text">{{info}}</p>+ <a class="header__button" href="javascript:history.back()">Back</a>+ </div>+ </div>+ </main>+ <script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-fountain@2/tsparticles.preset.fountain.bundle.min.js"></script>+</body>+</html>diff --git a/opensource/frontend/usermgr.html b/opensource/frontend/usermgr.htmlnew file mode 100644index 0000000..3e3e9ba--- /dev/null+++ b/opensource/frontend/usermgr.html@@ -0,0 +1,221 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>US.KG Account Management System</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <!-- Google reCAPTCHA -->+ <script src="https://www.recaptcha.net/recaptcha/api.js" async defer></script>++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .container {+ width: 100%;+ max-width: 400px;+ margin: auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ transition: all 0.5s ease;+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .logo img {+ width: 80px;+ height: auto;+ border-radius: 50%;+ }+ .title {+ font-size: 1.2rem;+ font-weight: 600;+ margin-left: 20px;+ color: #1a202c;+ }+ .footer {+ background-color: #1a202c;+ color: #cbd5e0;+ padding: 20px;+ font-size: 14px;+ border-radius: 0 0 12px 12px;+ margin-top: auto;+ }+ footer a {+ color: #63b3ed;+ }+ footer a:hover {+ text-decoration: underline;+ }+ .loading-animation {+ border: 4px solid #f3f3f3;+ border-top: 4px solid #3498db;+ border-radius: 50%;+ width: 24px;+ height: 24px;+ animation: spin 2s linear infinite;+ margin: 0 auto 20px;+ display: none;+ }+ @keyframes spin {+ 0% { transform: rotate(0deg); }+ 100% { transform: rotate(360deg); }+ }+ </style>+</head>+<body>+ <div class="container mx-auto px-4">+ <div class="alert alert-light" role="alert">+ <strong>Current full name: </strong> <span>{{fullname}}</span><br>+ <strong>Current username: </strong> <span>{{username}}</span><br>+ <strong>Current E-Mail: </strong> <span>{{email}}</span><br>+ <strong>Current phone: </strong> <span>{{phone}}</span><br>+ <strong>Current address: </strong> <span>{{address}}</span>+ </div>+ <form id="userEditForm" action="/auth/user/edit" method="POST">+ <div class="mb-4">+ <label for="username" class="block text-gray-700 text-sm font-bold mb-2">Username</label>+ <input type="text" name="username" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="username" placeholder="Username" value="{{username}}" required disabled>+ <small id="usernameError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="fullname" class="block text-gray-700 text-sm font-bold mb-2">Legal full name</label>+ <input type="text" name="fullname" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="fullname" placeholder="Michael Johnson" value="{{fullname}}" required disabled>+ <small id="fullnameError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="email" class="block text-gray-700 text-sm font-bold mb-2">E-Mail</label>+ <small class="text-gray-600">Using a temporary email may result in the suspension of your account.</small>+ <input type="email" name="email" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="email" placeholder="[email protected]" value="{{email}}" required>+ </div>+ <div class="mb-4">+ <label for="phone" class="block text-gray-700 text-sm font-bold mb-2">Phone (format: +1-8559805959)</label>+ <input type="text" name="phone" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="phone" placeholder="+1-8559805959" value="{{phone}}" required>+ <small id="phoneError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="address" class="block text-gray-700 text-sm font-bold mb-2">Full Address</label>+ <textarea id="address" name="address" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="1000 Santa Monica Blvd, Santa Monica, CA 90401, United States" required>{{address}}</textarea>+ <small id="addressError" class="text-red-500"></small>+ </div>+ <div class="mb-4">+ <label for="password" class="block text-gray-700 text-sm font-bold mb-2">Password</label>+ <input type="password" name="password" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" id="password" placeholder="Password" autocomplete="off" required>+ <small id="passwordHelp" class="form-text text-gray-600">The password must be more than 8 characters long and include uppercase and lowercase letters as well as numbers.</small>+ </div>+ <div class="flex items-center justify-between">+ <button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" id="updateButton" disabled>Update</button>+ </div>+ </form>+ </div>+ <footer class="footer">+ <div class="text-center">+ <small>+ By continuing you agree to our <a href="https://nic.us.kg/terms-of-service/">Terms of Service</a>, <a href="https://nic.us.kg/privacy-policy/">Privacy Policy</a>, and <a href="https://nic.us.kg/acceptable-use-policy/">Acceptable Use Policy</a>.<br>+ If you encounter any problems, please create a new issue: <a href="https://github.com/DigitalPlatDev/US.KG-Issues/issues/new/choose" target="_blank">Issue Report</a><br>+ </small>+ </div>+ </footer>+ <script>+ document.addEventListener('DOMContentLoaded', function () {+ const usernameInput = document.getElementById('username');+ const fullnameInput = document.getElementById('fullname');+ const phoneInput = document.getElementById('phone');+ const addressInput = document.getElementById('address');+ const passwordInput = document.getElementById('password');+ const updateButton = document.getElementById('updateButton');++ usernameInput.addEventListener('input', validateForm);+ fullnameInput.addEventListener('input', validateForm);+ phoneInput.addEventListener('input', validateForm);+ addressInput.addEventListener('input', validateForm);+ passwordInput.addEventListener('input', validateForm);++ function validateForm() {+ let isValid = true;++ // Validate Username+ if (usernameInput.value.length < 5) {+ document.getElementById('usernameError').innerText = 'Username must be at least 5 characters long.';+ isValid = false;+ } else {+ document.getElementById('usernameError').innerText = '';+ }++ // Validate Legal Full Name+ if (!fullnameInput.value.includes(' ')) {+ document.getElementById('fullnameError').innerText = 'Legal full name must contain at least one space.';+ isValid = false;+ } else {+ document.getElementById('fullnameError').innerText = '';+ }++ // Validate Phone Number+ const phoneRegex = /^\+\d{1,3}-\d{4,}$/;+ if (!phoneRegex.test(phoneInput.value)) {+ document.getElementById('phoneError').innerText = 'Phone number must be in the format +1-8559805959 and contain at least 4 digits.';+ isValid = false;+ } else {+ document.getElementById('phoneError').innerText = '';+ }++ // Validate Address+ const addressRegex = /^[A-Za-z0-9\s,]*$/;+ if (addressInput.value.length < 20 || (addressInput.value.match(/,/g) || []).length < 2 || !addressRegex.test(addressInput.value)) {+ document.getElementById('addressError').innerText = 'Address must be at least 20 characters long, contain at least 2 commas, and only contain English characters.';+ isValid = false;+ } else {+ document.getElementById('addressError').innerText = '';+ }++ // Validate Password+ const passwordRequirements = [+ { regex: /.{8,}/, message: 'at least 8 characters long' },+ { regex: /[A-Z]/, message: 'an uppercase letter' },+ { regex: /[a-z]/, message: 'a lowercase letter' },+ { regex: /\d/, message: 'a number' }+ ];+ const unmetRequirements = passwordRequirements.filter(req => !req.regex.test(passwordInput.value));+ if (unmetRequirements.length === 0) {+ document.getElementById('passwordHelp').innerHTML = '<span class="text-green-500">Password meets all requirements</span>';+ } else {+ const messages = unmetRequirements.map(req => req.message).join(', ');+ document.getElementById('passwordHelp').innerHTML = `<span class="text-red-500">Password must include: ${messages}</span>`;+ isValid = false;+ }++ updateButton.disabled = !isValid;+ }+ });+ </script>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>+ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>diff --git a/opensource/frontend/whois.html b/opensource/frontend/whois.htmlnew file mode 100644index 0000000..98c03cb--- /dev/null+++ b/opensource/frontend/whois.html@@ -0,0 +1,130 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>US.KG WHOIS Lookup</title>++ <!-- Tailwind CSS -->+ <script src="https://cdn.tailwindcss.com"></script>++ <!-- Google Fonts -->+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">++ <style>+ body {+ font-family: 'Poppins', sans-serif;+ background-color: #edf2f7;+ padding: 0;+ margin: 0;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .container {+ width: 100%;+ max-width: 600px;+ margin: auto;+ padding: 20px;+ background-color: #ffffff;+ border-radius: 12px;+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.05);+ transition: all 0.5s ease;+ }+ .header {+ display: flex;+ align-items: center;+ padding: 10px 20px;+ background-color: #ffffff;+ border-radius: 12px 12px 0 0;+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);+ margin-bottom: 20px;+ }+ .logo {+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .logo img {+ width: 80px;+ height: auto;+ border-radius: 50%;+ }+ .title {+ font-size: 1.5rem;+ font-weight: 600;+ color: #1a202c;+ margin-left: 20px;+ }+ .footer {+ background-color: #1a202c;+ color: #cbd5e0;+ padding: 20px;+ font-size: 14px;+ border-radius: 0 0 12px 12px;+ margin-top: auto;+ text-align: center;+ }+ footer a {+ color: #63b3ed;+ }+ footer a:hover {+ text-decoration: underline;+ }+ .input-group {+ display: flex;+ align-items: center;+ margin-bottom: 20px;+ }+ .input-group-prepend {+ background-color: #edf2f7;+ border: 1px solid #cbd5e0;+ padding: 10px;+ border-radius: 0 5px 5px 0;+ color: #4a5568;+ }+ </style>+</head>+<body>+ <nav class="bg-white shadow p-4">+ <div class="container mx-auto">+ <span class="text-lg font-semibold">US.KG WHOIS Lookup</span>+ </div>+ </nav>+ <div class="container">+ <form action="/whois" method="GET">+ <div class="input-group">+ <input type="text" name="name" class="form-input block w-full px-4 py-3 mb-3 leading-tight text-gray-700 border rounded-lg focus:outline-none focus:bg-white" id="name" placeholder="Domain name" required>+ <div class="input-group-prepend">.us.kg</div>+ </div>+ <div class="flex justify-center">+ <button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Lookup</button>+ </div>+ </form>+ </div>+ <div class="container mt-5">+ <div class="row">+ <div class="col">+ <h5 class="text-xl font-semibold">Query WHOIS via command line (CLI)</h5>+ <p class="text-gray-700 mt-3">When querying WHOIS via command line, even though US.KG adheres to the RFC 2782 WHOIS server lookup standard, many clients may not support or accept it. This is because, in most cases, you cannot directly query WHOIS by using 'whois example.us.kg'. We are currently working on or preparing to submit support for WHOIS server lookup to mainstream WHOIS clients (such as RFC 1036 WHOIS clients). Until WHOIS clients directly support it, please search for WHOIS information for US.KG domains by specifying the WHOIS server (for example, in RFC 1036 WHOIS clients, you can search by adding the '-h' parameter to specification the 'whois.us.kg' server, like this: 'whois -h whois.us.kg example.us.kg').</p>+ <p class="mt-3"><code class="bg-gray-100 text-gray-800 px-2 py-1 rounded">whois -h whois.us.kg "domainname"</code></p>+ </div>+ </div>+ </div>+ <footer class="footer mt-5">+ <small>+ Enter a domain name to query+ <br>+ If you encounter any problems, please create a new issue: <a href="https://github.com/DigitalPlatDev/US.KG-Issues/issues/new/choose" target="_blank">Issue Report</a><br>+ </small>+ </footer>+ <script>+ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/insights/script.js"></script>+ <script>+ window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };+ </script>+ <script defer src="/_vercel/speed-insights/script.js"></script>+</body>+</html>diff --git a/opensource/readme.md b/opensource/readme.mdnew file mode 100644index 0000000..9f45351--- /dev/null+++ b/opensource/readme.md@@ -0,0 +1,6 @@+# DigitalPlat FreeDomain Open Source+This folder contains portions of the front-end and back-end code we’ve made open-source.++DigitalPlat is a nonprofit charitable organization that supports open-source and free software. While we fully embrace the principles of transparency and community collaboration, we’ve taken a cautious approach by not yet fully open-sourcing our back-end code. This decision is based on security considerations and the need to mitigate potential vulnerabilities and hacking risks.++However, we are committed to gradually open-sourcing more of our codebase over time. This will help us optimize the project and foster greater community involvement. The files in this folder represent the parts of the project that are currently open to the public.\ No newline at end of filediff --git a/opensource/whois_server/readme.md b/opensource/whois_server/readme.mdnew file mode 100644index 0000000..e33c50d--- /dev/null+++ b/opensource/whois_server/readme.md@@ -0,0 +1,6 @@+# WHOIS Server+A simple and lightweight WHOIS server++For example, in an RFC 1036 client, you can query a domain name using the command `whois -h whois.us.kg "domainname"`, provided that `whois.us.kg` points to a WHOIS server and port 43 is open. This is just a basic code (we use this)—you’ll need to implement your own database and related functionality.++In the provided code, the `get_whois` function is used to retrieve WHOIS data as plain text from the server. You’ll need to implement this function yourself.\ No newline at end of filediff --git a/opensource/whois_server/whois.py b/opensource/whois_server/whois.pynew file mode 100644index 0000000..ea7bff9--- /dev/null+++ b/opensource/whois_server/whois.py@@ -0,0 +1,71 @@+import socket+import logging+++logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s')++def whois(query):+ try:+ response = get_whois(query).format(query)+ return response+ except Exception as e:+ logging.error(f"Error processing WHOIS query: {e}")+ return "Internal server error"++def main():+ host = '0.0.0.0'+ port = 43++ server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ server_socket.bind((host, port))+ server_socket.listen(5)++ logging.info(f"WHOIS Server Started, port: {port}")++ while True:+ try:+ client_socket, addr = server_socket.accept()+ logging.info(f"Received connection from {addr}")++ try:+ with client_socket:+ client_socket.settimeout(10.0)++ try:+ data = client_socket.recv(1024).strip()+ try:+ decoded_data = data.decode('utf-8')+ except UnicodeDecodeError:+ logging.warning(f"Received invalid UTF-8 data from {addr}: {data}")+ client_socket.sendall("Invalid request encoding".encode('utf-8'))+ continue++ logging.info(f"Request inquiry: {decoded_data}")++ if not decoded_data:+ logging.warning("Empty request received")+ continue++ response = whois(decoded_data)+ client_socket.sendall(response.encode('utf-8'))++ except socket.timeout:+ logging.warning("Connection timed out")+ except Exception as e:+ logging.error(f"Unexpected error: {e}")+ client_socket.sendall("Internal server error".encode('utf-8'))++ except Exception as e:+ logging.error(f"Error handling client socket: {e}")++ except Exception as e:+ logging.error(f"Error accepting connection: {e}")++if __name__ == "__main__":+ while True:+ try:+ main()+ except Exception as e:+ logging.critical(f"Critical error in main loop: {e}")+ import time+ time.sleep(1)