environment.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* jshint node: true */
  2. module.exports = function(environment) {
  3. var ENV = {
  4. modulePrefix: 'misago',
  5. environment: environment,
  6. baseURL: '/',
  7. locationType: 'auto',
  8. EmberENV: {
  9. FEATURES: {
  10. // Here you can enable experimental features on an ember canary build
  11. // e.g. 'with-controller': true
  12. }
  13. },
  14. APP: {
  15. // Here you can pass flags/options to your application instance
  16. // when it is created
  17. rootElement: '#main'
  18. }
  19. };
  20. if (environment === 'development') {
  21. // ENV.APP.LOG_RESOLVER = true;
  22. ENV.APP.LOG_ACTIVE_GENERATION = true;
  23. ENV.APP.LOG_TRANSITIONS = true;
  24. // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
  25. ENV.APP.LOG_VIEW_LOOKUPS = true;
  26. ENV.contentSecurityPolicy = {
  27. 'default-src': "'none'",
  28. 'script-src': "'self' 'unsafe-inline' https://cdn.mxpnl.com 127.0.0.1:8000", // Allow scripts from https://cdn.mxpnl.com and Django runserver
  29. 'font-src': "'self' http://fonts.gstatic.com", // Allow fonts to be loaded from http://fonts.gstatic.com
  30. 'connect-src': "'self' https://api.mixpanel.com http://localhost:8000", // Allow data (ajax/websocket) from api.mixpanel.com and custom-api.local
  31. 'img-src': "'self'",
  32. 'style-src': "'self' 'unsafe-inline' http://fonts.googleapis.com", // Allow inline styles and loaded CSS from http://fonts.googleapis.com
  33. 'media-src': "'self'"
  34. }
  35. ENV.APP.API_HOST = 'http://localhost:8000';
  36. ENV.APP.API_NAMESPACE = 'api';
  37. }
  38. if (environment === 'test') {
  39. // Testem prefers this...
  40. ENV.baseURL = '/';
  41. ENV.locationType = 'none';
  42. // keep test console output quieter
  43. ENV.APP.LOG_ACTIVE_GENERATION = false;
  44. ENV.APP.LOG_VIEW_LOOKUPS = false;
  45. ENV.APP.rootElement = '#ember-testing';
  46. }
  47. if (environment === 'production') {
  48. }
  49. return ENV;
  50. };