Update index.tsx for feat: allow configuring internal port via CONVERTX_PORT

### Description
This PR updates the server initialization line to check for a dedicated `CONVERTX_PORT` environment variable before falling back to `PORT` or the default `3000`.

### Motivation
While ConvertX already supports the generic `PORT` environment variable, adding a container-specific variable (`CONVERTX_PORT`) provides distinct advantages for advanced homelab deployments:
1. **Host Networking Layering (`network_mode: host`):** Essential for deployments where using a generic `PORT` variable can cause unintended environment leakage or conflicts across multiple containers sharing the host network namespace.
2. **Explicit Configuration:** Makes docker-compose files and Podman Quadlets much easier to read and maintain by keeping environment variables distinct to their specific applications.

### Backward Compatibility
This change utilizes a standard fallback chain (`process.env.CONVERTX_PORT || process.env.PORT || 3000`). If neither variable is set, the application continues to default to `3000`. Existing installations and deployments relying on the generic `PORT` variable will experience zero breaking changes.
This commit is contained in:
upmcplanetracker 2026-06-09 09:54:52 -04:00 committed by GitHub
parent 0965928949
commit c18c8000ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,7 +65,7 @@ if (process.env.NODE_ENV !== "production") {
}); });
} }
app.listen(process.env.PORT || 3000); app.listen(process.env.CONVERTX_PORT || process.env.PORT || 3000);
console.log(`🦊 Elysia is running at http://${app.server?.hostname}:${app.server?.port}${WEBROOT}`); console.log(`🦊 Elysia is running at http://${app.server?.hostname}:${app.server?.port}${WEBROOT}`);