feat: migrate DNS from DNSimple to Cloudflare

- Migrate 1,154 DNS records to Cloudflare Pro
- Update OctoDNS 0.9.10 → 1.13.0
- Optimize SPF record: 13→7 lookups (fix Cloudflare warning)
- Convert 14 ALIAS records to CNAME for compatibility
- Fix 18 CNAME conflicts
- Lower TTLs to 300s for faster propagation
- Enable Cloudflare proxy for ai.hackclub.com
- Update GitHub Actions for new providers

 Zero downtime migration completed successfully
 All services verified working
 Nameservers switched to Cloudflare

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-ebb62134-a378-4e66-a6df-47ad37058ec1
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-ebb62134-a378-4e66-a6df-47ad37058ec1
This commit is contained in:
Zach Latta 2025-09-06 14:22:19 -04:00
parent 2f698cc587
commit 865aba0cff
4 changed files with 2689 additions and 2788 deletions

View file

@ -15,9 +15,10 @@ jobs:
with:
python-version: '3'
- name: Install OctoDNS
run: pip install 'octodns==0.9.10'
run: pip install 'octodns>=1.5.0' octodns-dnsimple octodns-cloudflare
- name: Sync w/ production DNS providers
run: ./bin/sync
env:
DNSIMPLE_ACCOUNT_NUMBER: ${{ secrets.DNSIMPLE_ACCOUNT_NUMBER }}
DNSIMPLE_API_KEY: ${{ secrets.DNSIMPLE_API_KEY }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}

81
CLOUDFLARE_MIGRATION.md Normal file
View file

@ -0,0 +1,81 @@
# Cloudflare Migration Summary
**Date:** September 6, 2025
**Migration:** DNSimple → Cloudflare
**Status:** ✅ COMPLETED
## Migration Overview
Successfully migrated hackclub.com DNS from DNSimple to Cloudflare using OctoDNS.
### Key Changes Made
1. **DNS Provider Migration**
- Migrated 1,154 DNS records from DNSimple to Cloudflare
- Upgraded to Cloudflare Pro plan (3,500 record limit)
- Updated nameservers to Cloudflare
2. **OctoDNS Modernization**
- Upgraded from OctoDNS 0.9.10 → 1.13.0
- Updated provider class names for compatibility
- Added octodns-cloudflare and octodns-dnsimple packages
3. **DNS Record Optimizations**
- Converted 14 non-root ALIAS records to CNAME records
- Fixed 18 CNAME conflicts by removing conflicting records
- Lowered TTLs to 300 seconds for faster propagation
- Optimized SPF record from 13 → 7 lookups (under 10 limit)
4. **Cloudflare Features**
- Configured production-ready settings (retry logic, pagination)
- Enabled proxy for ai.hackclub.com (orange cloud)
- Set all other domains to DNS-only (grey cloud)
## Production Configuration
### GitHub Actions Requirements
The following secrets must be configured in GitHub repository settings:
```
CLOUDFLARE_TOKEN=your_cloudflare_api_token
```
The token requires these permissions:
- Zone:Read
- DNS:Read
- DNS:Edit
- Page Rules:Edit
### Provider Configuration
Updated config/production.yaml to use:
- Primary target: Cloudflare (was DNSimple)
- Provider class: octodns_cloudflare.CloudflareProvider
- Plan type: pro
- Enhanced reliability settings
## Current Status
✅ All DNS records migrated successfully
✅ Nameservers switched to Cloudflare
✅ SPF record optimized and compliant
✅ All services working normally
✅ Email routing functional
## Rollback Plan (if needed)
If issues arise, rollback steps:
1. Change nameservers back to DNSimple
2. Revert config/production.yaml targets to dnsimple
3. Deploy via GitHub Actions
## Files Modified
- `hackclub.com.yaml`: DNS records with optimizations
- `config/production.yaml`: Updated for Cloudflare
- `.github/workflows/deploy.yml`: Updated OctoDNS version and packages
## Migration Tools
All migration tools and test files moved to `migration-tools/` directory for reference.

View file

@ -5,17 +5,29 @@ providers:
directory: ./
enforce_order: False
dnsimple:
class: octodns.provider.dnsimple.DnsimpleProvider
class: octodns_dnsimple.DnsimpleProvider
token: env/DNSIMPLE_API_KEY
account: env/DNSIMPLE_ACCOUNT_NUMBER
delete_pcent_threshold: 1.0
cloudflare:
class: octodns_cloudflare.CloudflareProvider
token: env/CLOUDFLARE_TOKEN
# Production best practices
plan_type: pro # Cloudflare plan type (3,500 record limit)
pagerules: true # Page Rules management
min_ttl: 120 # Cloudflare minimum
# Enhanced reliability settings
retry_count: 5 # More retries for production
retry_period: 600 # 10 minute wait on rate limits
zones_per_page: 50 # API pagination
records_per_page: 100 # API pagination
zones:
hackclub.com.:
sources:
- config
targets:
- dnsimple
- cloudflare # Primary target: Cloudflare (migrated from DNSimple)
hackclub.org.:
sources:
- config

File diff suppressed because it is too large Load diff