Files
worldmonitor/src-tauri/tauri.conf.json
Elie Habib 32ca22d69f feat(analytics): add Umami analytics via self-hosted instance (#1914)
* feat(analytics): add Umami analytics via self-hosted instance

Adds Umami analytics script from abacus.worldmonitor.app and updates
CSP headers in both index.html and vercel.json to allow the script.

* feat(analytics): complete Umami integration with event tracking

- Add data-domains to index.html script to exclude dev traffic
- Add Umami script to /pro page and blog (Base.astro)
- Add TypeScript Window.umami shim to vite-env.d.ts
- Wire analytics.ts facade to Umami (replaces PostHog no-ops):
  search, country clicks, map layers, panels, LLM usage, theme,
  language, variant switch, webcam, download, findings, deeplinks
- Add direct callsite tracking for: settings-open, mcp-connect-attempt,
  mcp-connect-success, mcp-panel-add, widget-ai-open/generate/success,
  news-summarize, news-sort-toggle, live-news-fullscreen,
  webcam-fullscreen, search-open (desktop/mobile/fab)

* fix(analytics): add Tauri CSP allowlist for Umami + skip programmatic layer events

- Add abacus.worldmonitor.app to Tauri CSP script-src and connect-src
  so Umami loads in the desktop WebView (analytics exception to the
  no-cloud-data rule — needed to know if desktop is used)
- Filter trackMapLayerToggle to user-initiated events only to avoid
  inflating counts with programmatic toggles on page load
2026-03-20 12:51:32 +04:00

79 lines
2.6 KiB
JSON

{
"$schema": "https://schema.tauri.app/config/2",
"productName": "World Monitor",
"mainBinaryName": "world-monitor",
"version": "2.6.5",
"identifier": "app.worldmonitor.desktop",
"build": {
"beforeDevCommand": "npm run build:sidecar-sebuf && node scripts/build-sidecar-handlers.mjs && npm run dev",
"beforeBuildCommand": "npm run build:desktop",
"frontendDist": "../dist",
"devUrl": "http://localhost:3000"
},
"app": {
"windows": [
{
"title": "World Monitor",
"width": 1440,
"height": 900,
"minWidth": 1200,
"minHeight": 720,
"resizable": true,
"fullscreen": false,
"backgroundColor": [
26,
28,
30,
255
]
}
],
"security": {
"csp": "default-src 'self'; connect-src 'self' https: http://localhost:5173 http://127.0.0.1:* ws: wss: blob: data: https://abacus.worldmonitor.app; img-src 'self' data: blob: https:; style-src 'self' 'unsafe-inline'; script-src 'self' 'wasm-unsafe-eval' https://www.youtube.com https://abacus.worldmonitor.app; worker-src 'self' blob:; font-src 'self' data: https:; media-src 'self' data: blob: https: http://127.0.0.1:* http://localhost:*; frame-src 'self' http://127.0.0.1:* http://localhost:* https://worldmonitor.app https://tech.worldmonitor.app https://finance.worldmonitor.app https://commodity.worldmonitor.app https://happy.worldmonitor.app https://www.youtube.com https://www.youtube-nocookie.com https://webcams.windy.com;"
}
},
"bundle": {
"active": true,
"targets": [
"app",
"dmg",
"nsis",
"msi",
"appimage"
],
"category": "Productivity",
"shortDescription": "World Monitor desktop app (supports World and Tech variants)",
"longDescription": "World Monitor desktop app for real-time global intelligence. Build with VITE_VARIANT=tech to package Tech Monitor branding and dataset defaults.",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"resources": [
"../api",
"sidecar/local-api-server.mjs",
"sidecar/package.json",
"sidecar/node",
"../data",
"../src/config"
],
"windows": {
"digestAlgorithm": "sha256",
"timestampUrl": "https://timestamp.digicert.com",
"nsis": {
"installerHooks": "nsis/installer-hooks.nsh"
}
},
"macOS": {
"hardenedRuntime": true
},
"linux": {
"appimage": {
"bundleMediaFramework": true
}
}
}
}