← back to Allnewsdaily
Live feature: LIVE_STATIC mode + Mac2 push (consent-cookie failed on prod's datacenter IP)
7620db772f321757ea2439fb9a054e4e41d1950f · 2026-09-09 14:53:53 -0700 · Steve
The consent-cookie bypass wasn't enough — prod still reads 0/98 live (YouTube hard-blocks
the datacenter IP). Fallback mirrors the wire.json push architecture:
- server.js: LIVE_STATIC=1 disables prod's own checker so it stops overwriting pushed data.
- scripts/push-live-status.sh: runs check-live.js on Mac2 (residential IP → 24 live) and
rsyncs data/live-status.json to prod. Mirrors push-wire.sh.
- com.steve.allnewsdaily-live-push.plist: Mac2 LaunchAgent, every 120s (load is Steve-gated).
Go-live (gated, Steve): (1) set LIVE_STATIC=1 on prod the same way WIRE_STATIC=1 is set +
reload; (2) load the Mac2 push LaunchAgent. Then prod serves the real ~24 live outlets.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PV1DXsyryWT3rLttpPXd4u
Files touched
A com.steve.allnewsdaily-live-push.plistA scripts/push-live-status.shM server.js
Diff
commit 7620db772f321757ea2439fb9a054e4e41d1950f
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Sep 9 14:53:53 2026 -0700
Live feature: LIVE_STATIC mode + Mac2 push (consent-cookie failed on prod's datacenter IP)
The consent-cookie bypass wasn't enough — prod still reads 0/98 live (YouTube hard-blocks
the datacenter IP). Fallback mirrors the wire.json push architecture:
- server.js: LIVE_STATIC=1 disables prod's own checker so it stops overwriting pushed data.
- scripts/push-live-status.sh: runs check-live.js on Mac2 (residential IP → 24 live) and
rsyncs data/live-status.json to prod. Mirrors push-wire.sh.
- com.steve.allnewsdaily-live-push.plist: Mac2 LaunchAgent, every 120s (load is Steve-gated).
Go-live (gated, Steve): (1) set LIVE_STATIC=1 on prod the same way WIRE_STATIC=1 is set +
reload; (2) load the Mac2 push LaunchAgent. Then prod serves the real ~24 live outlets.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PV1DXsyryWT3rLttpPXd4u
---
com.steve.allnewsdaily-live-push.plist | 28 ++++++++++++++++++++++++++++
scripts/push-live-status.sh | 24 ++++++++++++++++++++++++
server.js | 12 ++++++++++--
3 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/com.steve.allnewsdaily-live-push.plist b/com.steve.allnewsdaily-live-push.plist
new file mode 100644
index 0000000..aa6d447
--- /dev/null
+++ b/com.steve.allnewsdaily-live-push.plist
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.steve.allnewsdaily-live-push</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/bin/bash</string>
+ <string>/Users/macstudio3/Projects/allnewsdaily/scripts/push-live-status.sh</string>
+ </array>
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>PATH</key>
+ <string>/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
+ <key>HOME</key>
+ <string>/Users/macstudio3</string>
+ </dict>
+ <key>StartInterval</key>
+ <integer>120</integer>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>StandardOutPath</key>
+ <string>/Users/macstudio3/Projects/allnewsdaily/data/live-push.log</string>
+ <key>StandardErrorPath</key>
+ <string>/Users/macstudio3/Projects/allnewsdaily/data/live-push.log</string>
+</dict>
+</plist>
diff --git a/scripts/push-live-status.sh b/scripts/push-live-status.sh
new file mode 100755
index 0000000..9316ade
--- /dev/null
+++ b/scripts/push-live-status.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+# Run the YouTube live-check locally (this Mac has a residential IP that YouTube serves the real
+# watch page to) then rsync ONLY data/live-status.json to prod, which runs with LIVE_STATIC=1 and
+# does NOT run its own checker (prod's datacenter IP gets a consent/bot wall → 0 live).
+# Runs from a launchd job on this Mac every ~2 min. Reversible: unload the job to stop.
+set -euo pipefail
+cd "$(dirname "$0")/.."
+PROD="${PROD_HOST:-root@45.61.58.125}"
+REMOTE="/root/Projects/allnewsdaily/data/live-status.json"
+
+# Resolve node robustly (launchd has a minimal PATH).
+NODE="$(command -v node || true)"
+for cand in /opt/homebrew/bin/node /usr/local/bin/node /usr/bin/node; do
+ [ -z "$NODE" ] && [ -x "$cand" ] && NODE="$cand"
+done
+[ -n "$NODE" ] || { echo "[push-live] node not found"; exit 3; }
+
+"$NODE" scripts/check-live.js || { echo "[push-live] check failed, not pushing"; exit 1; }
+
+# only push a valid JSON object
+"$NODE" -e "const s=require('./data/live-status.json'); if(typeof s!=='object'||Array.isArray(s)){process.exit(2)}" || { echo "[push-live] live-status.json invalid, not pushing"; exit 2; }
+
+rsync -az -e "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new" data/live-status.json "$PROD:$REMOTE"
+echo "[push-live] pushed $(date -u +%FT%TZ) → $PROD:$REMOTE"
diff --git a/server.js b/server.js
index cb736ad..15ec081 100644
--- a/server.js
+++ b/server.js
@@ -7,6 +7,10 @@ const { rebuild, getWire, meta, loadStaticWire } = require('./lib/aggregate');
// On prod (no Ollama) set WIRE_STATIC=1: serve the pre-built data/wire.json, refreshed by an
// external pusher (scripts/build-wire.js on a machine that HAS Ollama). Never fetches/rewrites here.
const WIRE_STATIC = process.env.WIRE_STATIC === '1';
+// On prod (datacenter IP) YouTube serves a consent/bot wall, so the live checker finds 0 live.
+// Set LIVE_STATIC=1 to DISABLE the local checker and instead serve data/live-status.json pushed
+// from a residential-IP machine (Mac2) via scripts/push-live-status.sh — mirrors WIRE_STATIC.
+const LIVE_STATIC = process.env.LIVE_STATIC === '1';
const app = express();
const PORT = process.env.PORT || 9788;
@@ -445,8 +449,12 @@ const WIRE_REFRESH_MS = parseInt(process.env.WIRE_REFRESH_MS || String(REFRESH_M
app.listen(PORT, () => {
console.log(`allnewsdaily listening on http://0.0.0.0:${PORT}`);
console.log(`outlets loaded: ${loadOutlets().length}`);
- runChecker();
- setInterval(runChecker, POLL_INTERVAL_MS);
+ if (LIVE_STATIC) {
+ console.log('[live] static mode — serving pushed live-status.json (local checker disabled)');
+ } else {
+ runChecker();
+ setInterval(runChecker, POLL_INTERVAL_MS);
+ }
if (WIRE_STATIC) {
// Prod: serve the pre-built snapshot; re-read the file as the pusher refreshes it.
const ok = loadStaticWire();
← 60e002d /directory UX pass: fix dead logos, tool-first layout, live-
·
back to Allnewsdaily
·
Live static-mode via sentinel file (no prod env/restart) ins 9a1fdc0 →