Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables that are JSON values are not displayed as defined in Admin > Settings #18864

Closed
flamber opened this issue Nov 5, 2021 · 1 comment

Comments

@flamber
Copy link
Contributor

flamber commented Nov 5, 2021

Describe the bug
When setting environment variables, which are JSON blobs, then it's correct applied, but the interface shows Metabase defaults instead, which can lead to confusion about which settings are applied. And the input fields are not locked, which makes it even more difficult to understand that the value comes from envvars.

Applies to MB_APPLICATION_COLORS, MB_CUSTOM_FORMATTING, MB_JWT_GROUP_MAPPINGS, MB_LDAP_GROUP_MAPPINGS and MB_SAML_GROUP_MAPPINGS
And likely MB_CUSTOM_GEOJSON too, but it has it's own problems #18862

Workaround: Set it directly in the application database table setting or set it via the API with key, eg. custom-formatting, with value, eg. {"type/Currency":{"currency":"DKK"}}
https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#put-apisettingkey

To Reproduce

  1. Start Metabase:
    java -DMB_APPLICATION_COLORS='{"brand":"#ff0080"}' -DMB_CUSTOM_FORMATTING='{"type/Temporal":{"date_style":"YYYY/M/D","time_style":"HH:mm"},"type/Number":{"number_separators":",."},"type/Currency":{"currency":"DKK"}}' -jar metabase.jar
  2. Go to Admin > Settings > Localization or Whitelabel - it looks like none of the settings apply
    image
    image
  3. But all the envvar settings are clearly working as expected
    image

Expected behavior
The input fields should be locked, similar to defining other non-JSON-blob envvars like MB_SITE_NAME, so it's clear that it cannot be modified within Metabase.

Information about your Metabase Installation:
Tested 1.41.1 (versions pre-40.0 would not error, but would not apply the envvar, when there was keys in setting table)

Additional context
Related to #13166 and #14790

@shaunlebron
Copy link
Contributor

Fixed by #25067

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants