Ghost/ghost/admin/config/environment.js

84 lines
2.6 KiB
JavaScript
Raw Normal View History

/* eslint-env node */
'use strict';
module.exports = function (environment) {
let ENV = {
modulePrefix: 'ghost-admin',
environment,
cdnUrl: process.env.GHOST_CDN_URL || '',
editorUrl: process.env.EDITOR_URL || '',
rootURL: '',
🎨 remove usage of ghost's {{asset}} helper in index.html (#574) refs #8140 🎨 remove usage of ghost's {{asset}} helper in built index.html files requires https://github.com/TryGhost/Ghost/pull/8142 - switch to hash-location rather than history-location - remove usage of Ghost's `{{asset}}` helper in index.html - add `content-for` helpers to `asset-delivery` addon that switch asset urls in index.html to `.min` files in production - update the `asset-delivery` addon to copy the production `index.min.html` to `default-prod.hbs` so Ghost can serve production assets when in production mode - change template output path to `core/server/admin/views/` - enable asset fingerprinting - remove `ember-cli-sri` dependency - we weren't using it but now that ember is handling assets it was used automatically and could potentially create issues if users have proxy servers that attempt to compress or otherwise modify asset files ✨ redirect to setup if server says setup isn't finished refs https://github.com/TryGhost/Ghost/issues/8140 - now we're using hash-location the server no longer knows if we're hitting the /setup route so it's not able to redirect for us - extends the default ESA `UnauthenticatedRouteMixin` to add a check against the `/authentication/setup` API endpoint and redirects to `/#/setup/one` if setup isn't complete - this works for all routes because the default behaviour when hitting an authenticated route without the right credentials is to force a logout and redirect to `/#/signin` which utilises the `UnauthenticatedRouteMixin` deps: ember-cli-inject-live-reload@1.6.1
2017-03-14 19:04:46 +03:00
locationType: 'trailing-hash',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
// @TODO verify that String/Function need to be enabled
EXTEND_PROTOTYPES: {
Date: false,
Array: true,
String: true,
Function: false
}
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
// override the default version string which contains git info from
// https://github.com/cibernox/git-repo-version. Only include the
// `major.minor` version numbers
version: require('../package.json').version.match(/^(\d+\.)?(\d+)/)[0]
},
'ember-simple-auth': { },
2017-02-06 18:53:04 +03:00
'@sentry/ember': {
disablePerformance: true,
sentry: {}
}
};
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;
// Enable mirage here in order to mock API endpoints during development
ENV['ember-cli-mirage'] = {
enabled: false
};
2015-02-13 07:22:32 +03:00
}
if (environment === 'test') {
// Testem prefers this...
ENV.rootURL = '/';
ENV.locationType = 'none';
2015-02-13 07:22:32 +03:00
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
2015-02-13 07:22:32 +03:00
ENV.APP.rootElement = '#ember-testing';
ENV.APP.autoboot = false;
// Without manually setting this, pretender won't track requests
ENV['ember-cli-mirage'] = {
trackRequests: true
};
// We copy the dynamically loaded editor file into the ghost assets
// directory in the dev/test env so that tests can load it. We need to
// set the config appropriately here so that the fetchKoenigLexical
// utility creates the right URL
ENV.editorFilename = 'koenig-lexical.umd.js';
ENV.editorHash = 'test';
}
2015-02-13 07:22:32 +03:00
return ENV;
2015-02-13 07:22:32 +03:00
};