diff --git a/memory/shared-servers.md b/memory/shared-servers.md index 71d3dac..69df4c8 100644 --- a/memory/shared-servers.md +++ b/memory/shared-servers.md @@ -1,72 +1,122 @@ -# Payfrit Infrastructure — Server Map +# Payfrit Infrastructure — Full Server Survey +*Last updated: 2026-03-17 by @raj* ## Dev Server (dev.payfrit.com) -- **IP:** Behind WireGuard VPN (10.10.0.x) -- **SSH:** ssh dev.payfrit.com (user: john, key-based auth, port 38291) +- **Provider:** VPS (232GB disk, 7.7GB RAM) - **OS:** Ubuntu -- **Web:** nginx + PHP 8.3-FPM + Lucee/Tomcat (being migrated off) +- **SSH:** ssh dev.payfrit.com (user: john, key-based auth, port 38291) +- **VPN:** WireGuard (wg0) — 10.10.0.0/24, peer at 74.208.234.8:51820 +- **Disk:** 13GB used / 232GB total (6%) +- **RAM:** 1.5GB used / 7.7GB total +- **Uptime:** stable (3+ days as of survey) -### Sites on Dev Server -| Domain | Path | Stack | Notes | -|--------|------|-------|-------| -| dev.payfrit.com | /var/www/payfrit-api/ | PHP 8.3 | Main Payfrit API | -| dev.payfrit.com/food/ | /var/www/payfrit-food/ | PHP 8.3 | Payfrit Food (API + portals) | -| god.payfrit.com | /opt/lucee/tomcat/webapps/ROOT/god.payfrit.com/ | Lucee CFML (VPN-only) | Admin/god mode dashboard | -| git.payfrit.com | Forgejo (port 3000) | Go | Code hosting (Forgejo) | -| mm.payfrit.com | Mattermost | Go | Team chat | -| llm.payfrit.com | DELETED (2026-03-17) | — | Was a test LLM tool | +### Domains & Routing (nginx) +| Domain | Backend | Root/Proxy | SSL | Notes | +|--------|---------|-----------|-----|-------| +| dev.payfrit.com | PHP-FPM + Lucee | /var/www/payfrit-api/ (PHP), proxy 8888 (CFML fallback) | Let's Encrypt | PHP for /api/, /cron/, /food/; Lucee for everything else | +| dev.payfrit.com/food/ | PHP-FPM | /var/www/payfrit-food/ | (same cert) | Payfrit Food project | +| god.payfrit.com | Lucee + PHP-FPM | /opt/lucee/.../god.payfrit.com/ | Let's Encrypt | VPN-only (10.10.0.0/24). PHP for .php files, Lucee for rest | +| git.payfrit.com | Forgejo | proxy localhost:3000 | Let's Encrypt | Forgejo git hosting | +| code.payfrit.com | code-server | proxy localhost:8080 | Let's Encrypt | Web VS Code (not used for bots) | +| status.payfrit.com | Uptime Kuma | proxy localhost:3001 | Let's Encrypt | Monitoring dashboard | +| mm.payfrit.com | Mattermost | (separate server or config) | — | Team chat | +| llm.payfrit.com | **DELETED** | — | Cert still exists | Removed 2026-03-17 | -### Services on Dev Server -| Service | Status | Notes | -|---------|--------|-------| -| nginx | active | Reverse proxy for all sites | -| php8.3-fpm | active | PHP processing | -| Lucee/Tomcat (port 8888) | active (being phased out) | Only god mode left after CFM migration | -| forgejo | active | Git hosting at git.payfrit.com | -| payfrit-bot-poller | active | Polls MM for bot messages, responds via Claude API | -| payfrit-bot-worker | active | Picks BotTasks from DB, runs Claude Code CLI | +### Listening Ports +| Port | Service | Notes | +|------|---------|-------| +| 80 | nginx | HTTP (redirects to 443) | +| 443 | nginx | HTTPS for all domains | +| 38291 | sshd | SSH access | +| 3000 | Forgejo | Git hosting | +| 3001 | Uptime Kuma (node) | Status monitoring | +| 8080 | code-server (node) | Web VS Code | +| 8888 | Lucee/Tomcat (java) | CFML engine — being phased out | +| 8005 | Tomcat shutdown | Internal only | +| 8009 | Tomcat AJP | Internal only | -### Databases (10.10.0.1) +### Services +| Service | Status | Purpose | +|---------|--------|---------| +| nginx | running | Reverse proxy for all sites | +| php8.3-fpm | running | PHP processing | +| lucee_ctl (Tomcat) | running | CFML engine — only god mode + legacy endpoints | +| forgejo | running | Git hosting (git.payfrit.com) | +| code-server@john | running | Web VS Code (code.payfrit.com) — not used for bots | +| uptime-kuma | running | Monitoring (status.payfrit.com) | +| payfrit-bot-poller | running | Polls MM for bot messages, responds via Claude API | +| payfrit-bot-worker | running | Picks BotTasks from DB, runs Claude Code CLI | +| docker | running | Container runtime (no containers currently active) | +| fail2ban | running | SSH brute-force protection | +| WireGuard (wg0) | running | VPN tunnel to prod/office | + +### Web Roots +| Path | Contents | +|------|----------| +| /var/www/payfrit-api/ | Main Payfrit PHP API | +| /var/www/payfrit-food/ | Payfrit Food (PHP API + portals + bot scripts) | +| /var/www/bots/ | Central bot memory repo | +| /var/www/dev.payfrit.com/ | (may be unused — check) | +| /var/www/html/ | Default nginx root | +| /opt/lucee/tomcat/webapps/ROOT/ | Lucee webapps (main CFML app, god, legacy) | + +### Lucee Webapps (in /opt/lucee/tomcat/webapps/ROOT/) +Main CFML ordering platform directories: admin, api, cfpayment, config, cron, css, downloads, fonts, hud, images, includes, js, kds, library, migrations, modules, php-api, playwright, portal, qa, receipt, styles, temp, twilio, uploads, verticals, _webhook + +Sub-sites: god.payfrit.com/ (admin panel) + +### Cron Jobs (john's crontab) +| Schedule | Command | Purpose | +|----------|---------|---------| +| * * * * * | /home/john/check-deploy.sh | Auto-deploy on git push (main site) | +| * * * * * | /home/john/check-deploy-api.sh | Auto-deploy on git push (API) | +| */5 * * * * | curl .../cron/expireTabs.php | Expire stale tabs every 5 min | +| * * * * * | curl .../cron/expireStaleChats.php | Expire stale chats every 1 min | + +### Databases (MySQL at 10.10.0.1) | Database | Purpose | |----------|---------| -| payfrit | Main Payfrit (prod) | -| payfrit_dev | Main Payfrit (dev) | -| payfrit_food | Payfrit Food project | -- **User:** payfrit_app / Bv9#hLs4Wq@zK8nR -- **Access:** Via VPN or from dev server localhost +| payfrit | Main Payfrit (prod) — ordering, businesses, users, menus | +| payfrit_dev | Main Payfrit (dev/staging) | +| payfrit_food | Payfrit Food — products, sponsors, health scores, bot tasks | +| gvoice | Google Voice (purpose unclear — may be legacy) | +- **Credentials:** payfrit_app / Bv9#hLs4Wq@zK8nR +- **Access:** Via WireGuard VPN or from dev server localhost ## Prod Server (biz.payfrit.com) +- **IP:** 74.208.234.8 (WireGuard peer) - **Purpose:** Production Payfrit ordering platform -- **Stack:** Lucee/CFML + nginx -- **Deploys:** scp files then ssh to copy into place +- **Stack:** Lucee/CFML + nginx (assumed same as dev pattern) +- **Deploys:** scp files to dev, then copy into place -### Sites on Prod Server +### Sites on Prod | Domain | Purpose | |--------|---------| -| biz.payfrit.com | Payfrit ordering platform (businesses, menus, ordering) | +| biz.payfrit.com | Payfrit ordering platform (businesses, menus, KDS, HUD) | | food.payfrit.com | Payfrit Food marketing site (WordPress) | ## Git Repos (git.payfrit.com/payfrit/) -| Repo | Purpose | Local Path | -|------|---------|------------| -| payfrit-food | Food project (PHP API + portals + bot scripts) | C:\dev\payfrit-food\ | -| payfrit-api | Main Payfrit PHP API | C:\dev\payfrit-api\ | -| payfrit-biz | Biz portal frontend | C:\dev\payfrit-biz\ | -| bots | Central bot memory + infrastructure | C:\dev\bots\ | -| payfrit-user-android | Android customer app (Kotlin) | C:\dev\payfrit-android\ | -| payfrit-works-android | Android worker app (Kotlin) | C:\dev\payfrit-works-android\ | -| payfrit-beacon-android | Android beacon tool (Kotlin) | C:\dev\payfrit-beacon-android\ | -| payfrit-food-ios | iOS food scanner | — (Mac) | -| payfrit-user-ios | iOS customer app (Swift) | — (Mac) | -| payfrit-works-ios | iOS worker app (Swift) | — (Mac) | -| payfrit-beacon-ios | iOS beacon tool (Swift) | — (Mac) | -| payfrit-brand | Brand assets | C:\dev\payfrit-brand\ | -| payfrit-theme | Main WP theme | C:\dev\payfrit-theme\ | -| payfrit-pads-theme | Pads WP theme | C:\dev\payfrit-pads-theme\ | -| payfrit-god | God mode (admin panel) | — (on server) | -| payfrit-help | Help desk | — | -| payfrit-wp | WordPress config | — | -| payfrit-work | Work/tasks module | — | +| Repo | Purpose | Local Path | Server Path | +|------|---------|------------|-------------| +| payfrit-food | Food: PHP API + portals + bot scripts | C:\dev\payfrit-food\ | /var/www/payfrit-food/ | +| payfrit-api | Main PHP API | C:\dev\payfrit-api\ | /var/www/payfrit-api/ | +| payfrit-biz | Biz portal frontend | C:\dev\payfrit-biz\ | — | +| bots | Bot memory + infra docs | C:\dev\bots\ | /var/www/bots/ | +| payfrit-user-android | Android customer app (Kotlin) | C:\dev\payfrit-android\ | — | +| payfrit-works-android | Android worker app (Kotlin) | C:\dev\payfrit-works-android\ | — | +| payfrit-beacon-android | Android beacon tool (Kotlin) | C:\dev\payfrit-beacon-android\ | — | +| payfrit-food-ios | iOS food scanner (Swift) | — (Mac) | — | +| payfrit-user-ios | iOS customer app (Swift) | — (Mac) | — | +| payfrit-works-ios | iOS worker app (Swift) | — (Mac) | — | +| payfrit-beacon-ios | iOS beacon tool (Swift) | — (Mac) | — | +| payfrit-brand | Brand assets | C:\dev\payfrit-brand\ | — | +| payfrit-theme | Main WP theme | C:\dev\payfrit-theme\ | — | +| payfrit-pads-theme | Pads WP theme | C:\dev\payfrit-pads-theme\ | — | +| payfrit-god | God mode admin panel | — | /opt/lucee/.../god.payfrit.com/ | +| payfrit-help | Help desk | — | — | +| payfrit-wp | WordPress config | — | — | +| payfrit-work | Work/tasks module | — | — | +| addmonths/app | Add Months Flutter app | C:\dev\add_months\ | — | ## Deploy Commands ```bash @@ -86,16 +136,21 @@ git push origin main && ssh dev.payfrit.com "sudo git -C /var/www/bots pull orig ## Key URLs | URL | Purpose | |-----|---------| -| https://dev.payfrit.com | Dev main site | -| https://dev.payfrit.com/food/ | Dev food portal | -| https://biz.payfrit.com | Prod ordering | -| https://food.payfrit.com | Food marketing (WP) | +| https://dev.payfrit.com | Dev main site (CFML + PHP) | +| https://dev.payfrit.com/food/ | Dev food portal (PHP) | +| https://biz.payfrit.com | Prod ordering platform | +| https://food.payfrit.com | Food marketing (WordPress) | | https://god.payfrit.com | Admin dashboard (VPN-only) | | https://git.payfrit.com | Forgejo git hosting | | https://mm.payfrit.com | Mattermost team chat | +| https://code.payfrit.com | Web VS Code (not actively used) | +| https://status.payfrit.com | Uptime Kuma monitoring | ## Migration Status (2026-03-17) -- llm.payfrit.com: DELETED -- 6 CFM API endpoints: being migrated to PHP by @mike -- god.payfrit.com: staying on Lucee for now (VPN-only, low priority) -- Goal: shut down Lucee once CFM endpoints are migrated +- [x] llm.payfrit.com: DELETED +- [x] nginx duplicate configs cleaned up (dev.payfrit.com.bak, god.payfrit.com.bak) +- [ ] 6 CFM API endpoints: being migrated to PHP by @mike (almost done) +- [ ] god.payfrit.com: staying on Lucee for now (VPN-only, ~30 CFM endpoints) +- [ ] code-server: still running but not used for bots — could be disabled to save resources +- [ ] gvoice database: purpose unclear — may be legacy, investigate +- **Goal:** shut down Lucee once all CFM endpoints are migrated