opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
85 stars 64 forks source link

URL path of the Metabase GeoJSON map cannot be configured in local environment #7009

Open rikukissa opened 3 months ago

rikukissa commented 3 months ago

Describe the bug When configuring Metabase, many countries might want to change the URL from where the GeoJSON of their countries map is fetched from. In development this defaults to http://localhost:3040/content/farajaland-map.geojson.

For production, we've built an additional system to overwrite these values with environment variables so that the addresses can be different in different environments. The issue is, that this same mechanism is also in use in the local environment with variable values hard-coded to match Farajaland values.

Which feature of OpenCRVS your bug concern? Dashboards customisation

To Reproduce Steps to reproduce the behaviour:

  1. Start metabase, go to admin settings to change Map URL to be something other than the default
  2. Shut down the Metabase dev environment
  3. Start the Metabase environment again and go back to admin settings

Expected behaviour You should now see the map URL persisted to be the one you previously set.

Actual behaviour You see it has reverted back to http://localhost:3040/content/farajaland-map.geojson

OpenCRVS Core Version:

Tech design

naftis commented 2 months ago
export OPENCRVS_METABASE_MAP_NAME=${OPENCRVS_METABASE_MAP_NAME:-"Farajaland"}
export OPENCRVS_METABASE_MAP_URL=${OPENCRVS_METABASE_MAP_URL:-"http://localhost:3040/content/farajaland-map.geojson"}

I noticed there's also the Farajaland map name. Confirming that changing the map name doesn't seem so important, as that naming doesn't leak into the country config code?

rikukissa commented 2 months ago

@naftis Good spot. Let's change the country map name to "Full country" for now.

It affects these views in Metabase:

image image
naftis commented 2 months ago

@euanmillar there's potentially a documentation change required here: now the local dashboard is served from http://localhost:3040/content/map.geojson

This is to promote replacing that file from country config, instead of adding a new one and re-configuring the URL in the Metabase admin panel, as the reconfigured one will be overridden from the persisted files when Metabase is reloaded.

Zangetsu101 commented 2 months ago

We need to make sure that the dashboard maps are still working