Commit Graph

37 Commits

Author SHA1 Message Date
Elie Habib
f6e7bbbfbc chore: enforce desktop version sync 2026-02-19 07:53:15 +04:00
Elie Habib
a9f6909a20 fix(i18n): fix 5 P1/P2 bugs — timeAgo count, community widget, Linux AppImage, locale gaps, lang normalization
- Fix relative-time {{count}} placeholders in all 12 locales (5m ago, not m ago)
- Localize CommunityWidget: replace 3 hardcoded English strings with t() calls
- Add Linux AppImage to tech/finance Tauri configs, CI matrix (ubuntu-22.04), packaging scripts, and download-node.sh
- Fix language code normalization: add supportedLngs/nonExplicitSupportedLngs to i18next, normalize getCurrentLanguage()
- Translate ~240 untranslated English strings across 11 locale files (ru/ar/zh now 100% translated)
- Add components.community section to all 12 locales
- All 12 locales at 1130-key parity, 0 placeholder mismatches
2026-02-18 07:16:47 +04:00
Elie Habib
196c79c023 fix(cors): add finance.worldmonitor.app to Railway proxy allowlist
Polymarket and other proxied requests from finance variant were blocked
by CORS because the Railway relay only allowed worldmonitor.app and
tech.worldmonitor.app origins.
2026-02-17 16:02:32 +04:00
Elie Habib
c94ec0b4ad Adding Node in the Tauri Installer 2026-02-16 23:30:19 +04:00
Elie Habib
9f378d533b fix: restrict Railway relay CORS to allowed origins only
Replace Access-Control-Allow-Origin: * with an allowlist of our domains
(worldmonitor.app, tech.worldmonitor.app, localhost dev ports, Tauri,
and *.vercel.app previews). Prevents third parties from using the relay
as a free proxy.
2026-02-15 19:01:06 +04:00
Elie Habib
9c2104d936 fix: hide desktop config panel on web, route World Bank & Polymarket via Railway
Desktop Configuration panel was leaking to web due to being in
FULL_PANELS/TECH_PANELS configs. Removed from static configs (injected
programmatically for Tauri) and filtered from toggle UI on web.

World Bank API returns 403 to Vercel edge IPs. Added /worldbank proxy
route to Railway relay with full response transformation and 30-min cache.
Client tries Railway first, falls back to Vercel.

Polymarket gamma-api suffers Cloudflare JA3 blocking from Vercel.
Added /polymarket proxy route to Railway relay with 2-min cache.
Client fallback chain: browser-direct → Tauri → Railway → Vercel → production.
2026-02-15 18:59:01 +04:00
Elie Habib
c353cf2070 Reduce egress costs, add PWA support, fix Polymarket and Railway relay
Egress optimization:
- Add s-maxage + stale-while-revalidate to all API endpoints for Vercel CDN caching
- Add vercel.json with immutable caching for hashed assets
- Add gzip compression to sidecar responses >1KB
- Add gzip to Railway RSS responses (4 paths previously uncompressed)
- Increase polling intervals: markets/crypto 60s→120s, ETF/macro/stablecoins 60s→180s
- Remove hardcoded Railway URL from theater-posture.js (now env-var only)

PWA / Service Worker:
- Add vite-plugin-pwa with autoUpdate strategy
- Cache map tiles (CacheFirst), fonts (StaleWhileRevalidate), static assets
- NetworkOnly for all /api/* routes (real-time data must be fresh)
- Manual SW registration (web only, skip Tauri)
- Add offline fallback page
- Replace manual manifest with plugin-generated manifest

Polymarket fix:
- Route dev proxy through production Vercel (bypasses JA3 blocking)
- Add 4th fallback tier: production URL as absolute fallback

Desktop/Sidecar:
- Dual-backend cache (_upstash-cache.js): Redis cloud + in-memory+file desktop
- Settings window OK/Cancel redesign
- Runtime config and secret injection improvements
2026-02-14 19:53:04 +04:00
Elie Habib
ad4e52caee Fix Tauri desktop runtime reliability and settings UX 2026-02-13 23:05:51 +04:00
Elie Habib
c1584987f5 Route Atlantic Council RSS through Railway to fix 504 timeouts 2026-02-13 19:02:12 +04:00
Elie Habib
15134a4b7a Add gzip compression and WS client cap for further egress reduction
- gzip all JSON responses (OpenSky, UCDP, AIS snapshot): ~80% smaller
- Cap WebSocket clients at 10 (app uses HTTP snapshots, not WS)
2026-02-13 18:42:15 +04:00
Elie Habib
d3f9100f52 Add server-side caching to Railway relay — eliminates ~1.7TB/day egress
Critical cost optimization for 57+ concurrent clients:

- OpenSky response cache (30s TTL per bounding box): ~1.2TB/day saved
- RSS response cache (5min TTL per feed URL): ~30GB/day saved
- AIS WebSocket fanout throttled to 1/10 messages: ~400GB/day saved
- Cache cleanup interval, health stats, stale fallbacks
2026-02-13 18:37:13 +04:00
Elie Habib
0503f20943 Move UCDP proxy to Railway with persistent in-memory cache
- Add /ucdp-events handler to ais-relay.cjs with 6h TTL cache,
  background refresh, version discovery, and 30s per-page timeout
- Route client through Railway when VITE_WS_RELAY_URL is set
- Add 8s AbortController timeout to Vercel fallback fetchGedPage()
2026-02-13 18:29:30 +04:00
Elie Habib
e185d0e6f7 build: fail fast when local tauri cli is missing 2026-02-13 14:40:57 +04:00
Elie Habib
cca1a43df6 Harden local Tauri CLI invocation and fix validation report 2026-02-13 13:44:47 +04:00
Elie Habib
b3b830f05e Use local Tauri CLI for desktop scripts 2026-02-13 13:28:58 +04:00
Elie Habib
e613ea5217 Refine signing guardrails for desktop packaging 2026-02-13 10:33:25 +04:00
Elie Habib
a97157b9c5 Add reproducible cross-OS Tauri packaging workflow 2026-02-13 10:27:39 +04:00
Elie Habib
14c67ff592 Optimize proxy usage with AIS snapshots, Upstash caching, and telemetry 2026-02-11 19:06:00 +04:00
Elie Habib
49e766b21d Fix RSS proxy corrupting gzip-compressed upstream responses
UN News and other servers return gzip-compressed RSS. The proxy was
concatenating binary chunks as strings, corrupting non-UTF8 bytes.

Fix: Use Buffer.concat() and decompress gzip/deflate responses.
2026-01-25 16:38:47 +04:00
Elie Habib
1a60bdeee6 Add resizable panels, fix Railway crash, improve AI Insights
- Panel resize: drag bottom edge to span 1-4 grid rows, persisted to localStorage
- Fix HTML5 drag conflict with resize using capture-phase listeners
- Fix memory leaks in Panel.ts (document listeners now cleaned up)
- Fix Railway ERR_HTTP_HEADERS_SENT crash with response flag pattern
- Improve AI summarization prompts to focus on ONE dominant narrative
- Add VIOLENCE_KEYWORDS and UNREST_KEYWORDS for better story discovery
- Add combo bonus for flashpoint + unrest stories (e.g., Iran protests)
- Relax 2-source filter for high-scoring critical stories (score > 100)
2026-01-25 15:39:53 +04:00
Elie Habib
7e1dfcb160 Improve search results and fix RSS feeds
- Double MAX_RESULTS from 12 to 24
- Prioritize news over static infrastructure in search
- Update News24 URL to post-redirect destination (feeds.capi24.com)
- Add trailing slash to SCMP URL
- Add feeds.capi24.com to both proxy allowlists
2026-01-25 13:51:54 +04:00
Elie Habib
d62923ee37 Add redirect following (301/302) to Railway RSS proxy 2026-01-25 13:50:00 +04:00
Elie Habib
01f5af89b8 Add missing domains to Railway RSS proxy allowlist
Railway's RSS proxy had only 5 domains in allowlist, causing 403 errors.
Added all domains that use railwayRss() routing in feeds.ts:
- Al Arabiya, Arab News, Times of Israel, SCMP
- UN News, CISA, News24
- Plus IAEA, WHO, Crisis Group, Kyiv Independent, Moscow Times for future use
2026-01-25 13:27:19 +04:00
Elie Habib
6f879d899e Fix data freshness and OpenSky OAuth2 authentication
- Make ACLED optional (GDELT provides fallback protest data)
- Core sources now: gdelt + rss (was: acled + gdelt + rss)
- Update Railway proxy to use OAuth2 client credentials flow
- Cache OAuth2 token with auto-refresh before expiry
- Invalidate token cache on 401 response
2026-01-15 08:12:52 +04:00
Elie Habib
02f8d6bd31 Add OpenSky authentication to Railway proxy
OpenSky blocks unauthenticated cloud IPs. Updated proxy to
use Basic Auth with OPENSKY_CLIENT_ID and OPENSKY_CLIENT_SECRET
environment variables.
2026-01-13 22:29:40 +04:00
Elie Habib
7d9d5b3d30 fix(ais-relay): race condition causing WebSocket crash
- Skip if socket is CONNECTING (not just OPEN)
- Use local socket reference to prevent event handler confusion
- Add race condition guards before send/message operations
- Set upstreamSocket=null on close for clean reconnection
2026-01-13 11:09:12 +04:00
Elie Habib
32f3d9f231 Route UN News + CISA feeds via Railway proxy
- Add news.un.org and www.cisa.gov to Railway RSS allowlist
- Reuse existing VITE_WS_RELAY_URL for RSS proxy (no new env var needed)
- Falls back to Vercel proxy if Railway not configured
2026-01-12 22:29:38 +04:00
Elie Habib
9df91b2dd5 Remove The Telegraph feed - blocks all cloud providers
Akamai CDN blocks both Vercel and Railway IPs, making the
feed unreachable from any cloud infrastructure. Guardian
already provides UK news coverage.
2026-01-11 17:29:42 +04:00
Elie Habib
6b3a1f78ff Add Railway RSS proxy for feeds that block Vercel
- Add /rss endpoint to ais-relay.cjs for blocked domains
- Add railwayRss() helper that routes to Railway relay
- Route Telegraph and CNN through Railway proxy
- Keeps security whitelist on Railway side
2026-01-11 17:21:16 +04:00
Elie Habib
4bc957a362 Route OpenSky through Railway relay (bypasses Vercel block)
- Add /opensky HTTP endpoint to ais-relay.cjs
- Update military-flights.ts to use Railway for OpenSky
- Converts VITE_WS_RELAY_URL to HTTP URL for same server
2026-01-11 09:15:46 +04:00
Elie Habib
995ade3f4b Split architecture: Vercel frontend + Railway WebSocket
- Railway: WebSocket relay only (simpler)
- Vercel: Frontend + API serverless functions
- Added Cloudflare Radar serverless proxy
- Removed auth header from frontend (serverless handles it)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 14:32:18 +04:00
Elie Habib
5d7fab64ae Fix: Convert Buffer to string for browser WebSocket clients
Node.js ws library receives messages as Buffer by default.
Browser WebSocket expects string data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 14:24:12 +04:00
Elie Habib
3d1ab4cf58 Serve frontend + WebSocket from single Railway deployment
- Relay now serves static files from dist/
- Frontend connects to WebSocket on same origin
- Railway build: npm install && npm run build && cd scripts && npm install

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 14:19:39 +04:00
Elie Habib
fe1bccdd40 Add HTTP server for Railway health checks
Railway requires an HTTP endpoint for health checks. Added HTTP server
that responds to / and /health with status JSON, with WebSocket server
attached to the same HTTP server.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 14:01:33 +04:00
Elie Habib
24b95a4532 Prepare AIS relay for Railway deployment
- Add package.json for standalone deployment
- Use PORT env variable for Railway compatibility
- Support AISSTREAM_API_KEY env variable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 13:50:59 +04:00
Elie Habib
70f26c9cf4 Remove hardcoded API key from relay script
Require VITE_AISSTREAM_API_KEY env variable instead of fallback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 13:44:19 +04:00
Elie Habib
a9d67ed7aa Rename AIS to Shipping, add WebSocket relay for live vessel tracking
- Rename AIS layer to "Shipping" throughout UI for clarity
- Add local WebSocket relay server to proxy aisstream.io data
- Fix cable-activity.ts NGA warnings array handling bug
- Add ws package for relay server
- Improve Shipping service logging and error handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 13:29:59 +04:00