Deployment Plan & Summary
π― Deployment Status: READY FOR PRODUCTION
All deployment files have been created and tested locally. The site is ready to be deployed to production server 31.97.61.154.
π¦ What Was Created
Docker Configuration
- β Dockerfile - Multi-stage build (Ruby β Jekyll β Nginx)
- β nginx.conf - Production Nginx configuration with caching and security
- β docker-compose.prod.yml - Complete Traefik integration with OAuth2
Environment & Secrets
- β .env.prod.example - Template for environment variables
- β .gitignore - Updated to exclude .env.prod
Deployment Tools
- β deploy-prod.sh - Automated deployment script (executable)
Documentation
- β DEPLOYMENT.md - Complete deployment guide
- β DEPLOYMENT-SUMMARY.md - This file
Updated Files
- β assets/js/auth.js - Updated for oauth2-proxy authentication
- β README.md - Enhanced with full documentation
ποΈ Architecture
Internet (HTTPS)
β
Traefik Proxy
(31.97.61.154)
β
ββββββ΄βββββββββββββββββββ
β β
OAuth2-Proxy Nginx Container
(GitHub Auth) (Static Jekyll Site)
β β
Protected Routes Public Routes
Routing Configuration
| URL | Authentication | Handled By |
|---|---|---|
https://www.aisforagent.net/ |
Public | Nginx |
https://www.aisforagent.net/portal/* |
GitHub OAuth | OAuth2-Proxy β Nginx |
https://www.aisforagent.net/workflows/* |
GitHub OAuth | OAuth2-Proxy β Nginx |
https://www.aisforagent.net/blueprints/* |
GitHub OAuth | OAuth2-Proxy β Nginx |
https://www.aisforagent.net/playbooks/* |
GitHub OAuth | OAuth2-Proxy β Nginx |
https://www.aisforagent.net/oauth2/* |
Public | OAuth2-Proxy |
π Pre-Deployment Checklist
1. GitHub OAuth App Setup
- Create GitHub OAuth App at: https://github.com/settings/developers
- Set Application name: A is for Agent
- Set Homepage URL:
https://www.aisforagent.net - Set Authorization callback URL:
https://www.aisforagent.net/oauth2/callback - Note the Client ID and Client Secret
2. Environment Configuration
- Copy
.env.prod.exampleto.env.prod - Add GitHub OAuth Client ID to
.env.prod - Add GitHub OAuth Client Secret to
.env.prod - Generate cookie secret:
openssl rand -base64 32 - Add cookie secret to
.env.prod - (Optional) Configure access restrictions (specific users/orgs)
3. DNS Configuration
- Verify DNS:
dig www.aisforagent.net +shortβ Should return31.97.61.154 - Verify DNS:
dig aisforagent.net +shortβ Should return31.97.61.154 - Allow time for DNS propagation if recently changed (5-60 minutes)
4. SSH Access
- Verify SSH key exists at
~/git/Foundry/S6web/key.file - Add SSH key to agent:
ssh-add ~/git/Foundry/S6web/key.file - Test SSH connection:
ssh root@31.97.61.154
5. Server Prerequisites
- Confirm Traefik is running
- Confirm
traefik-publicnetwork exists - Confirm middleware file exists at
~/traefik/middlewares.yml - Confirm ports 80 and 443 are accessible
π¬ Deployment Steps
Quick Deploy
# 1. Ensure you're in the project directory
cd ~/git/a/Foundry/aWebsite
# 2. Verify .env.prod is configured
cat .env.prod # Should show your actual credentials, not placeholders
# 3. Run deployment script
./deploy-prod.sh
# The script will:
# - Build the Docker image
# - Test it locally
# - Transfer files to server
# - Build and deploy on server
# - Verify the deployment
Expected Output
βββββββββββββββββββββββββββββββββββββββββββββββββββ
A is for Agent - Production Deployment
βββββββββββββββββββββββββββββββββββββββββββββββββββ
βΉ Mode: Full Deployment (Build + Deploy)
βΉ Step 1/6: Building image locally...
β Docker image built successfully
βΉ Step 2/6: Testing image...
β Image health check passed
βΉ Step 3/6: Preparing remote server...
β Remote directory ready
βΉ Step 4/6: Transferring files...
β Files transferred successfully
βΉ Step 5/6: Deploying...
β Containers deployed
βΉ Step 6/6: Verifying...
β Site is accessible at https://www.aisforagent.net
β βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Deployment Complete!
β βββββββββββββββββββββββββββββββββββββββββββββββββββ
Website: https://www.aisforagent.net
Portal: https://www.aisforagent.net/portal/
β Post-Deployment Verification
1. Check Containers
ssh root@31.97.61.154 "docker ps | grep aifa"
Expected:
aifa-site Up X minutes (healthy)
aifa-oauth2-proxy Up X minutes (healthy)
2. Test Public Access
# Homepage
curl -I https://www.aisforagent.net
# Expected: 200 OK
# Health endpoint
curl https://www.aisforagent.net/health
# Expected: healthy
3. Test Authentication
# OAuth userinfo (unauthenticated)
curl -I https://www.aisforagent.net/oauth2/userinfo
# Expected: 401 Unauthorized
# Protected portal (should redirect)
curl -I https://www.aisforagent.net/portal/
# Expected: 302/303 redirect to GitHub
4. Browser Testing
- Public Homepage:
- Visit:
https://www.aisforagent.net - Should display homepage with βDownload A is for Agentβ CTA
- No login required
- Visit:
- Authentication Flow:
- Click link to
/portal/ - Should redirect to GitHub OAuth
- Log in with GitHub account
- Should redirect back to portal page
- Click link to
- Authenticated Experience:
- After GitHub login, return to homepage
- CTA should now show βExplore Premium Servicesβ
- Portal, workflows, blueprints, and playbooks should be accessible without further login
- SSL Certificate:
- Click padlock in browser
- Should show valid Letβs Encrypt certificate
- Certificate should be for
www.aisforagent.net
5. Check Logs
# Site logs
ssh root@31.97.61.154 "docker logs --tail 50 aifa-site"
# OAuth2-Proxy logs
ssh root@31.97.61.154 "docker logs --tail 50 aifa-oauth2-proxy"
# Traefik logs (for routing issues)
ssh root@31.97.61.154 "docker logs --tail 50 traefik | grep aifa"
π§ Common Issues & Solutions
Issue: .env.prod still has placeholder values
Solution:
# Edit .env.prod with real credentials
nano .env.prod
# Should look like:
# OAUTH2_PROXY_CLIENT_ID=abc123def456
# OAUTH2_PROXY_CLIENT_SECRET=secret789xyz
# OAUTH2_PROXY_COOKIE_SECRET=ABCDEFGHabcdefgh1234567890ABCDEF==
Issue: SSH connection fails
Solution:
# Add SSH key to agent
ssh-add ~/git/Foundry/S6web/key.file
# Verify it's added
ssh-add -l
# Test connection
ssh root@31.97.61.154 "echo 'Connection successful'"
Issue: DNS not resolving
Solution:
# Check DNS
dig www.aisforagent.net +short
# If wrong or missing, update DNS A record to point to 31.97.61.154
# Wait 5-60 minutes for propagation
Issue: Containers not starting
Solution:
# SSH to server
ssh root@31.97.61.154
# Check container status
docker ps -a | grep aifa
# Check logs for errors
docker logs aifa-site
docker logs aifa-oauth2-proxy
# Restart if needed
cd ~/aifa-website
docker-compose -f docker-compose.prod.yml restart
Issue: Site shows 404 or 503
Solution:
# Verify Traefik sees the service
ssh root@31.97.61.154 "docker logs traefik 2>&1 | grep aifa"
# Verify network connectivity
ssh root@31.97.61.154 "docker network inspect traefik-public | grep aifa-site"
# Check Traefik labels
ssh root@31.97.61.154 "docker inspect aifa-site | grep -A 30 'traefik'"
# If still issues, restart Traefik to reload config
ssh root@31.97.61.154 "docker restart traefik"
Issue: OAuth redirects to wrong URL
Solution:
- Check GitHub OAuth App settings
- Verify callback URL is exactly:
https://www.aisforagent.net/oauth2/callback - Update
.env.prodif needed:OAUTH2_PROXY_REDIRECT_URL="https://www.aisforagent.net/oauth2/callback" - Restart oauth2-proxy:
ssh root@31.97.61.154 "docker restart aifa-oauth2-proxy"
Issue: CTA not switching after login
Solution:
- Open browser console (F12)
- Check for JavaScript errors
- Verify
/oauth2/userinfoendpoint works:curl -I https://www.aisforagent.net/oauth2/userinfo # Should return 401 (not 404) - Clear browser cache and cookies
- Try logging in again
π Resource Usage
Current configuration allocates:
| Service | CPU Limit | Memory Limit | CPU Reserved | Memory Reserved |
|---|---|---|---|---|
| aifa-site | 0.5 core | 512MB | 0.25 core | 256MB |
| aifa-oauth2-proxy | 0.25 core | 256MB | 0.1 core | 128MB |
Total: 0.75 CPU cores, 768MB RAM
Monitor with:
ssh root@31.97.61.154 "docker stats aifa-site aifa-oauth2-proxy"
π Updating the Site
After initial deployment, to update content:
# 1. Make your changes locally
git pull origin main # or edit files
# 2. Test locally if desired
bundle exec jekyll serve
# 3. Deploy
./deploy-prod.sh
# The script will rebuild and redeploy automatically
π‘οΈ Security Notes
.env.prodcontains secrets - Never commit to Git- Rotate OAuth secrets regularly
- Restrict GitHub access if needed:
# In .env.prod, add: OAUTH2_PROXY_GITHUB_USERS=username1,username2 # or OAUTH2_PROXY_GITHUB_ORG=your-org-name - Monitor access logs:
ssh root@31.97.61.154 "docker logs -f aifa-oauth2-proxy" - SSL certificates auto-renew via Traefik/Letβs Encrypt
π Quick Reference Commands
# View site logs
ssh root@31.97.61.154 "docker logs -f aifa-site"
# View auth logs
ssh root@31.97.61.154 "docker logs -f aifa-oauth2-proxy"
# Restart services
ssh root@31.97.61.154 "cd ~/aifa-website && docker-compose -f docker-compose.prod.yml restart"
# Check container health
ssh root@31.97.61.154 "docker ps | grep aifa"
# Monitor resources
ssh root@31.97.61.154 "docker stats aifa-site aifa-oauth2-proxy"
# Stop site
ssh root@31.97.61.154 "cd ~/aifa-website && docker-compose -f docker-compose.prod.yml down"
# Redeploy
./deploy-prod.sh
π Documentation Links
- Full Deployment Guide: DEPLOYMENT.md
- Server Configuration: PRODUCTION-SERVER-CONFIG.md
- Project README: README.md
- Contributing Guide: CONTRIBUTING.md
β¨ Next Steps After Deployment
- Test all features:
- Public pages loading correctly
- Authentication flow working
- Protected pages accessible after login
- CTA switching after login
- Monitor for 24 hours:
- Check logs for errors
- Monitor resource usage
- Verify SSL certificate issued correctly
- Share access (optional):
- Add specific GitHub users to
.env.prod - Or create GitHub org and restrict access
- Add specific GitHub users to
- Set up monitoring (optional):
- Add uptime monitoring (e.g., UptimeRobot)
- Set up log aggregation if needed
- Configure alerting for downtime
- Update content:
- Add more blog posts
- Expand documentation
- Add workflow examples
Status: β
READY TO DEPLOY
Created: 2025-10-11
Last Updated: 2025-10-11