Site Configuration
js_siteConfig contains the site/startup configuration for the web client.
It defines default values in code and then (optionally) overrides them from public/config.json at runtime.
Files:
src/js/js_siteConfig.jspublic/config.json
What js_siteConfig is responsible for
src/js/js_siteConfig.js exports configuration values that are used across the web client, such as:
Which backend/auth host/port to use (test vs prod)
Map tile URL
Feature flags
Language settings
WebRTC ICE servers
Various header links
This layer is meant to be controlled by deployment configuration (public/config.json).
How public/config.json overrides js_siteConfig
At the bottom of src/js/js_siteConfig.js, there is a loadConfigSync() function that:
Loads
/config.jsonusing a synchronousXMLHttpRequestStrips comments before parsing:
Removes multi-line comments
/* ... */Removes single-line comments
// ...
Parses the result with
JSON.parseApplies overrides by updating exported
letvariables
Important notes:
Because the load is synchronous, the config values are available immediately to modules that import
js_siteConfig.If
/config.jsondoes not exist or fails to parse, code defaults remain in effect.This override mechanism is only for
js_siteConfig. It does not updatejs_globals.
public/config.json keys (what they control)
Below are the keys that loadConfigSync() actively reads and applies.
Backend selection
CONST_TEST_MODEEffect: When
true, the web client usesCONST_TEST_MODE_IP/PORTfor the auth backend.
CONST_PROD_MODE_IP,CONST_PROD_MODE_PORTEffect: Auth backend host/port used when
CONST_TEST_MODE=false.
CONST_TEST_MODE_IP,CONST_TEST_MODE_PORTEffect: Auth backend host/port used when
CONST_TEST_MODE=true.
These values are used by src/js/js_andruav_auth.js to build the login URL.
Header links
CONST_ANDRUAV_URL_ENABLEEffect: show/hide Andruav download link.
CONST_ACCOUNT_URL_ENABLEEffect: show/hide account link.
Map
CONST_MAP_LEAFLET_URLEffect: map tiles source for Leaflet.
Network privacy / behavior
CONST_DONT_BROADCAST_TO_GCSsEffect: affects broadcast routing logic in
AndruavClientWS.API_sendCMD().
CONST_DONT_BROADCAST_GCS_LOCATIONEffect: controls whether the GCS embeds/sends its location in the periodic ID message.
Feature flags
CONST_FEATUREEffect: enables/disables chunks of UI/features. Applied as a merge:
CONST_FEATURE = { ...CONST_FEATURE, ...data.CONST_FEATURE }
WebRTC
CONST_ICE_SERVERSEffect: STUN/TURN servers used by WebRTC.
Module versions
CONST_MODULE_VERSIONSEffect: expected module versions and URLs; merged into defaults.
WebConnector
CONST_WEBCONNECTOR_ENABLEDEffect: enables WebConnector mode for local development proxy.
CONST_WEBCONNECTOR_AUTH_HOST,CONST_WEBCONNECTOR_AUTH_PORTEffect: WebConnector auth server host/port.
CONST_WEBCONNECTOR_WS_PORTEffect: WebConnector WebSocket port.
CONST_WEBCONNECTOR_APIKEYEffect: API key for WebConnector authentication.
CONST_WEBCONNECTOR_TOKENEffect: Static token for WebConnector sessions.
CONST_WEBCONNECTOR_AUTO_FALLBACKEffect: when
true, falls back to cloud login if WebConnector unreachable; whenfalse, WebConnector only.
CONST_WEBCONNECTOR_SECUREEffect: enables HTTPS/WSS for WebConnector.
CONST_WEBCONNECTOR_BASE_PATHEffect: base path for WebConnector API endpoints.
Language
CONST_LANGUAGEEffect: enabled languages and default language; merged into defaults.
Where to edit in production
During development: edit
public/config.json.After build: edit
build/config.json.