settings.test.saas.js 2.1 KB

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