A PHP Program For Subdomain Registeration And Management Based On Cloudflare DNS.
- Edit NS Record Record
- Program setup script
- Account Status (ability to suspend/cancel accounts)
- Domain Name Status (ability to require registerations to be approved, suspend/cancel sub-domains)
- Better Admin panel: Edit NS Record for specific sub-domain, etc.
PLEASE READ AND FOLLOW THE STEPS CAREFULLY.
Create a MySQL database in your server, and import cloudflareNIC.sql. Make sure to take note of your database name, username and password.
Update the following constants with your database credentials:
define('DB_HOST', 'your-database-host'); // e.g. localhost
define('DB_USER', 'your-database-username');
define('DB_PASS', 'your-database-password');
define('DB_NAME', 'your-database-name');Replace the following with your domain details:
define('DOMAIN_NAME', 'example.com'); // Lowercase version
define('DOMAIN_NAME_UP', 'EXAMPLE.COM'); // Uppercase version
define('REGISTRAR_DOMAIN', 'registrar.example.com'); // Domain of the registrar systemCreate a scoped API token with permissions for DNS:Read and DNS:Edit for your domain.
define('CLOUDFLARE_API_KEY', 'your-cloudflare-api-token');
define('CLOUDFLARE_ZONE_ID', 'your-cloudflare-zone-id');Get API Token From Cloudflare dashboard. Find your zone ID on the Overview tab for your domain in the Cloudflare dashboard.
Set up HCaptcha for bot protection.
define('HCAPTCHA_SITE_KEY', 'your-hcaptcha-site-key');
define('HCAPTCHA_SECRET', 'your-hcaptcha-secret-key');Get these from your hCaptcha dashboard.
Enable OAuth on Google Cloud Console and get your credentials.
A more detailed guide is available at Setting Up Google Login
Follow the guide up until step 1 in the guide, you will have all of the informations you need for this step.
define('GOOGLE_CLIENT_ID', 'your-google-client-id');
define('GOOGLE_CLIENT_SECRET', 'your-google-client-secret');Use a redirect URI like:
https://your-registrar-domain.com/oauth_callback.php
You need to manually update the MySQL entry once you logged in with your Google account, change the role field of your user record from user to admin. After this step, log out and log back in you will be able to access the Admin panel.
from https://github.com/KevvTheGoat/Cloudflare-Subdomain-Registrar
No comments:
Post a Comment