Holla !
- I am using 7.10.0 version of kibana and I need to access kibana.yml's parameters in custom Plugin (consisting backend and frontend).
plugin.ts
constructor(initializerContext: PluginInitializerContext) {
this.logger = initializerContext.logger.get();
this.environmentConfig = initializerContext.env;
}
public setup(core: CoreSetup<AividInsightsPluginStartDeps>, deps: AividInsightsPluginSetupDeps) {
this.logger.debug('aividInsights: Setup');
const router = core.http.createRouter();
core.getStartServices().then(([_, depsStart]) => {
// console.log(_, depsStart, this.environmentConfig);
const serverConfigData = {
esClient: _.elasticsearch.client,
//@ts-ignore
esHosts: _.elasticsearch.client.config.hosts,
//@ts-ignore
additionBasePath: _.http.basePath.get(),
..._.http.getServerInfo(),
environmentConfig: this.environmentConfig,
IS_SERVER_LIVE: this.environmentConfig.mode.prod,
NODE_JS_BASE_URL: this.environmentConfig.mode.prod
? PROD_NODE_JS_BASE_URL
: OVERWRITE_DEV_JS_BASE_URL ||
//@ts-ignore
`${_.elasticsearch.client.config.hosts?.[0]
?.slice(0, -6)
.replace('http:', 'https:')}:32000`,
};
registerRoutes(router, depsStart.data, this.logger, serverConfigData);
});
return {};
}
I tried using the given parameters of plugins (intializerContext, core, deps) but I still have not found yml variables.
Is there any variable available that consists the parameters of yml.
I want to access server.ssl.enabled , server.ssl.certificate , server.ssl.key , server.name