Skip to content

Dev#39

Merged
tusharkhatriofficial merged 2 commits intomainfrom
dev
Feb 18, 2026
Merged

Dev#39
tusharkhatriofficial merged 2 commits intomainfrom
dev

Conversation

@tusharkhatriofficial
Copy link
Copy Markdown
Owner

No description provided.

…ocalhost

The dashboard WebSocket was hardcoded to http://localhost:8080/ws as
fallback. When deployed on a VPS, the browser tried to connect to
localhost (user's machine) instead of the server IP, causing CORS errors.

Now uses window.location.origin at runtime so it works on any deployment
(VPS, Coolify, custom domain) without configuration.
@tusharkhatriofficial tusharkhatriofficial merged commit 028be56 into main Feb 18, 2026
2 checks passed
Copy link
Copy Markdown

@charliecreates charliecreates Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The useWebSocketMetrics default URL derivation improves deployability, but it should emit an explicit ws:///wss:// URL rather than using window.location.origin (HTTP/S), to avoid client/library incompatibilities and mixed-content issues. The deployment guide is much more comprehensive, but it currently recommends piping a remote install script to sh without a production caveat, which conflicts with the hardening theme. The troubleshooting guidance around changing EVENTARA_PORT can desync the rest of the doc (firewall/proxy/URLs) unless you add consistency notes.

Additional notes (1)
  • Maintainability | DEPLOYMENT.md:109-124
    The “You should see all 4 containers running” example is brittle: Compose project/service names vary by directory name, COMPOSE_PROJECT_NAME, and Compose v2 naming (often includes -1 suffix). Also, statuses and port mappings can differ depending on env/ports. This is documentation, but presenting exact names as an expectation can mislead users into thinking something is broken when their output differs.
Summary of changes

What changed

DEPLOYMENT.md

  • Rewrote the deployment doc into a VPS-focused, step-by-step guide for Ubuntu/DigitalOcean.
  • Added minimum/recommended sizing, rationale for memory needs, and example droplet tiers.
  • Expanded operational guidance:
    • Docker install, repo clone, .env setup
    • docker compose ... up -d --build, verification (ps, curl test), log commands
    • Updating, troubleshooting, and “nuclear reset” instructions
  • Added optional HTTPS/domain setup via Caddy or Nginx + Certbot, plus UFW firewall guidance.
  • Added a resource limits table and an updated production hardening checklist.

eventara-dashboard/src/hooks/useWebSocket.ts

  • Removed the hardcoded localhost WebSocket default.
  • Introduced getDefaultWsUrl() to derive the WS endpoint from:
    1. import.meta.env.VITE_API_URL (if set)
    2. window.location.origin (same-origin fallback)
    3. last-resort http://localhost:8080/ws
  • Hook now defaults to getDefaultWsUrl() for deployment portability.

Comment thread DEPLOYMENT.md
Comment on lines +31 to +51
## Step 1 — Install Docker

You're already SSH'd into the droplet. Run these commands:

```bash
# Update packages
sudo apt update && sudo apt upgrade -y

# Install Docker via the official convenience script
curl -fsSL https://get.docker.com | sh

# Add your user to the docker group (avoids needing sudo for docker commands)
sudo usermod -aG docker $USER

# Apply group change (or log out and back in)
newgrp docker

# Verify Docker is working
docker --version
docker compose version
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guide recommends installing Docker via curl ... | sh. That’s convenient, but it’s also a known security risk (piping remote scripts to root) and can be frowned upon for production hardening.

Since this doc includes a “Production Hardening Checklist”, it would be more consistent to either:

  • include the official apt-repo installation steps (recommended), or
  • clearly label the convenience script as a fast path for demos and point production users to the official install docs.

This is documentation, but it directly impacts operator security posture.

Suggestion

Adjust Step 1 to either (a) use Docker’s official apt repository installation instructions, or (b) keep the convenience script but add a prominent note and link to the official docs.

For example, add:

Reply with "@CharlieHelps yes please" if you’d like me to add a commit updating the doc accordingly.

Comment thread DEPLOYMENT.md
Comment on lines +305 to +314
### Common Issues

| Service | Memory Limit |
| Problem | Fix |
|---|---|
| Postgres | 1 GB |
| Kafka | 1 GB |
| Redis | 512 MB |
| Eventara (API + Dashboard) | 1 GB |
| `port is already allocated` | Change `EVENTARA_PORT=3000` in `.env` |
| Containers keep restarting | Check logs: `docker compose -f docker-compose.prod.yaml logs eventara` |
| Out of memory (OOM killed) | Upgrade to a larger droplet (8 GB) or reduce JVM: `JAVA_OPTS=-Xms128m -Xmx256m` |
| Kafka unhealthy | Wait 30-60 seconds, Kafka is slow to start. If persistent: `docker compose -f docker-compose.prod.yaml restart kafka` |
| Can't connect from browser | Ensure firewall allows port 8080: `sudo ufw allow 8080` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The troubleshooting row suggests fixing port is already allocated by setting EVENTARA_PORT=3000, but elsewhere the document repeatedly assumes 8080 (firewall rules, URLs, reverse proxy examples). As written, a user who changes the port per this advice may end up with mismatched instructions and a broken access path.

If you want to support arbitrary ports, the doc should consistently reference ${EVENTARA_PORT} (or explicitly say “if you change it, update firewall/proxy/URLs accordingly”).

Suggestion

Make the port guidance consistent:

  • Change the fix to "Change EVENTARA_PORT to a free port (e.g. 3000)" and
  • Add a note: "If you change EVENTARA_PORT, also update UFW rules and reverse proxy upstream (e.g. reverse_proxy localhost:${EVENTARA_PORT}) and the URLs you use to access the app."

Reply with "@CharlieHelps yes please" if you’d like me to add a commit with these doc adjustments.

@charliecreates charliecreates Bot removed the request for review from CharlieHelps February 18, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant