Skip to content

Optional services#

Empowerment Center works without these services, but each one adds something: the headless browser, documents in PDF and the image in the email; the routing engine, road isochrones; the base map, the background of the maps; and the management port, the metrics for Prometheus. This page explains how to turn on each one.

The headless browser#

A Chromium in a separate container that opens documents as a user would and renders them. With it:

  • subscriptions and data alerts can send charts, maps and portal template pages in PDF;
  • the email can carry the image of the document in its body;
  • users can export a portal page to PDF.

Without it, those formats are not offered and everything else works the same. The PDF and the other cube exports do not need it.

Turn it on with Docker Compose#

  1. In deploy/.env, add:

    COMPOSE_PROFILES=render
    ECENTER_RENDER_ENABLED=true
    
  2. Start again: docker compose -f deploy/compose.yaml up -d.

The profile starts the chromium service with the version tested with ECenter and 1 GB of shared memory. compose.yaml already tells the backend where it is (http://chromium:9222) and how Chromium reaches the frontend: by its internal address, http://frontend:8080, which serves the same as the public one without leaving the network.

What you need to know#

  • DevTools is never published. Port 9222 is only seen by the backend: whoever reaches it can open any page with that browser and read what it renders.
  • One per backend instance. Each instance renders at most 2 documents at a time (ecenter.render.max-concurrent, each one in a tab) and waits 30 s for a free slot. A shared one has to cope with the sum.
  • Shared memory. Chromium renders in /dev/shm: with the 64 MB Docker gives by default, large pages fail. compose.yaml gives it 1 GB; in Kubernetes, mount an in-memory volume at /dev/shm.
  • The time. The dates in PDFs come out in the backend's zone: TZ must be that of the installation.
  • The base map. Chromium itself requests it. If your network does not reach the provider, the map comes out without a background or the rendering runs out of time (60 s). Without internet access, use a self-hosted base map that both users and the container can see.
  • Without a valid license nothing is rendered.

Check it#

With the browser turned on, the operations console opens the alert The headless browser does not respond if it does not respond within 10 s while there are subscriptions or data alerts that may need it. To test it end to end, create a subscription to a chart in PDF, with the image in the body, and use Send me a test.

All the properties: Services: render, maps, API and MCP.

The routing engine#

Without a routing engine, maps only calculate radial distance isochrones (circles) and there is no time and distance matrix (the server says «No hay motor de rutas configurado», no routing engine configured). With one, time and distance isochrones go by road, and the matrix says how long it takes and how far it is to each feature of a layer.

ECenter supports two engines:

Engine Where When it fits
Valhalla Self-hosted, in deploy/compose.yaml The recommended one: coordinates do not leave the network.
OpenRouteService Its cloud service, with a key, or self-hosted For trying out, or if you already have it. Its free plan gives 500 isochrones and 500 matrices per day, and coordinates go out to its service.

Valhalla with Docker Compose#

  1. In deploy/.env, add:

    COMPOSE_PROFILES=routing
    ECENTER_MAPS_ROUTING_PROVIDER=valhalla
    

    With the headless browser too: COMPOSE_PROFILES=render,routing.

  2. Start again: docker compose -f deploy/compose.yaml up -d.

The first time, Valhalla downloads from Geofabrik the OpenStreetMap extracts in ECENTER_ROUTING_TILE_URLS (by default, Spain with the Balearic Islands, Ceuta and Melilla, and the Canary Islands: 1.5 GB) and builds its graph in the routing-data volume. Meanwhile, road isochrones fail with its error and everything else works. Afterwards it starts in seconds.

Spain and Canary Islands Community of Madrid
Build the graph, with the download 24 min 1.5 min
Memory while building it (2 threads) 4.6 GB 0.7 GB
Memory while running 250 MB 250 MB
Disk 5.8 GB 0.5 GB

Figures measured with 2 CPUs and 7.8 GB of memory for Docker.

Variable Default What it is
ECENTER_ROUTING_TILE_URLS Spain and Canary Islands from Geofabrik The extracts, separated by spaces.
ECENTER_ROUTING_THREADS 2 Threads to build the graph: with more it takes less time and uses more memory.
ECENTER_ROUTING_MEMORY 6g The container's memory limit. It must cover the build.

For another area, or to bring the roads up to date (Geofabrik publishes daily), delete the volume and start again:

docker compose -f deploy/compose.yaml stop valhalla
docker compose -f deploy/compose.yaml rm -f valhalla
docker volume rm ecenter_routing-data
docker compose -f deploy/compose.yaml up -d valhalla

Valhalla does not calculate routes longer than 400 km in a matrix or isochrones longer than 120 minutes: the isochrone says so with its error. A matrix sends at most 500 destinations per request (ecenter.maps.routing.max-matrix-targets); Valhalla's pair limit (max_matrix_location_pairs, 2,500 by default in 3.9) must not be lower.

OpenRouteService#

In deploy/.env:

ECENTER_MAPS_ROUTING_PROVIDER=openrouteservice
ECENTER_MAPS_ROUTING_URL=https://api.openrouteservice.org
ECENTER_MAPS_ROUTING_APIKEY=your-key

The base map#

The background of the maps is given by a provider of MapLibre styles or raster tiles (MapTiler, Protomaps or self-hosted OpenStreetMap…). Each user's browser requests it directly. It is configured in your own application.yml:

ecenter:
  maps:
    base-map:
      style: https://mapas.example.org/estilos/claro.json
      style-dark: https://mapas.example.org/estilos/oscuro.json

And in deploy/.env, its origin for the frontend's content policy:

ECENTER_CSP_MAP_ORIGINS=https://mapas.example.org

The other options (raster tiles, attribution, maximum zoom) are in Services: render, maps, API and MCP. The public OpenStreetMap tiles are only for testing, because of their usage policy.

Metrics for Prometheus#

The metrics of ECenter and of the JVM are published for Prometheus on a separate management port, off by default and meant only for the internal network.

  1. In deploy/.env, set the port: ECENTER_MANAGEMENT_PORT=9090.
  2. Recreate the backend.
  3. Configure Prometheus to collect them over the internal network, not through the frontend:

    scrape_configs:
      - job_name: ecenter
        metrics_path: /actuator/prometheus
        static_configs:
          - targets: ['backend:9090']
    

    backend:9090 works if Prometheus is on the same Docker network as ECenter; if not, put the internal address of the backend machine and publish the port only on it.

With the management port turned on:

  • /actuator/prometheus, /actuator/health (with its probes) and /actuator/info respond on that port without a session. The rest of /actuator is denied.
  • The application port stops serving /actuator: the orchestrator's probes are pointed to the management port.
  • Do not publish that port outside the ECenter network.

Without it, /actuator/prometheus responds to nobody. Which metrics there are and what they mean is in Operations.

Other services#

Service Where it is explained
Single sign-on with OIDC or SAML, and SCIM Security
The MCP server for AI assistants (off by default: ECENTER_MCP_ENABLED) Integrations
Embedding in other applications Integrations
The server folder of the workbook file export (without it, it is not offered: ECENTER_FILE_EXPORTS_ROOTS and a backend volume) File export
Windows shared folders, SFTP servers, S3 buckets and Azure Blob containers for file export: nothing to install, but with network access to them from all instances and, if wanted, the ECENTER_FILE_EXPORTS_ALLOWED_HOSTS list Remote destinations

See also#