staging.js 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /**
  2. * Staging environment settings
  3. * (sails.config.*)
  4. *
  5. * This is mostly a carbon copy of the production environment settings
  6. * in config/env/production.js, but with the overrides listed below.
  7. * For more detailed information and links about what these settings do
  8. * see the production config file.
  9. *
  10. * > This file takes effect when `sails.config.environment` is "staging".
  11. * > But note that NODE_ENV should still be "production" when lifting
  12. * > your app in the staging environment. In other words:
  13. * > ```
  14. * > NODE_ENV=production sails_environment=staging node app
  15. * > ```
  16. *
  17. * If you're unsure or want advice, stop by:
  18. * https://sailsjs.com/support
  19. */
  20. var PRODUCTION_CONFIG = require('./production');
  21. //--------------------------------------------------------------------------
  22. // /\ Start with your production config, even if it's just a guess for now,
  23. // || then configure your staging environment afterwards.
  24. // (That way, all you need to do in this file is set overrides.)
  25. //--------------------------------------------------------------------------
  26. module.exports = Object.assign({}, PRODUCTION_CONFIG, {
  27. datastores: Object.assign({}, PRODUCTION_CONFIG.datastores, {
  28. default: Object.assign({}, PRODUCTION_CONFIG.datastores.default, {
  29. // url: 'mysql://shared:some_password_everyone_knows@db.example.com:3306/my_staging_db',
  30. //--------------------------------------------------------------------------
  31. // /\ Hard-code your staging db `url`.
  32. // || (or use system env var: `sails_datastores__default__url`)
  33. //--------------------------------------------------------------------------
  34. })
  35. }),
  36. sockets: Object.assign({}, PRODUCTION_CONFIG.sockets, {
  37. onlyAllowOrigins: [
  38. 'http://localhost:1337',
  39. // 'https://example-staging.herokuapp.com',
  40. // 'http://example-staging.herokuapp.com',
  41. // 'https://staging.example.com',
  42. // 'http://staging.example.com',
  43. ],
  44. //--------------------------------------------------------------------------
  45. // /\ Hard-code a staging-only override for allowed origins.
  46. // || (or set this array via JSON-encoded system env var)
  47. // ```
  48. // sails_sockets__onlyAllowOrigins='["http://localhost:1337", "…"]'
  49. // ```
  50. //--------------------------------------------------------------------------
  51. // url: 'redis://shared:some_password_everyone_knows@bigsquid.redistogo.com:9562/',
  52. //--------------------------------------------------------------------------
  53. // /\ Hard-code your staging Redis server's `url`.
  54. // || (or use system env var: `sails_sockets__url`)
  55. //--------------------------------------------------------------------------
  56. }),
  57. session: Object.assign({}, PRODUCTION_CONFIG.session, {
  58. // url: 'redis://shared:some_password_everyone_knows@bigsquid.redistogo.com:9562/staging-sessions',
  59. //--------------------------------------------------------------------------
  60. // /\ Hard-code your staging Redis server's `url` again here.
  61. // || (or use system env var: `sails_session__url`)
  62. //--------------------------------------------------------------------------
  63. }),
  64. custom: Object.assign({}, PRODUCTION_CONFIG.custom, {
  65. baseUrl: 'https://staging.example.com',
  66. //--------------------------------------------------------------------------
  67. // /\ Hard-code the base URL where your staging environment is hosted.
  68. // || (or use system env var: `sails_custom__baseUrl`)
  69. //--------------------------------------------------------------------------
  70. internalEmailAddress: 'support+staging@example.com',
  71. //--------------------------------------------------------------------------
  72. // /\ Hard-code the email address that should receive support/contact form
  73. // || messages in staging (or use `sails_custom__internalEmailAddress`)
  74. //--------------------------------------------------------------------------
  75. // mailgunSecret: 'key-sandbox_fake_bd32301385130a0bafe030c',
  76. // stripeSecret: 'sk_sandbox__fake_Nfgh82401348jaDa3lkZ0d9Hm',
  77. // stripePublishableKey: 'pk_sandbox__fake_fKd3mZJs1mlYrzWt7JQtkcRb',
  78. //--------------------------------------------------------------------------
  79. // /\ Hard-code credentials to use in staging for other 3rd party APIs, etc.
  80. // || (or use system environment variables prefixed with "sails_custom__")
  81. //--------------------------------------------------------------------------
  82. })
  83. });