September 25, 2024 · 10 min read
This blog covers the technical documentation of setting up cs404.org, a static website hosted on GitHub Pages, optimized with Cloudflare, and protected from DDoS attacks. The main steps involve domain registration, GitHub Pages configuration, Cloudflare integration, SSL setup, and landing page creation. Let’s go step by step through the setup process.
1. Domain Registration
I registered the domain cs404.org using Namecheap. The domain is pointed to Cloudflare’s DNS for handling security, SSL, and caching.
2. GitHub Pages Setup
Hosting cs404.org on GitHub Pages was straightforward. The process involved:
- Creating a repository called cs404 containing an
index.html
andstyles.css
for the website. - Enabling GitHub Pages via the repository's settings and configuring the custom domain cs404.org.
- Enforcing HTTPS to ensure all traffic is secure.
3. Cloudflare Integration
Cloudflare was configured to manage DNS, SSL, and protect against DDoS attacks:
- DNS Configuration: Set A Records pointing to GitHub Pages' IP addresses and a CNAME record for www.cs404.org.
- SSL/TLS: Set to Full mode, with "Always Use HTTPS" and "Automatic HTTPS Rewrites" enabled to prevent mixed content issues.
- DDoS Protection: Enabled "Under Attack Mode" and set custom firewall rules to challenge high-frequency requests with a CAPTCHA.
4. Custom Landing Page
The landing page for cs404.org is simple but effective:
- HTML and CSS were used to create a static page that says, "CS404 Coming Soon!" in a terminal-like style.
- The logo was placed above the text, and the content was styled with a terminal font from Google Fonts (Ubuntu Mono).
5. Troubleshooting DNS and SSL Issues
A few DNS and SSL issues were encountered during setup:
- SSL Certificate Issue: GitHub Pages failed to issue an SSL certificate. This was resolved by fixing the CNAME record for www.cs404.org and temporarily disabling Cloudflare’s proxy.
- HTTP to HTTPS Redirection: Initially, traffic wasn’t redirecting to HTTPS. Enabling "Always Use HTTPS" in Cloudflare fixed this issue.
6. Collaboration and Team Setup
The GitHub repository was shared with collaborators, granting them write access to contribute to the project. Collaborators were invited through GitHub’s "Manage Access" settings.
7. Final Testing
The website was tested on various browsers (Chrome, Firefox, Safari) and devices (desktop and mobile). HTTPS redirection and DDoS protection (CAPTCHA challenge) were successfully verified.
8. Future Work
Additional pages will be added as development continues, and DDoS protection settings will be adjusted based on traffic and activity levels.
Stay tuned for updates and check out the website at https://cs404.org!