-
Notifications
You must be signed in to change notification settings - Fork 410
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
Externalize overrides for localConfig.json #3688
Comments
offtherailz
pushed a commit
that referenced
this issue
Apr 12, 2019
Integration between mapstore and geoserver gs-stable. Waiting f for ovverride functionalities in #3688
@offtherailz, @mbarto please, can you provide an estimate for this issue? I think that could be the case to define a MS data directory since it can be useful also for other custom resources (custom annotation SVG symbols, geostory default images etc.) that can be externalized without impacting on the MS deploy. |
mbarto
added a commit
to mbarto/MapStore2
that referenced
this issue
May 12, 2020
…ally loaded configuration files
12 tasks
mbarto
added a commit
to mbarto/MapStore2
that referenced
this issue
Jul 8, 2020
…ally loaded configuration files (geosolutions-it#5266) # Conflicts: # backend/src/main/java/it/geosolutions/mapstore/UploadPluginController.java # backend/src/test/java/it/geosolutions/mapstore/UploadPluginControllerTest.java
@ElenaGallo this is non testable in QA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Actually MapStore has no way to externalize configurations for localConfig.json.
The server where MapStore is installed may need specific configurations (e.g. auth rules, catalog services, cors settings, specific URLs).
To do this setting the localConfig.json must be edited. This has a series of cons:
To allow externalization/customization we (me and @mbarto ) propose the following:
localConfig.json
configOverrides.json
configOverrides.json
contains the changes to apply tolocalConfig.json
and is added to the project, empty by default.configOverrides.json
file path can be intercepted by the MS back-end, if a envMS_CONFIG_OVERRIDES_FILE
is defined. If so, the back-end will provide the external file instead of the local one.configOverrides.json definition
This file should allow to apply simple changes to the localConfig.json.
Typical attributes to override are:
authenticationRules
array of rules.initialState
allow to configure the initial state of the application (e.g.initialState.defaultState.catalog.default.Services
plugins
: arrays of plugin configs (strings or object)configOverrides.json
entries should allow to override all the properties.One of the existing languages is:
JSON Patch
One way to express the changes can be JSON Patch RFC6902. There are many implementation in many languages (now we are interested only to JavaScript of course).
This language allow to do insert, update, delete, replace operations on a JSON.
Limitations of JSON Patch
Typically the overrides could be some changes to the plugins configuration.
The current plugin configuration look like this:
This mean that we may need to find the plugin (that can be expressed as string or object) and replace/add some configuration). The index of the element in the array may cange, and I didn't find any kind of "find and replace" functionality in jsonpatch.
So we may need to do a custom technique to replace configurations in array that supports some kind of search and replace rule.
An alternative is to add a series of "test" rules before to override elements, to prevent issues due to array shift (insert of new plugins). If test fail, the client should send a message to notify the problem.
This issue is somehow related to #3117 because a general cleanup is useful to define better what to override.
The text was updated successfully, but these errors were encountered: