settings.test.saas.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. const { merge } = require('@overleaf/settings/merge')
  2. const baseApp = require('../../../config/settings.overrides.saas')
  3. const baseTest = require('./settings.test.defaults')
  4. const httpAuthUser = 'overleaf'
  5. const httpAuthPass = 'password'
  6. const httpAuthUsers = {}
  7. httpAuthUsers[httpAuthUser] = httpAuthPass
  8. const overleafHost =
  9. process.env.V2_URL ||
  10. `http://${process.env.HTTP_TEST_HOST || '127.0.0.1'}:23000`
  11. const overrides = {
  12. appName: 'Overleaf',
  13. siteUrl: overleafHost,
  14. enableSubscriptions: true,
  15. apis: {
  16. thirdPartyDataStore: {
  17. url: `http://127.0.0.1:23002`,
  18. dropboxApp: 'Overleaf',
  19. },
  20. analytics: {
  21. url: `http://127.0.0.1:23050`,
  22. },
  23. recurly: {
  24. url: 'http://127.0.0.1:26034',
  25. subdomain: 'test',
  26. apiKey: 'private-nonsense',
  27. webhookUser: 'recurly',
  28. webhookPass: 'webhook',
  29. },
  30. stripeUS: {
  31. accountId: 'test_us_account',
  32. publishableKey: 'test_us_publishable_key',
  33. secretKey: 'sk_test_xxx',
  34. webhookSignature: 'test_us_webhook_signature',
  35. },
  36. stripeUK: {
  37. accountId: 'test_uk_account',
  38. publishableKey: 'test_uk_publishable_key',
  39. secretKey: 'sk_test_xxx',
  40. webhookSignature: 'test_uk_webhook_signature',
  41. },
  42. v1: {
  43. url: `http://127.0.0.1:25000`,
  44. user: 'overleaf',
  45. pass: 'password',
  46. },
  47. tags: {
  48. url: 'http://127.0.0.1:25000',
  49. },
  50. },
  51. oauthProviders: {
  52. provider: {
  53. name: 'provider',
  54. },
  55. collabratec: {
  56. name: 'collabratec',
  57. },
  58. google: {
  59. name: 'google',
  60. },
  61. },
  62. saml: undefined,
  63. contentful: {
  64. spaceId: 'a',
  65. deliveryToken: 'b',
  66. previewToken: 'c',
  67. deliveryApiHost: 'cdn.contentful.com',
  68. previewApiHost: 'preview.contentful.com',
  69. },
  70. twoFactorAuthentication: {
  71. accessTokenEncryptorOptions: {
  72. cipherPasswords: {
  73. '2023.1-v3': 'this-is-a-weak-secret-for-tests-web-2023.1-v3',
  74. },
  75. },
  76. },
  77. overleaf: {
  78. host: 'http://127.0.0.1:25000',
  79. oauth: {
  80. clientID: 'mock-oauth-client-id',
  81. clientSecret: 'mock-oauth-client-secret',
  82. },
  83. },
  84. analytics: {
  85. enabled: true,
  86. hashedEmailSalt: 'acceptance-test-salt',
  87. },
  88. }
  89. module.exports = baseApp.mergeWith(baseTest.mergeWith(overrides))
  90. for (const redisKey of Object.keys(module.exports.redis)) {
  91. module.exports.redis[redisKey].host = process.env.REDIS_HOST || '127.0.0.1'
  92. }
  93. module.exports.mergeWith = function (overrides) {
  94. return merge(overrides, module.exports)
  95. }