settings.test.saas.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. tpdsworker: {
  31. // Disable tpdsworker in CI.
  32. url: undefined,
  33. },
  34. v1: {
  35. url: `http://127.0.0.1:25000`,
  36. user: 'overleaf',
  37. pass: 'password',
  38. },
  39. tags: {
  40. url: 'http://127.0.0.1:25000',
  41. },
  42. },
  43. oauthProviders: {
  44. provider: {
  45. name: 'provider',
  46. },
  47. collabratec: {
  48. name: 'collabratec',
  49. },
  50. google: {
  51. name: 'google',
  52. },
  53. },
  54. saml: undefined,
  55. contentful: {
  56. spaceId: 'a',
  57. deliveryToken: 'b',
  58. previewToken: 'c',
  59. deliveryApiHost: 'cdn.contentful.com',
  60. previewApiHost: 'preview.contentful.com',
  61. },
  62. twoFactorAuthentication: {
  63. accessTokenEncryptorOptions: {
  64. cipherPasswords: {
  65. '2023.1-v3': 'this-is-a-weak-secret-for-tests-web-2023.1-v3',
  66. },
  67. },
  68. },
  69. overleaf: {
  70. host: 'http://127.0.0.1:25000',
  71. oauth: {
  72. clientID: 'mock-oauth-client-id',
  73. clientSecret: 'mock-oauth-client-secret',
  74. },
  75. },
  76. analytics: {
  77. enabled: true,
  78. hashedEmailSalt: 'acceptance-test-salt',
  79. },
  80. }
  81. module.exports = baseApp.mergeWith(baseTest.mergeWith(overrides))
  82. for (const redisKey of Object.keys(module.exports.redis)) {
  83. module.exports.redis[redisKey].host = process.env.REDIS_HOST || '127.0.0.1'
  84. }
  85. module.exports.mergeWith = function (overrides) {
  86. return merge(overrides, module.exports)
  87. }