2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2020-11-12 10:33:13 -05:00
|
|
|
'use strict';
|
2020-06-29 18:11:11 -04:00
|
|
|
|
2020-11-12 10:33:13 -05:00
|
|
|
const APP_NAME = process.env.APP_NAME || 'Boundary';
|
2020-06-30 11:37:40 -04:00
|
|
|
|
2020-11-05 17:46:49 -05:00
|
|
|
module.exports = function (environment) {
|
2020-06-29 18:11:11 -04:00
|
|
|
let ENV = {
|
2020-11-12 10:33:13 -05:00
|
|
|
modulePrefix: 'desktop',
|
2020-06-29 18:11:11 -04:00
|
|
|
environment,
|
2020-11-12 10:33:13 -05:00
|
|
|
rootURL: process.env.EMBER_CLI_ELECTRON ? '' : '/',
|
|
|
|
|
locationType: process.env.EMBER_CLI_ELECTRON ? 'hash' : 'auto',
|
2020-06-29 18:11:11 -04:00
|
|
|
EmberENV: {
|
|
|
|
|
FEATURES: {
|
|
|
|
|
// Here you can enable experimental features on an ember canary build
|
|
|
|
|
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
|
|
|
|
|
},
|
2020-11-05 17:46:49 -05:00
|
|
|
EXTEND_PROTOTYPES: false,
|
|
|
|
|
// EXTEND_PROTOTYPES: {
|
|
|
|
|
// // Prevent Ember Data from overriding Date.parse.
|
|
|
|
|
// Date: false
|
|
|
|
|
// }
|
2020-06-29 18:11:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
APP: {
|
|
|
|
|
// Here you can pass flags/options to your application instance
|
|
|
|
|
// when it is created
|
2020-06-30 11:37:40 -04:00
|
|
|
},
|
|
|
|
|
|
2021-01-25 15:35:07 -05:00
|
|
|
isElectron: process.env.EMBER_CLI_ELECTRON
|
|
|
|
|
? JSON.parse(process.env.EMBER_CLI_ELECTRON)
|
|
|
|
|
: false,
|
2020-11-13 15:20:26 -05:00
|
|
|
|
2020-11-23 14:26:01 -05:00
|
|
|
'ember-cli-mirage': {
|
2021-01-25 14:54:05 -05:00
|
|
|
//enabled: ENABLE_MIRAGE,
|
2021-03-05 17:49:47 -05:00
|
|
|
directory: '../../addons/api/mirage',
|
2020-11-23 14:26:01 -05:00
|
|
|
},
|
|
|
|
|
|
2020-06-30 11:37:40 -04:00
|
|
|
api: {
|
2020-12-08 11:19:05 -05:00
|
|
|
// there is no default API host in desktop
|
|
|
|
|
//host: API_HOST,
|
2020-11-12 10:33:13 -05:00
|
|
|
namespace: 'v1',
|
2020-06-30 11:37:40 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
appName: APP_NAME,
|
2020-11-13 15:20:26 -05:00
|
|
|
|
2022-05-04 09:51:16 -07:00
|
|
|
sessionPollingTimeoutSeconds: 300,
|
2021-04-12 18:10:08 -04:00
|
|
|
oidcPollingTimeoutSeconds: 1,
|
2021-02-12 13:07:56 -05:00
|
|
|
|
|
|
|
|
documentation: {
|
|
|
|
|
baseURL: 'https://boundaryproject.io/help/desktop',
|
|
|
|
|
topics: {
|
|
|
|
|
targets: '/targets',
|
2021-03-05 17:49:47 -05:00
|
|
|
sessions: '/sessions',
|
|
|
|
|
},
|
|
|
|
|
},
|
2021-04-09 14:55:58 -04:00
|
|
|
|
2022-08-31 10:24:25 -07:00
|
|
|
flashMessageDefaults: {
|
|
|
|
|
timeout: 4000,
|
|
|
|
|
},
|
|
|
|
|
|
2021-04-09 14:55:58 -04:00
|
|
|
featureFlags: {
|
2021-04-14 09:40:22 -04:00
|
|
|
search: false,
|
2021-11-18 09:05:47 -08:00
|
|
|
filter: true,
|
2021-04-09 14:55:58 -04:00
|
|
|
},
|
2020-06-29 18:11:11 -04:00
|
|
|
};
|
|
|
|
|
|
2020-11-12 10:33:13 -05:00
|
|
|
if (environment === 'development') {
|
2020-06-29 18:11:11 -04:00
|
|
|
// 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-12-02 16:41:20 -05:00
|
|
|
|
|
|
|
|
// This flag tells the origin route to autoset the controller origin field
|
|
|
|
|
// of the UI, which only makes sense in development where the origin is
|
|
|
|
|
// usually the same as the application origin.
|
|
|
|
|
ENV.autoOrigin = true;
|
2021-04-09 14:55:58 -04:00
|
|
|
|
2022-10-12 11:44:10 -04:00
|
|
|
ENV['ember-cli-mirage'].enabled = process.env.ENABLE_MIRAGE
|
|
|
|
|
? JSON.parse(process.env.ENABLE_MIRAGE)
|
|
|
|
|
: true;
|
|
|
|
|
|
2021-04-09 14:55:58 -04:00
|
|
|
// Enable features in development
|
2020-06-29 18:11:11 -04:00
|
|
|
}
|
|
|
|
|
|
2020-11-12 10:33:13 -05:00
|
|
|
if (environment === 'test') {
|
2020-06-29 18:11:11 -04:00
|
|
|
// Testem prefers this...
|
2020-11-12 10:33:13 -05:00
|
|
|
ENV.locationType = 'none';
|
2020-06-29 18:11:11 -04:00
|
|
|
|
|
|
|
|
// keep test console output quieter
|
|
|
|
|
ENV.APP.LOG_ACTIVE_GENERATION = false;
|
|
|
|
|
ENV.APP.LOG_VIEW_LOOKUPS = false;
|
|
|
|
|
|
2020-11-12 10:33:13 -05:00
|
|
|
ENV.APP.rootElement = '#ember-testing';
|
2020-06-29 18:11:11 -04:00
|
|
|
ENV.APP.autoboot = false;
|
2020-11-13 15:20:26 -05:00
|
|
|
|
|
|
|
|
// Notification timeout should be 0 for fast tests
|
2022-08-31 10:24:25 -07:00
|
|
|
ENV.flashMessageDefaults.timeout = 0;
|
2021-01-25 14:54:05 -05:00
|
|
|
|
2020-12-08 12:27:41 -05:00
|
|
|
ENV.enableConfirmService = false;
|
2020-12-09 16:49:15 -05:00
|
|
|
|
|
|
|
|
// Use in-memory storage
|
|
|
|
|
ENV.storage = {
|
2021-03-05 17:49:47 -05:00
|
|
|
memory: true,
|
2020-12-09 16:49:15 -05:00
|
|
|
};
|
2021-08-12 16:24:16 -04:00
|
|
|
|
|
|
|
|
// Enable tests for development features
|
2020-06-29 18:11:11 -04:00
|
|
|
}
|
|
|
|
|
|
2020-11-12 10:33:13 -05:00
|
|
|
if (environment === 'production') {
|
2020-06-29 18:11:11 -04:00
|
|
|
// here you can enable a production-specific feature
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ENV;
|
|
|
|
|
};
|