github.com/jancarloviray/community@v0.41.1-0.20170124221257-33a66c87cf2f/app/config/environment.js (about)

     1  // Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
     2  //
     3  // This software (Documize Community Edition) is licensed under
     4  // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
     5  //
     6  // You can operate outside the AGPL restrictions by purchasing
     7  // Documize Enterprise Edition and obtaining a commercial license
     8  // by contacting <sales@documize.com>.
     9  //
    10  // https://documize.com
    11  
    12  /* jshint node: true */
    13  
    14  module.exports = function (environment) {
    15  
    16  	var ENV = {
    17  		modulePrefix: 'documize',
    18  		podModulePrefix: 'documize/pods',
    19  		locationType: 'auto',
    20  		environment: environment,
    21  		rootURL: '/',
    22  		// baseURL: '/',
    23  		apiHost: '',
    24  		apiNamespace: '',
    25  		contentSecurityPolicyHeader: 'Content-Security-Policy-Report-Only',
    26  
    27  		EmberENV: {
    28  			FEATURES: {}
    29  		},
    30  		"ember-cli-mirage": {
    31  			enabled: false
    32  		},
    33  		'ember-simple-auth': {
    34  			authenticationRoute: 'auth.login',
    35  			routeAfterAuthentication: 'folders',
    36  			routeIfAlreadyAuthenticated: 'folders'
    37  		},
    38  		APP: {
    39  			// Allows to disable audit service in tests
    40  			auditEnabled: true,
    41  			intercomKey: ""
    42  		}
    43  	};
    44  
    45  	if (environment === 'development') {
    46  		ENV.APP.LOG_TRANSITIONS = true;
    47  		ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
    48  		ENV.APP.LOG_RESOLVER = false;
    49  		ENV.APP.LOG_ACTIVE_GENERATION = false;
    50  		ENV.APP.LOG_VIEW_LOOKUPS = false;
    51  		ENV['ember-cli-mirage'] = {
    52  			enabled: false
    53  		};
    54  
    55  		ENV.apiHost = "https://localhost:5001";
    56  		ENV.apiNamespace = "api";
    57  	}
    58  
    59  	if (environment === 'test') {
    60  		ENV.APP.LOG_RESOLVER = false;
    61  		ENV.APP.LOG_ACTIVE_GENERATION = false;
    62  		ENV.APP.LOG_VIEW_LOOKUPS = false;
    63  		ENV.APP.LOG_TRANSITIONS = true;
    64  		// ENV.APP.LOG_TRANSITIONS_INTERNAL = false;
    65  
    66  		ENV.baseURL = '/';
    67  		ENV.locationType = 'none';
    68  		ENV.APP.rootElement = '#ember-testing';
    69  		ENV['ember-cli-mirage'] = {
    70  			enabled: true
    71  		};
    72  		ENV.APP.auditEnabled = false;
    73  
    74  		ENV.apiHost = "https://localhost:5001";
    75  	}
    76  
    77  	if (environment === 'production') {
    78  		ENV.APP.LOG_RESOLVER = false;
    79  		ENV.APP.LOG_ACTIVE_GENERATION = false;
    80  		ENV.APP.LOG_VIEW_LOOKUPS = false;
    81  		ENV.APP.LOG_TRANSITIONS = false;
    82  		ENV.APP.LOG_TRANSITIONS_INTERNAL = false;
    83  
    84  		ENV.apiHost = "";
    85  	}
    86  
    87  	process.argv.forEach(function (element) {
    88  		if (element !== undefined) {
    89  			if (element.startsWith("intercom=")) {
    90  				element = element.replace("intercom=", "");
    91  				ENV.APP.intercomKey = element;
    92  			}
    93  			if (element.startsWith("apiHost=")) {
    94  				element = element.replace("apiHost=", "");
    95  				ENV.apiHost = element;
    96  			}
    97  		}
    98  	});
    99  
   100  	ENV.apiNamespace = "api";
   101  	ENV.contentSecurityPolicy = null;
   102  
   103  	return ENV;
   104  };