apiVersion: v1
data:
  local.php: |-
    <?php
    $password = getenv('DATABASE_PASSWORD');
    // Paths
    @define('CONST_Postgresql_Version', {{ .Values.CONST_Postgresql_Version | quote }});
    @define('CONST_Postgis_Version', {{ .Values.CONST_Postgis_Version | quote }} );
    // Website settings
    @define('CONST_Website_BaseURL', {{ .Values.CONST_Website_BaseURL | quote }});
    @define('CONST_Replication_Url', {{ .Values.CONST_Replication_Url | quote }});
    @define('CONST_Replication_MaxInterval', {{ .Values.CONST_Replication_MaxInterval | quote }});     // Process each update separately, osmosis cannot merge multiple updates
    @define('CONST_Replication_Update_Interval', {{ .Values.CONST_Replication_Update_Interval | quote }});  // How often upstream publishes diffs
    @define('CONST_Replication_Recheck_Interval', {{ .Values.CONST_Replication_Recheck_Interval | quote }});   // How long to sleep if no update found yet
    @define('CONST_Pyosmium_Binary', {{ .Values.CONST_Pyosmium_Binary | quote }});
    @define('CONST_Database_DSN', 'pgsql:dbname={{ .Values.DATABASE_NAME }};host={{ .Values.DATABASE_HOST }};port={{ .Values.DATABASE_PORT }};user={{ .Values.DATABASE_USER }};' . 'password=' . $password); //<driver>:host=<host>;port=<port>;user=<username>;password=<password>;dbname=<database>
    @define('CONST_Database_Module_Path', {{ .Values.CONST_Database_Module_Path | quote }});
    @define('CONST_Osm2pgsql_Flatnode_File', {{ .Values.CONST_Osm2pgsql_Flatnode_File | quote }});

kind: ConfigMap
metadata:
  name: nominatim-local-settings-configmap
  namespace: default
