apiVersion: v1
kind: ConfigMap
metadata:
  name: central-directory-config
  labels:
      app: central-directory
data:
  default.json: |
    {
      "PORT": 3000,
      "HOSTNAME": "http://central-directory.local",
      "END_USER_REGISTRY_URL": "http://central-end-user-registry:3001",
      "SCHEME_ID": "001",
      "DEFAULT_DFSP": "",
      "ENABLE_TOKEN_AUTH": false,
      "PATHFINDER": {
        "PARTNER_ID": 10305,
        "SERVICE": "E2U+mm",
        "CACHE_TIME": 300000,
        "REGEX": {
          "PATTERN": "^.*$",
          "REPLACE": "mm:#{identifier}@leveloneproject.org"
        },
        "QUERY": {
          "ADDRESS": "mock-pathfinder",
          "PORT": 15353,
          "TIMEOUT": 15000
        },
        "PROVISIONING": {
          "ADDRESS": "http://mock-pathfinder:8080/nrs-pi/services/SIPIX/SendRequest"
        }
      }
    }
  ## default knexfile config
  knexfile.js: |
    'use strict'

    const migrationsDirectory = '/opt/central-directory/migrations'
    const Config = require('/opt/central-directory/src/lib/config')
    module.exports = {
      client: 'pg',
      connection: Config.DATABASE_URI,
      migrations: {
        directory: migrationsDirectory,
        tableName: 'migrations',
        stub: `${migrationsDirectory}/migration.template`
      }
    }
