2018-09-25 16:28:26 +00:00
|
|
|
/* eslint-env node */
|
|
|
|
'use strict';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
|
|
|
module.exports = function(environment) {
|
|
|
|
var ENV = {
|
|
|
|
modulePrefix: 'vault',
|
|
|
|
environment: environment,
|
|
|
|
rootURL: '/ui/',
|
|
|
|
locationType: 'auto',
|
|
|
|
EmberENV: {
|
|
|
|
FEATURES: {
|
|
|
|
// Here you can enable experimental features on an ember canary build
|
|
|
|
// e.g. 'with-controller': true
|
|
|
|
},
|
|
|
|
EXTEND_PROTOTYPES: {
|
|
|
|
// Prevent Ember Data from overriding Date.parse.
|
|
|
|
Date: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
APP: {
|
2018-08-16 17:48:24 +00:00
|
|
|
// endpoints that the UI polls
|
|
|
|
POLLING_URLS: ['sys/health', 'sys/replication/status', 'sys/seal-status'],
|
|
|
|
// endpoints that UI uses to determine the cluster state
|
|
|
|
// calls to these endpoints will always go to the root namespace
|
|
|
|
NAMESPACE_ROOT_URLS: ['sys/health', 'sys/seal-status', 'sys/license/features'],
|
2018-11-28 23:14:42 +00:00
|
|
|
// number of records to show on a single page by default - this is used by the client-side pagination
|
|
|
|
DEFAULT_PAGE_SIZE: 100,
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
flashMessageDefaults: {
|
|
|
|
timeout: 7000,
|
|
|
|
sticky: false,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
if (environment === 'development') {
|
|
|
|
// ENV.APP.LOG_RESOLVER = true;
|
|
|
|
// ENV.APP.LOG_ACTIVE_GENERATION = true;
|
|
|
|
ENV.APP.LOG_TRANSITIONS = true;
|
|
|
|
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
|
|
|
// ENV.APP.LOG_VIEW_LOOKUPS = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (environment === 'test') {
|
|
|
|
// Testem prefers this...
|
|
|
|
ENV.locationType = 'none';
|
|
|
|
// keep test console output quieter
|
|
|
|
ENV.APP.LOG_ACTIVE_GENERATION = false;
|
|
|
|
ENV.APP.LOG_VIEW_LOOKUPS = false;
|
|
|
|
ENV.APP.rootElement = '#ember-testing';
|
2018-09-25 16:28:26 +00:00
|
|
|
ENV.APP.autoboot = false;
|
|
|
|
ENV.flashMessageDefaults.timeout = 50;
|
2018-04-03 14:16:57 +00:00
|
|
|
}
|
2018-04-05 21:36:33 +00:00
|
|
|
if (environment !== 'production') {
|
2019-01-18 22:04:40 +00:00
|
|
|
ENV.APP.DEFAULT_PAGE_SIZE = 15;
|
2018-04-05 21:36:33 +00:00
|
|
|
ENV.contentSecurityPolicyHeader = 'Content-Security-Policy';
|
|
|
|
ENV.contentSecurityPolicyMeta = true;
|
2018-04-09 19:44:53 +00:00
|
|
|
ENV.contentSecurityPolicy = {
|
|
|
|
'connect-src': ["'self'"],
|
2018-04-24 21:30:44 +00:00
|
|
|
'img-src': ["'self'", 'data:'],
|
|
|
|
'form-action': ["'none'"],
|
|
|
|
'script-src': ["'self'"],
|
2018-04-09 19:44:53 +00:00
|
|
|
'style-src': ["'unsafe-inline'", "'self'"],
|
|
|
|
};
|
2018-04-05 21:36:33 +00:00
|
|
|
}
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-07-20 21:48:25 +00:00
|
|
|
ENV.welcomeMessage = process.env.UI_AUTH_WELCOME;
|
2018-04-03 14:16:57 +00:00
|
|
|
|
|
|
|
return ENV;
|
|
|
|
};
|