2018-09-25 16:28:26 +00:00
|
|
|
/* eslint-env node */
|
|
|
|
'use strict';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
module.exports = function (environment) {
|
|
|
|
let ENV = {
|
2018-04-03 14:16:57 +00:00
|
|
|
modulePrefix: 'vault',
|
|
|
|
environment: environment,
|
|
|
|
rootURL: '/ui/',
|
2019-10-14 18:23:29 +00:00
|
|
|
serviceWorkerScope: '/v1/sys/storage/raft/snapshot',
|
2018-04-03 14:16:57 +00:00
|
|
|
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
|
2019-07-02 22:41:23 +00:00
|
|
|
// these also need to be updated in the open-api-explorer engine
|
2020-10-05 21:34:52 +00:00
|
|
|
NAMESPACE_ROOT_URLS: [
|
|
|
|
'sys/health',
|
|
|
|
'sys/seal-status',
|
|
|
|
'sys/license/features',
|
|
|
|
'sys/internal/counters/config',
|
|
|
|
],
|
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;
|
2022-01-11 22:28:37 +00:00
|
|
|
if (process.env.MIRAGE_DEV_HANDLER !== undefined) {
|
|
|
|
ENV['ember-cli-mirage'] = {
|
|
|
|
enabled: true,
|
|
|
|
handler: process.env.MIRAGE_DEV_HANDLER,
|
|
|
|
};
|
|
|
|
}
|
2018-04-03 14:16:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2021-01-07 20:18:36 +00:00
|
|
|
ENV['ember-cli-mirage'] = {
|
|
|
|
enabled: false,
|
|
|
|
};
|
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:'],
|
2021-04-22 14:58:37 +00:00
|
|
|
'font-src': ["'self'"],
|
2018-04-24 21:30:44 +00:00
|
|
|
'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;
|
|
|
|
};
|