Configuration using Environment Variables - Esri/geoportal-server-catalog GitHub Wiki
The ability to change configuration by using a set of environment variable is suggested.
It was developed for configuring Geoportal in a container environment, but is also useful for other deployment workflows. For instance, developer can test code with a configuration, disconnected from authentication, and with a local index. Before sending to staging, he can test the staging configuration, then deploy to staging. Staging has a separate set of environment variable set, so there is no need to change any configuration before deploying the war file.
Environment variables:
| name | default | file | common/rare | description |
|---|---|---|---|---|
| es_node | localhost | app_context.xml | common | name of the machine running the elasticsearch/opensearch index |
| es_cluster | elasticsearch | app_context.xml | common | friendly name of the index cluster |
| gpt_indexName | metadata | app_context.xml | common | the name of the index Geoportal Server uses to store the metadata documents |
| gpt_collectionIndexName | collections | app_context.xml | common | the name of the index Geoportal Server uses to store collection-level metadata (used specifically in STAC configurations |
| gpt_mappingsFile | config/elastic-mappings.json | app_context.xml | rare | contains field mappings used in the index |
| harvester_node | app_context.xml | rare | not used currently | |
| gpt_authentication | authentication-simple.xml | app-security.xml | common | indicates which type of authentication to use |
| arcgis_appid | 12345abcde | authentication-arcgis.xml | common | if using ArcGIS Enterprise authentication, this is the appid of the Geoportal Server registration in that ArcGIS Enterprise portal |
| arcgis_authorizeUrl | https://www.arcgis.com/sharing/rest/oauth2/authorize | authentication-arcgis.xml | common | used when using ArcGIS Enterprise authentication. Update with the corresponding URL to your ArcGIS Enterprise |
| arcgis_createAccountUrl | https://www.arcgis.com/home/createaccount.html | authentication-arcgis.xml | common | used when using ArcGIS Enterprise authentication. Update with the corresponding URL to your ArcGIS Enterprise |
| arcgis_showMyProfileLink | true | authentication-arcgis.xml | common | used when using ArcGIS Enterprise authentication. Shows/hides a link to let the user go to their profile page in ArcGIS Enterprise portal |
| ldap_url | ldap://gptsrv12r2:10389 | authentication-ldap.xml | rare | used when configuring LDAP authentication. This is the URL to the LDAP API |
| ldap_manager_dn | uid=admin, ou=system | authentication-ldap.xml | rare | used when configuring LDAP authentication. This is the distinguished name (dn) of the LDAP administrator account Geoportal Server needs to connect to LDAP |
| ldap_manager_password | secret | authentication-ldap.xml | rare | used when configuring LDAP authentication. This is the password of the LDAP administrator account Geoportal Server needs to connect to LDAP |
In principle, all settings in the app-config.xml file can be read from environment variables. See: https://docs.spring.io/spring-boot/docs/2.1.x/reference/html/boot-features-external-config.html