Skip to content

Open Questions [TEAM_WHY_NEEDED] & Tech Debt

Use this board during engineering/product reviews to record the historical “Why?” behind non-obvious rules and track cleanup priorities.

A. [TEAM_WHY_NEEDED] Questions for the Team

  1. proxy/conf.d/internal-email-templates.conf:11: Why do both PROD (supabase-auth) and DEV (supabase-auth-dev) fetch GoTrue email templates from /opt/vps-apps/microservices/dev/dealflow/email-templates/ instead of separating PROD templates?
  2. proxy/conf.d/supabase.conf:188-247 vs proxy/nginx.conf:120-124: Why are unreachable HTTPS port 8445 vhosts for telemetry.planovi.app and dev-telemetry.planovi.app still present when L4 SNI forwards them directly to :8444/:8443?
  3. proxy/nginx.conf:126-147: Why does mqtt.planovi.app route to mosquitto-dev:8883 instead of a dedicated mosquitto-prod broker, and should port 8883 remain IP-whitelisted?
  4. docker-compose.yml (PROD vs DEV): Should PROD and DEV eventually isolate JWT_SECRET, POSTGRES_PASSWORD, STRIPE_SECRET_KEY, and STRIPE_WEBHOOK_SECRET instead of sharing them?
  5. docker-compose.yml:551-553: Why are PUBLIC_SUPABASE_URL, SIGNING_PAGE_URL, and SIGNING_SECRET present on supabase-edge-runtime-dev but omitted from supabase-edge-runtime (PROD)?
  6. docker-compose.yml:478 & proxy/kong.yml: Why is proxy/kong-dev.yml untracked in Git, and why does proxy/kong.yml omit /realtime/v1/?
  7. docker-compose.yml:295-307: Can the unused flutter-web container be removed?
  8. php-app/Dockerfile:27 & .gitignore:22: Should COPY index.php be removed or should a stub php-app/index.php be tracked?
  9. deployer/deployer.py:24: Why is /opt/vps-stack/flutter-builder untracked in planovi-vps?
  10. .github/workflows/deploy.yml: Should this broken legacy workflow (referencing deleted ./fastapi-app) be deleted or rewritten to deploy planovi-vps configs?
  11. deployer/deployer.py:326-350: Was converter DB migration execution (added in commit 6faaa16) intentionally moved into FastAPI app startup?
  12. scripts/backup.sh vs scripts/backup_databases.sh: Which backup script is authoritative in live crontab, and when will off-site backup replication be automated?
  13. scripts/planovi-adduser.sh & setup-vps.sh: Should host group creation, /etc/sudoers.d/planovi-roles, and sshd_config SFTP-Jail blocks be versioned in this repo?
  14. setup-vps.sh:56-58 & scripts/update-allowed-ip.sh:45-47: Should UFW also explicitly allow 8883/tcp (MQTT TLS)?
  15. docs/: Should the local Starlight docs/ copy in planovi-vps be retired once PA-IDEAS/planovi-docs is updated from this blueprint?

B. Critical Security & Hardcoded Secret Anomalies (Action Required — Rotate & Clean)

  • .env.example:17-36: Contains real-looking API keys, database password, JWT secret, signed Supabase JWTs, and integration secrets committed in Git. Replace all values with dummy placeholders and rotate exposed keys.
  • scripts/backup.sh:22 & scripts/check-health.sh:16: Hardcoded fallback GOOGLE_CHAT_WEBHOOK_URL containing live space key & token.
  • scripts/backup_databases.sh:10: Hardcoded fallback POSTGRES_PASSWORD.
  • scripts/migrate-storage-files.py:7: Hardcoded legacy Supabase Cloud CLOUD_SERVICE_ROLE_KEY.
  • docker-compose.yml:417: Hardcoded fallback token for ASLANDI_EDGE_SHARED_TOKEN.
  • proxy/conf.d/converters.conf:33-36,94-97: Regex static asset locations bypass allowed_ips.conf IP whitelist on cloud.planovi.app and dev-cloud.planovi.app.
  • proxy/conf.d/supabase.conf:40-67,110-137: Studio vhosts expose /rest/v1/, /auth/v1/, /storage/v1/, /functions/v1/ without allowed_ips.conf (and dev-supabase-studio proxies /functions/v1/ directly to supabase-edge-runtime-dev:9000, bypassing Kong).
  • proxy/conf.d/apps.conf:270-348: agreements and offers vhosts lack the sensitive-file blocking rules (^/(data|vendor), .env, .log, etc.) present on dealflow and scheduler.
  • deployer/deployer.py:260: Temporary allowlist FLUTTER_TEMP_ALLOWED = {"DEALFLOW_API_SECRET", "SCHEDULER_API_SECRET"} still permits microservice secrets inside the public browser bundle (assets/env).

C. Bugs, Missing Tracked Configs & Dead/Legacy Artifacts

  • Broken CI Workflow: .github/workflows/deploy.yml:30,56-57 references non-existent ./fastapi-app context and fastapi-app service.
  • Missing Tracked Host Files Referenced by Runtime: proxy/kong-dev.yml (docker-compose.yml:478), /opt/vps-stack/mosquitto-dev/mosquitto.conf (docker-compose.yml:389), /opt/vps-stack/flutter-builder (deployer/deployer.py:24), and php-app/index.php (php-app/Dockerfile:27).
  • Missing .env.example Keys: 11 keys read by docker-compose.yml are missing from .env.example: FROM_EMAIL, UNSUBSCRIBE_BASE_URL, PORTAL_URL, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_INQUIRY_WEBHOOK_SECRET, SIGNING_SECRET_DEV, WEBHOOK_SECRET, GOOGLE_CHAT_WEBHOOK_URL, ASLANDI_EDGE_SHARED_TOKEN, ASLANDI_CARD_MASTER_KEY_B64.
  • Studio Edge Functions Mount Bug: docker-compose.yml:109-110,511-512 mounts ./supabase/functions instead of ./supabase/functions-prod / ./supabase/functions-dev.
  • HTML Typo & Legacy Branding: proxy/html/50x.html:217,231,237 uses 厺 (厺) instead of ↻ (↻); 404.html, 50x.html, default.html still use deprecated navy/purple/blue colors and Outfit font.
  • Dead / Orphaned Files & Containers: supabase_cloud_dump.sql (0-byte empty file), proxy/html/default.html (unreferenced), scripts/migrate-storage-files.py (one-off legacy cloud migration script), flutter-web container (docker-compose.yml:295-307), /app/deployer.py inside image (deployer/Dockerfile:10 unused because CMD runs mounted /opt/vps-stack/deployer/deployer.py), unreachable telemetry vhosts in proxy/conf.d/supabase.conf:188-247.
  • Edge Cases in Operational Scripts:
    • scripts/planovi-adduser.sh:16 has typo \docker'; Role 4 (SFTP-Jail) overwrites .ssh/authorized_keys and uploads/ ownership if two users share one SFTP_DIR.
    • scripts/planovi-dev-docker.sh:18 allows arbitrary -f <path> without restricting compose file location.
    • scripts/update-allowed-ip.sh:19,31-36 overwrites all existing whitelisted IPs with one IPv4 address and allows octets > 255.
    • scripts/check-health.sh:3 claims to monitor RAM, but checks only disk / (> 85%) and docker ps -a.
    • deployer/deployer.py:396-401 auto-rollback reverts Git checkout only, not rebuilt containers, rsync-ed Edge Functions, or Flutter build/web artifacts.