use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project lithium by wireapp.
the class Server method initialize.
@Override
public void initialize(Bootstrap<Config> bootstrap) {
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
bootstrap.addBundle(new SwaggerBundle<>() {
@Override
protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(Config configuration) {
return configuration.swagger;
}
});
}
use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project OpenLineage by OpenLineage.
the class ProxyApp method initialize.
/**
* Initialize the application.
*
* @param bootstrap combination of the yml file and environment variables
*/
@Override
public void initialize(@NonNull Bootstrap<ProxyConfig> bootstrap) {
// Enable variable substitution with environment variables.
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(ERROR_ON_UNDEFINED)));
bootstrap.getObjectMapper().disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}
use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project timbuctoo by HuygensING.
the class TimbuctooV4 method initialize.
@Override
public void initialize(Bootstrap<TimbuctooConfiguration> bootstrap) {
// bundles
activeMqBundle = new ActiveMQBundle();
bootstrap.addBundle(activeMqBundle);
bootstrap.addBundle(new MultiPartBundle());
bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.html"));
/*
* Make it possible to use environment variables in the config.
* see: http://www.dropwizard.io/0.9.1/docs/manual/core.html#environment-variables
*/
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(true)));
}
use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project polaris by ractf.
the class NodeMain method initialize.
@Override
public void initialize(final Bootstrap<NodeConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
bootstrap.addBundle(new ConsulBundle<>(getName()) {
@Override
public ConsulFactory getConsulFactory(final NodeConfiguration configuration) {
return configuration.getConsulFactory();
}
});
bootstrap.addBundle(GuiceBundle.builder().modules(new NodeModule()).enableAutoConfig("uk.co.ractf.polaris.consul", "uk.co.ractf.polaris.node.metrics", "uk.co.ractf.polaris.node.runner", "uk.co.ractf.polaris.node.resources", "uk.co.ractf.polaris.node.service").build());
bootstrap.addBundle(new PrometheusBundle());
}
use of io.dropwizard.configuration.EnvironmentVariableSubstitutor in project pay-publicapi by alphagov.
the class PublicApi method initialize.
@Override
public void initialize(Bootstrap<PublicApiConfig> bootstrap) {
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(LogstashConsoleAppenderFactory.class);
bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(GovUkPayDropwizardRequestJsonLogLayoutFactory.class);
}
Aggregations