Files
threshold-ui/ui/admin/config/environment.js
T

176 lines
5.0 KiB
JavaScript
Raw Normal View History

2020-05-18 17:02:09 -04:00
'use strict';
2020-09-27 14:12:15 -04:00
const APP_NAME = process.env.APP_NAME || 'Boundary';
2020-05-20 11:53:48 -04:00
const API_HOST = process.env.API_HOST || '';
2022-05-05 07:42:02 -07:00
const EDITION = process.env.EDITION || 'oss'; // Default edition is OSS
// Object that defines edition features.
const featureEditions = {
oss: {
'static-credentials': true,
'json-credentials': false,
2022-09-21 09:30:07 -04:00
byow: true,
'byow-pki-hcp-cluster-id': false,
'byow-pki-upstream': true,
'vault-worker-filter': false,
2022-05-05 07:42:02 -07:00
},
};
featureEditions.enterprise = {
...featureEditions.oss,
'ssh-target': true,
'vault-worker-filter': true,
2022-05-05 07:42:02 -07:00
};
featureEditions.hcp = {
...featureEditions.enterprise,
'byow-pki-hcp-cluster-id': true,
'byow-pki-upstream': false,
};
2020-05-18 17:02:09 -04:00
module.exports = function (environment) {
let ENV = {
modulePrefix: 'admin',
2020-05-18 17:02:09 -04:00
environment,
rootURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: false,
/*{
// Prevent Ember Data from overriding Date.parse.
Date: false
}*/
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
},
2020-05-18 17:33:20 -04:00
2020-05-19 18:10:39 -04:00
api: {
host: API_HOST,
2020-05-20 11:14:24 -04:00
namespace: 'v1',
2020-05-19 18:10:39 -04:00
},
appName: APP_NAME,
2020-10-05 17:20:04 -04:00
companyName: 'HashiCorp',
sessionPollingTimeoutSeconds: 300,
2021-01-22 17:01:12 -05:00
oidcPollingTimeoutSeconds: 1,
2020-10-05 16:53:11 -04:00
documentation: {
baseURL: 'https://boundaryproject.io/help/admin-ui',
topics: {
2020-10-06 17:55:19 -04:00
org: '/orgs',
'org.new': '/orgs/new',
project: '/projects',
'project.new': '/projects/new',
account: '/accounts',
'account.new': '/accounts/new',
'auth-method': '/auth-methods',
2021-11-09 10:29:49 -08:00
'managed-groups': '/managed-groups',
2020-10-06 17:55:19 -04:00
group: '/groups',
'group.add-members': '/groups/add-members',
'host-catalog': '/host-catalogs',
'host-catalog.new': '/host-catalogs/new',
2022-02-23 10:50:20 -08:00
'host-catalog.azure': '/dynamic-host-catalogs-on-azure',
'host-catalog.aws': '/dynamic-host-catalogs-on-aws',
2022-09-20 13:23:29 -07:00
'host-catalog.aws.region': '/dynamic-host-catalogs-on-aws-region',
2020-10-06 17:55:19 -04:00
'host-set': '/host-sets',
'host-set.new': '/host-sets/new',
'host-set.add-hosts': '/host-sets/add-hosts',
2022-09-20 09:51:29 -07:00
'host-set.preferred-endpoints': '/host-set.preferred-endpoints',
'host-set.sync-interval-seconds': '/host-set.sync-interval-seconds',
2021-07-28 16:27:40 -04:00
'credential-store': '/credential-stores',
'credential-library': '/credential-libraries',
2022-07-26 11:04:01 -05:00
credential: '/credentials',
2020-10-06 17:55:19 -04:00
host: '/hosts',
'host.new': '/hosts/new',
role: '/roles',
'role.add-principals': '/roles/add-principals',
session: '/sessions',
target: '/targets',
'target.new': '/targets/new',
2021-09-21 14:32:39 -04:00
'target.add-host-sources': '/targets/add-host-sets',
'target.worker-filters': '/targets/worker-filters',
2020-11-16 15:08:59 -05:00
user: '/users',
downloads: '/downloads',
'getting-started.desktop': '/getting-started/desktop',
'api-client.cli': '/api-client/cli',
'api-client.api': '/api-client/api',
worker: '/workers',
2022-08-26 11:50:53 -04:00
'worker.manage-workers': '/workers/manage-workers-on-hcp',
'worker-filters': '/worker-filters',
2020-11-16 15:08:59 -05:00
},
2020-10-05 16:53:11 -04:00
},
2020-11-19 11:47:51 -05:00
'ember-cli-mirage': {
2021-03-05 17:27:00 -05:00
directory: '../../addons/api/mirage',
},
flashMessageDefaults: {
timeout: 4000,
},
2022-05-05 07:42:02 -07:00
featureFlags: featureEditions[EDITION],
2020-05-18 17:33:20 -04:00
};
2020-05-18 17:02:09 -04:00
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;
2020-05-18 17:33:20 -04:00
ENV['ember-cli-mirage'].enabled = process.env.ENABLE_MIRAGE
? JSON.parse(process.env.ENABLE_MIRAGE)
: true;
2020-05-18 17:33:20 -04:00
ENV['ember-a11y-testing'] = {
componentOptions: {
axeOptions: {
checks: {
2020-05-19 18:10:39 -04:00
'color-contrast': { options: { noScroll: true } },
},
},
},
2020-05-18 17:33:20 -04:00
};
2021-03-30 13:21:14 -04:00
// Enable features in development
ENV.featureFlags['static-credentials'] = true;
ENV.featureFlags['json-credentials'] = true;
ENV.featureFlags['ssh-target'] = true;
ENV.featureFlags['vault-worker-filter'] = true;
2020-05-18 17:02:09 -04: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';
ENV.APP.autoboot = false;
2020-05-18 17:33:20 -04:00
// Notification timeout should be 0 for fast tests
ENV.flashMessageDefaults.timeout = 0;
ENV.enableConfirmService = false;
// Enable tests for development features
ENV.featureFlags['json-credentials'] = true;
ENV.featureFlags['static-credentials'] = true;
ENV.featureFlags['ssh-target'] = true;
ENV.featureFlags['vault-worker-filter'] = true;
2020-05-18 17:02:09 -04:00
}
if (environment === 'production') {
// here you can enable a production-specific feature
}
return ENV;
};