refactor(distro-vertx): set sensible defaults and System Properties for `conf-es.json`
MODIFY
distro/vertx/src/main/resources/overlay/configs/conf-es.json
distro/vertx/src/main/resources/overlay/configs/conf-es.json
-{ // Example ElasticSearch based config
+{
"variables": {
"apiman": {
- "es": {
- "protocol": "http",
- "host": "localhost",
- "port": 19200,
- "username": null,
- "password": null,
- "timeout": 10000,
- "pollingTime": 600
- // only for https
- //"allowSelfSigned": false,
- //"allowAnyHost": false,
- //"truststore": {
- // "path": "/usr/src/apiman/apiman-distro-vertx/apiman.jks",
- // "password": "secret"
- //},
- //"keystore": {
- // "path": "/usr/src/apiman/apiman-distro-vertx/apiman.jks",
- // "password": "secret"
+ // You can use this section to define variables, or use System properties, or env vars.
+ // "es": {
+ // "protocol": "http",
+ // "host": "localhost",
+ // "port": 9200,
+ // "username": null,
+ // "password": null,
+ // "timeout": 10000,
+ // "pollingTime": 600,
// }
}
- }
},
"registry": {
"config": {
"client": {
"type": "es",
- "protocol": "${apiman.es.protocol}",
+ "protocol": "${apiman.es.protocol:-http}",
"host": "${apiman.es.host}",
- "port": "${apiman.es.port}",
+ "port": "${apiman.es.port:-9200}",
"initialize": true,
- "pollingTime": "${apiman.es.pollingTime}",
+ "pollingTime": "${apiman.es.pollingTime:-600}",
"username": "${apiman.es.username}",
"password": "${apiman.es.password}",
- "timeout": "${apiman.es.timeout}"//,
+ "timeout": "${apiman.es.timeout:-10000}",
// only for https
- //"allowSelfSigned": "${apiman.es.allowSelfSigned}",
- //"allowAnyHost": "${apiman.es.allowAnyHost}",
+ "allowSelfSigned": "${allowSelfSigned:-true}}",
+ "allowAnyHost": "${allowAnyHost:-true}}"
// "truststore": {
- // "path": "${apiman.es.truststore.path}",
- // "password": "${apiman.es.truststore.password}"
+ // "path": "${apiman.es.truststore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.truststore.password:-changeit}"
// },
// "keystore": {
- // "path": "${apiman.es.keystore.path.path}",
- // "password": "${apiman.es.keystore.path.password}"
- //},
+ // "path": "${apiman.es.keystore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.keystore.password:-changeit}"
+ // }
// "cache-polling-interval": 15
// "indexPrefix": ""
}
"error": {
"class": "io.apiman.gateway.engine.impl.TracePolicyErrorWriter",
"config": {}
- }//,
+ }
// "policy-failure": {
// "class": "",
// "config": {}
// }
},
-
"encrypter": {
"class": "io.apiman.gateway.engine.impl.DefaultDataEncrypter",
"config": {}
"devMode": true
// Whether self-signed certificates should be automatically trusted. *Use with great care.*
- // "allowSelfSigned": false,
+ //"allowSelfSigned": "${allowSelfSigned:-true}",
// Whether certificate host checks should be bypassed. *Use with great care.*
- // "allowAnyHost": false,
+ //"allowAnyHost": "${allowAnyHost:-true}",
// Trust store contains certificate(s) trusted by gateway.
- // "trustStore": "/path/to/your/truststore.jks",
- // "trustStorePassword": "abc123",
+ //"trustStore": "${apiman.gateway.backend-truststore:-/opt/java/openjdk/lib/security/cacerts}",
+ //"trustStorePassword": "${apiman.gateway.backend-truststore.password:-changeit}",
// Key store contains gateway's keys (including private components: keep it safe).
- // "keyStore": "/path/to/your/keystore.jks",
- // "keyStorePassword": "abc123",
+ //"keyStore": "${apiman.gateway.backend-keystore:-/opt/java/openjdk/lib/security/cacerts}",
+ //"keyStorePassword": "${apiman.gateway.backend-keystore.password:-changeit}"
- // By default all keys can be used (will try all). If alias list provided, will only attempt to use listed keys.
+ // By default, all keys can be used (will try all). If alias list provided, will only attempt to use listed keys.
// "keyAliases": "mykey,myotherkey",
// Allowed TLS/SSL protocols and ciphers suites as CSV. Availability will vary depending on your JVM impl.
"config": {
"client": {
"type": "es",
- "protocol": "${apiman.es.protocol}",
+ "protocol": "${apiman.es.protocol:-http}",
"host": "${apiman.es.host}",
- "port": "${apiman.es.port}",
+ "port": "${apiman.es.port:-9200}",
"initialize": true,
- "pollingTime": "${apiman.es.pollingTime}",
+ "pollingTime": "${apiman.es.pollingTime:-600}",
"username": "${apiman.es.username}",
"password": "${apiman.es.password}",
- "timeout": "${apiman.es.timeout}"//,
+ "timeout": "${apiman.es.timeout:-10000}",
// only for https
- //"allowSelfSigned": "${apiman.es.allowSelfSigned}",
- //"allowAnyHost": "${apiman.es.allowAnyHost}",
+ "allowSelfSigned": "${allowSelfSigned:-false}}",
+ "allowAnyHost": "${allowAnyHost:-false}}"
// "truststore": {
- // "path": "${apiman.es.truststore.path}",
- // "password": "${apiman.es.truststore.password}"
+ // "path": "${apiman.es.truststore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.truststore.password:-changeit}"
// },
// "keystore": {
- // "path": "${apiman.es.keystore.path.path}",
- // "password": "${apiman.es.keystore.path.password}"
- //},
+ // "path": "${apiman.es.keystore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.keystore.password:-changeit}"
+ // }
+ },
+ // You can collect custom headers into Elasticsearch!
+ "custom": {
+ "headers": {
+ "request": "${apiman.es.custom.headers.request:-}",
+ "response": "${apiman.es.custom.headers.response:-}"
+ },
+ "query-params": "${apiman.es.custom.query-params:-}"
}
}
},
"config": {
"client": {
"type": "es",
- "protocol": "${apiman.es.protocol}",
+ "protocol": "${apiman.es.protocol:-http}",
"host": "${apiman.es.host}",
- "port": "${apiman.es.port}",
+ "port": "${apiman.es.port:-9200}",
"initialize": true,
- "pollingTime": "${apiman.es.pollingTime}",
+ "pollingTime": "${apiman.es.pollingTime:-600}",
"username": "${apiman.es.username}",
"password": "${apiman.es.password}",
- "timeout": "${apiman.es.timeout}"//,
+ "timeout": "${apiman.es.timeout:-10000}",
// only for https
- //"allowSelfSigned": "${apiman.es.allowSelfSigned}",
- //"allowAnyHost": "${apiman.es.allowAnyHost}",
+ "allowSelfSigned": "${allowSelfSigned:-false}}",
+ "allowAnyHost": "${allowAnyHost:-false}}"
//"truststore": {
- // "path": "${apiman.es.truststore.path}",
- // "password": "${apiman.es.truststore.password}"
+ // "path": "${apiman.es.truststore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.truststore.password:-changeit}"
//},
//"keystore": {
- // "path": "${apiman.es.keystore.path.path}",
- // "password": "${apiman.es.keystore.path.password}"
- //},
+ // "path": "${apiman.es.keystore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.truststore.password:-changeit}"
+ //}
}
}
},
"config": {
"client": {
"type": "es",
- "protocol": "${apiman.es.protocol}",
+ "protocol": "${apiman.es.protocol:-http}",
"host": "${apiman.es.host}",
- "port": "${apiman.es.port}",
+ "port": "${apiman.es.port:-9200}",
"initialize": true,
- "pollingTime": "${apiman.es.pollingTime}",
+ "pollingTime": "${apiman.es.pollingTime:-600}",
"username": "${apiman.es.username}",
"password": "${apiman.es.password}",
- "timeout": "${apiman.es.timeout}"//,
+ "timeout": "${apiman.es.timeout:-10000}",
// only for https
- //"allowSelfSigned": "${apiman.es.allowSelfSigned}",
- //"allowAnyHost": "${apiman.es.allowAnyHost}",
+ "allowSelfSigned": "${allowSelfSigned:-false}}",
+ "allowAnyHost": "${allowAnyHost:-false}}"
//"truststore": {
- // "path": "${apiman.es.truststore.path}",
- // "password": "${apiman.es.truststore.password}"
+ // "path": "${apiman.es.truststore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.truststore.password:-changeit}"
//},
//"keystore": {
- // "path": "${apiman.es.keystore.path.path}",
- // "password": "${apiman.es.keystore.path.password}"
- //},
+ // "path": "${apiman.es.keystore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.es.truststore.password:-changeit}"
+ //}
}
}
},
// Cache Store Component Settings
"ICacheStoreComponent": {
- "class": "io.apiman.gateway.engine.es.EsCacheStoreComponent",
+ "class": "io.apiman.gateway.engine.impl.InMemoryCacheStoreComponent",
"config": {
- "client": {
- "type": "es",
- "protocol": "${apiman.es.protocol}",
- "host": "${apiman.es.host}",
- "port": "${apiman.es.port}",
- "initialize": true,
- "pollingTime": "${apiman.es.pollingTime}",
- "username": "${apiman.es.username}",
- "password": "${apiman.es.password}",
- "timeout": "${apiman.es.timeout}"//,
- // only for https
- //"allowSelfSigned": "${apiman.es.allowSelfSigned}",
- //"allowAnyHost": "${apiman.es.allowAnyHost}",
- //"truststore": {
- // "path": "${apiman.es.truststore.path}",
- // "password": "${apiman.es.truststore.password}"
- //},
- //"keystore": {
- // "path": "${apiman.es.keystore.path.path}",
- // "password": "${apiman.es.keystore.path.password}"
- //},
- }
+ // maxCacheSize in bytes (100MB default)
+ "maxCacheSize" : "${cachingPolicy.maxCacheSize:-104857600}"
}
},
},
// Host-name to bind to for this machine.
- "hostname": "localhost",
+ //"hostname": "localhost",
// You can force a particular endpoint to be reported here (e.g.
// if you have some clustered setup with exotic DNS setup)
- //"publicEndpoint": "localhost",
+ "publicEndpoint": "${apiman.gateway.public-endpoint}",
// Verticle configuration
// Port - The port a given verticle listens on (where relevant)
// Count - Number of given verticle type launched, or "auto" for automatic.
"verticles": {
"http": {
- "port": 8082,
- "count": "auto"
+ "port": "${apiman.gateway.http.port:-8080}",
+ "count": "${apiman.gateway.http.count:-auto}"
},
// Configure the following SSL section to enable SSL/TLS.
"https": {
- "port": 8443,
- "count": 0
+ "port": "${apiman.gateway.https.port:-8443}",
+ "count": "${apiman.gateway.https.count:-0}"
},
// The Gateway API; this will be the port to set in the UI.
// e.g. http://localhost:8081 or https://gateway.machine:8081
// Configure the following SSL section to enable SSL/TLS.
"api": {
- "port": 8081,
+ "protocol": "${apiman.gateway-api.protocol:-http}",
+ "port": "${apiman.gateway-api.port:-8081}",
"count": 1
}
},
// SSL configuration to the gateway's *front end* (i.e. client <-> gateway).
// "ssl": {
// "keystore": {
-// "path": "/the/keystore/path/here.jks",
-// "password": "password-here"
+ // "path": "${apiman.gateway.client-keystore:-/your/keystore/here}",
+ // "password": "${apiman.gateway.client-keystore.password:-changeit}"
// },
// "truststore": {
-// "path": "/the/truststore/path/here.jks",
-// "password": "password-here"
-// }
+ // "path": "${apiman.gateway.client-truststore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "password": "${apiman.gateway.client-truststore.password:-changeit}"
// },
-// Allowed TLS/SSL protocols for Client <-> Gateway (Server)
-// "allowedProtocols": "TLSv1.1, TLSv1.2"
+ // "allowedProtocols": "${apiman.gateway.allowedProtocols}"
// },
- // Gateway API Authentication. See documentation for further possibilities..
+ // Gateway API Authentication. See documentation for further possibilities.
"auth": {
"type": "keycloak",
"config": {
"flowType": "PASSWORD",
"requiredRole": "realm:apipublisher",
- // Paste and overwrite your Keycloak config here.
- "realm": "apiman",
- "realm-public-key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxyG61ohrfJQKNmDA/ePZtqZVpPXjwn3k3T+iWiTvMsxW2+WlnqIEmL5qZ09DMhBH9r50WZRO2gVoCb657Er9x0vfD6GNf/47XU2y33TX8axhP+hSwkv/VViaDlu4jQrfgPWz/FXMjWIZxg1xQS+nOBF2ScCRYWNQ/ZnUNnvrq8dGC2/AlyeYcgDUOdwlJuvgkGlF0QoVPQiRPurR3RwlG+BjL8JB3hbaAZhdJqwqApmGQbcpgLj2tODnlrZnEAp5cPPU/lgqCE1OOp78BAEiE91ZLPl/+D8qDHk+Maz0Io3bkeRZMXPpvtbL3qN+3GlF8Yz264HDSsTNrH+nd19tFQIDAQAB",
- "auth-server-url": "http://localhost:8080/auth",
- "ssl-required": "none",
- "disable-trust-manager": false,
- "allow-any-hostname" : false,
+ // Override with System Properties, or paste and overwrite your Client Keycloak config here.
+ "auth-server-url": "${apiman.auth.url:-http://localhost:8085}", // Location of your keycloak server.
+ "realm": "${apiman.auth.realm:-apiman}",
"resource": "apiman-gateway-api",
- // A limitation in the current OAuth2 implementation means a credentials section is required
- // even if your client is not set to "confidential". Leave this dummy section if you're using non-confidential.
"credentials": {
- "secret": "217b725d-7790-47a7-a3fc-5cf31f92a8db"
- }//,
- // "truststore": "/usr/src/apiman/apiman-distro-vertx/apiman.jks",
- // "truststore-password": "secret"
- // "client-keystore": "/usr/src/apiman/apiman-distro-vertx/apiman.jks",
- // "client-keystore-password": "secret"
+ "secret": "${apiman.auth.gateway.secret:-password}"
+ },
// End paste here
+ // "truststore": "${apiman.keycloak.truststore:-/opt/java/openjdk/lib/security/cacerts}",
+ // "truststore-password": "${apiman.keycloak.truststore.password:-changeit}"
+ // "client-keystore": "${apiman.keycloak.keystore:-/your/keystore/here}",
+ // "client-keystore-password": "${apiman.keycloak.keystore.password:-changeit}"
+ "ssl-required": "none",
+ "disable-trust-manager": true,
+ "allow-any-hostname" : true
}
},

refactor(distro-vertx): set sensible defaults and System Properties for `conf-es.json`