Application configuration is configuration that can be applied per application in a Lime CRM environment.
Starting with Lime CRM version 2020.2, there is a possibility of configuring different applications in Lime CRM running on the same Lime CRM Server. This works both for Lime CRM Cloud applications as well as for on-premise installations running multiple applications.
The concept of application-level config is that we now have a way of entering configuration for different applications running on the same Lime CRM server, that does not live in the database, like the
lime_data runtime configuration. The big drawback of the runtime configuration is that if you perform database backups from one environment (e.g. production) to another(e.g. test), you could end up with e.g. pointing a test installation towards a 3rd party system, with both endpoints and API keys ready to use. The application configuration is architected to support this exact use-case, letting applications' environment-level configuration stay in each environment; since the configuration lies within the environment rather than in the database, config entries such as URL:s to 3rd party systems and API keys won't follow database restores.
For this configuration, each application has a
dict-like datastructure with configuration and secrets. We could conceptually represent this as YAML:
my-application: config: my_erp_system: endpoint_url: https://my_erp_system.example.com secrets: my_erp_system: api_key: oh-so-secret another-application: config: secrets:
In the above YAML blob, we see that each application's configuration has two root keys,
secrets. It's probably self-explanatory what goes where - in
secrets we add passwords, api keys, shared secrets etc, and in
config we add everything else. Please do not put configuration within other places than this; you'll have a hard time to fetch it.
Keys in camelCase are not supported. Fetching such keys (e.g.
lime_config.get_app_config(application, 'myFeature') will always result in None being returned.
Where to find an application's application configuration¶
The path for the application config file can be overridden using the environment variable,
For local development,
.lime/application_config.yaml is the default location.