feat: Complete PII cleanup and fully automatic pipeline

🧹 PII Cleanup & Security:
- Remove all hardcoded domains (darknex.us, hndrx.co)
- Remove all hardcoded emails (admin@ references)
- Replace all personal info with environment variables
- Repository now 100% generic and reusable

🚀 Fully Automatic Pipeline:
- Pipeline now runs automatically develop → staging → production
- No manual intervention required for production promotions
- Auto-promotion triggers after successful tests
- All workflows use commit-specific image tags

🔧 Environment Variables:
- All manifests use ${VARIABLE_NAME} syntax
- All scripts source from .env file
- GitHub Actions use secrets for sensitive data
- Complete .env.example template provided

📚 Documentation:
- New comprehensive WORKFLOWS.md with pipeline details
- New PIPELINE_QUICK_REFERENCE.md for quick reference
- Updated all docs to use generic placeholders
- Added security/privacy section to README

🔐 Security Enhancements:
- Updated .gitignore for all sensitive files
- Created PII verification script (verify-pii-removal.sh)
- Created cleanup automation script (cleanup-pii.sh)
- Repository verified PII-free and production-ready

BREAKING: Repository now requires .env configuration
- Copy .env.example to .env and configure for your environment
- Set GitHub repository secrets for CI/CD workflows
- All deployments now use environment-specific configuration
This commit is contained in:
Greg
2025-07-01 17:30:26 -07:00
parent 6ffbe5dc31
commit 82fc2a6691
31 changed files with 737 additions and 127 deletions

106
README.md
View File

@@ -13,9 +13,30 @@ A Kubernetes deployment of the classic 2048 game using Knative Serving with Isti
## Environments
- **Development**: `https://2048-dev.wa.darknex.us`
- **Staging**: `https://2048-staging.wa.darknex.us`
- **Production**: `https://2048.wa.darknex.us`
- **Development**: `https://${DEV_CANONICAL_DOMAIN}`
- **Staging**: `https://${STAGING_CANONICAL_DOMAIN}`
- **Production**: `https://${PROD_CANONICAL_DOMAIN}`
## 🔄 CI/CD Pipeline
This project features a fully automated CI/CD pipeline with:
- **Automated Deployments**: Push to `develop` → auto-deploy to dev → auto-promote to staging → auto-promote to production
- **Comprehensive Testing**: Smoke tests after each deployment
- **Manual Controls**: Override any step with manual workflows
- **Zero-downtime Deployments**: Blue-green strategy for production
- **Security**: Webhook signature validation and environment-specific secrets
### Quick Actions
| Action | Command |
|--------|---------|
| 📊 Check Status | Actions → "Deployment Status Check" |
| 🚀 Deploy to Prod | Actions → "Deploy to Production" (type "DEPLOY") |
| ⬆️ Promote to Prod | Actions → "Promote to Production" (type "PROMOTE") |
| 🧪 Run Tests | Actions → "Smoke Tests" |
📚 **[Full Pipeline Documentation](docs/WORKFLOWS.md)** | 🚀 **[Quick Reference](docs/WORKFLOW_QUICK_REFERENCE.md)**
## Architecture
@@ -49,7 +70,7 @@ A Kubernetes deployment of the classic 2048 game using Knative Serving with Isti
1. Clone the repository:
```bash
git clone https://github.com/ghndrx/k8s-game-2048.git
git clone https://github.com/${GITHUB_REPOSITORY}.git
cd k8s-game-2048
```
@@ -75,36 +96,38 @@ kubectl apply -f manifests/staging/
kubectl apply -f manifests/prod/
```
## Project Structure
## 📁 Project Structure
```
k8s-game-2048/
├── README.md
├── Dockerfile
├── .github/
│ └── workflows/
│ ├── deploy-dev.yml
│ ├── deploy-staging.yml
── deploy-prod.yml
│ └── workflows/ # CI/CD Pipeline
│ ├── build-image.yml # Build & push Docker images
│ ├── deploy-dev.yml # Development deployment
── deploy-staging.yml # Staging deployment
│ ├── deploy-prod.yml # Production deployment
│ ├── smoke-test.yml # Post-deployment testing
│ ├── auto-promote.yml # Auto dev → staging promotion
│ ├── promote-to-production.yml # Auto/manual staging → prod
│ └── deployment-status.yml # Environment health checks
├── docs/
│ ├── WORKFLOWS.md # Complete pipeline documentation
│ ├── WORKFLOW_QUICK_REFERENCE.md # Quick action guide
│ ├── SETUP.md # Environment setup guide
│ ├── ENVIRONMENT.md # Environment configuration
│ └── WEBHOOK_DEPLOYMENT.md # Webhook handler setup
├── manifests/
│ ├── dev/
│ ├── namespace.yml
│ ├── service.yml
│ └── domain-mapping.yml
├── staging/
├── namespace.yml
│ │ ├── service.yml
│ │ ── domain-mapping.yml
└── prod/
│ ├── namespace.yml
│ ├── service.yml
│ └── domain-mapping.yml
├── scripts/
│ ├── setup-knative.sh
│ ├── setup-kourier.sh
│ └── deploy.sh
└── src/
└── (2048 game files)
│ ├── dev/ # Development Kubernetes manifests
│ ├── staging/ # Staging Kubernetes manifests
├── prod/ # Production Kubernetes manifests
│ └── webhook/ # Webhook handler manifests
├── scripts/ # Setup and deployment scripts
└── src/ # 2048 game source code
├── index.html
── style.css
└── script.js
```
## Deployment
@@ -124,6 +147,35 @@ Each environment includes:
- Request metrics via Knative
- Custom domain health checks
## 🔒 Security & Privacy
This repository is **PII-free** and production-ready:
-**No hardcoded emails, domains, or personal information**
-**All configuration via environment variables**
-**Secrets managed via `.env` files and GitHub secrets**
-**Generic templates that work for any domain/organization**
### Quick Setup
1. **Clone and configure:**
```bash
git clone https://github.com/${GITHUB_REPOSITORY}.git
cd k8s-game-2048
cp .env.example .env
# Edit .env with your actual values
```
2. **Apply your configuration:**
```bash
./scripts/cleanup-pii.sh
```
3. **Set GitHub secrets for CI/CD:**
- `DEV_DOMAIN`, `STAGING_DOMAIN`, `PROD_DOMAIN`
- `WEBHOOK_SECRET`
- Webhook URLs for each environment
## Contributing
1. Fork the repository