Browse Source

Move radio to port 3002 (3000 is Gogs)

Gogs (code.davidawindham.com) already listens on 3000 in production, so the app
crash-looped with EADDRINUSE. 3001 is the ask/ralph server and 8181 is chess, so
3002 is the next free slot.

Updated ecosystem.config.cjs, the Apache proxy example, the systemd unit, and
.env.example. Verified end-to-end on 3002 locally through Apache at daw.stu/radio:
health OK and the socket.io websocket upgrades.
windhamdavid 8 hours ago
parent
commit
89e647bb2f
4 changed files with 9 additions and 9 deletions
  1. 1 1
      .env.example
  2. 6 6
      deploy/apache-radio.conf.example
  3. 1 1
      deploy/radio.service.example
  4. 1 1
      ecosystem.config.cjs

+ 1 - 1
.env.example

@@ -4,7 +4,7 @@
 # Replaces the old config.js / config-dev.js pair.
 
 # Port the node process listens on. Behind nginx this stays internal.
-PORT=3000
+PORT=3002
 
 # Where the app is mounted. Empty = domain root.
 # Set to /radio to serve at davidawindham.com/radio.

+ 6 - 6
deploy/apache-radio.conf.example

@@ -4,7 +4,7 @@
 # The radio app is a long-running Node process (see radio.service.example /
 # ecosystem.config.cjs). It is NOT served from the web docroot like the
 # PHP/WordPress parts of the site โ€” Apache proxies /radio through to node on
-# 127.0.0.1:3000.
+# 127.0.0.1:3002.
 #
 # Add the block below to the EXISTING davidwindham.com <VirtualHost> (the same
 # one that serves WordPress). Do NOT create a new vhost for it โ€” /radio has to
@@ -44,8 +44,8 @@
     # radio: node app mounted at /radio. Prefix kept on both sides;
     # BASE_PATH=/radio tells the app to expect it. upgrade=websocket carries
     # socket.io at /radio/socket.io (needs 2.4.47+).
-    ProxyPass         /radio  http://127.0.0.1:3000/radio  upgrade=websocket
-    ProxyPassReverse  /radio  http://127.0.0.1:3000/radio
+    ProxyPass         /radio  http://127.0.0.1:3002/radio  upgrade=websocket
+    ProxyPassReverse  /radio  http://127.0.0.1:3002/radio
 
 
 # ===========================================================================
@@ -64,10 +64,10 @@
     RewriteEngine On
     RewriteCond %{HTTP:Upgrade}    =websocket [NC]
     RewriteCond %{HTTP:Connection} upgrade    [NC]
-    RewriteRule ^/radio/(.*) ws://127.0.0.1:3000/radio/$1 [P,L]
+    RewriteRule ^/radio/(.*) ws://127.0.0.1:3002/radio/$1 [P,L]
 
-    ProxyPass         /radio  http://127.0.0.1:3000/radio
-    ProxyPassReverse  /radio  http://127.0.0.1:3000/radio
+    ProxyPass         /radio  http://127.0.0.1:3002/radio
+    ProxyPassReverse  /radio  http://127.0.0.1:3002/radio
 
 # ---------------------------------------------------------------------------
 # Notes

+ 1 - 1
deploy/radio.service.example

@@ -40,7 +40,7 @@ RestartSec=2
 # Config. Mirrors .env.example. DAW_ORIGIN is intentionally absent โ€” it is a
 # local-dev-only shim for the shared chrome and must NOT be set in production.
 Environment=NODE_ENV=production
-Environment=PORT=3000
+Environment=PORT=3002
 Environment=BASE_PATH=/radio
 Environment=TRUST_PROXY=1
 Environment=STREAM_URL=https://stream.davidawindham.com/stream

+ 1 - 1
ecosystem.config.cjs

@@ -47,7 +47,7 @@ module.exports = {
 
       env: {
         NODE_ENV: 'production',
-        PORT: 3000,
+        PORT: 3002,   // 3000 is Gogs, 3001 is ask, 8181 is chess
         BASE_PATH: '/radio',
         TRUST_PROXY: 1,