fix: Separate internal and external server URLs for SSL compatibility
All checks were successful
build-and-deploy / filter (push) Successful in 1s
build-and-deploy / build (push) Successful in 11s
build-and-deploy / deploy (push) Successful in 10s

- Add PUBLIC_SERVER_URL environment variable for client-side connections
- Update /api/config endpoints to return public HTTPS URLs for frontend
- Keep internal HTTP URLs for server-to-server communication
- Resolves SSL certificate verification issues in admin service
- Maintains secure WSS/HTTPS connections for clients
This commit is contained in:
2025-07-05 16:43:29 -06:00
parent 70cb8b5be1
commit f3d1365588
3 changed files with 6 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ app.get('/health', (req, res) => {
// API endpoint to get environment config for client // API endpoint to get environment config for client
app.get('/api/config', (req, res) => { app.get('/api/config', (req, res) => {
res.json({ res.json({
serverUrl: process.env.SERVER_URL, serverUrl: process.env.PUBLIC_SERVER_URL || process.env.SERVER_URL,
environment: ENV environment: ENV
}); });
}); });

View File

@@ -51,7 +51,7 @@ app.get('/health', (req, res) => {
// API endpoint to get environment config for client // API endpoint to get environment config for client
app.get('/api/config', (req, res) => { app.get('/api/config', (req, res) => {
res.json({ res.json({
serverUrl: process.env.SERVER_URL, serverUrl: process.env.PUBLIC_SERVER_URL || process.env.SERVER_URL,
environment: ENV environment: ENV
}); });
}); });

View File

@@ -30,7 +30,8 @@ services:
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=3000 - PORT=3000
- SERVER_URL=https://snatchGameServer.interno.com - SERVER_URL=http://snatchgame-server:2567
- PUBLIC_SERVER_URL=https://snatchGameServer.interno.com
depends_on: depends_on:
- snatchgame-server - snatchgame-server
networks: networks:
@@ -53,7 +54,8 @@ services:
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=3001 - PORT=3001
- SERVER_URL=https://snatchGameServer.interno.com - SERVER_URL=http://snatchgame-server:2567
- PUBLIC_SERVER_URL=https://snatchGameServer.interno.com
depends_on: depends_on:
- snatchgame-server - snatchgame-server
networks: networks: