settings.test.saas.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 overrides = {
  9. enableSubscriptions: true,
  10. apis: {
  11. thirdPartyDataStore: {
  12. url: `http://127.0.0.1:23002`,
  13. },
  14. analytics: {
  15. url: `http://127.0.0.1:23050`,
  16. },
  17. recurly: {
  18. url: 'http://127.0.0.1:26034',
  19. subdomain: 'test',
  20. apiKey: 'private-nonsense',
  21. webhookUser: 'recurly',
  22. webhookPass: 'webhook',
  23. },
  24. tpdsworker: {
  25. // Disable tpdsworker in CI.
  26. url: undefined,
  27. },
  28. v1: {
  29. url: `http://127.0.0.1:25000`,
  30. user: 'overleaf',
  31. pass: 'password',
  32. },
  33. },
  34. oauthProviders: {
  35. provider: {
  36. name: 'provider',
  37. },
  38. collabratec: {
  39. name: 'collabratec',
  40. },
  41. google: {
  42. name: 'google',
  43. },
  44. },
  45. saml: undefined,
  46. contentful: {
  47. spaceId: 'a',
  48. deliveryToken: 'b',
  49. previewToken: 'c',
  50. deliveryApiHost: 'cdn.contentful.com',
  51. previewApiHost: 'preview.contentful.com',
  52. },
  53. twoFactorAuthentication: {
  54. accessTokenEncryptorOptions: {
  55. cipherPasswords: {
  56. '2023.1-v3': 'this-is-a-weak-secret-for-tests-web-2023.1-v3',
  57. },
  58. },
  59. },
  60. }
  61. module.exports = baseApp.mergeWith(baseTest.mergeWith(overrides))
  62. for (const redisKey of Object.keys(module.exports.redis)) {
  63. module.exports.redis[redisKey].host = process.env.REDIS_HOST || '127.0.0.1'
  64. }
  65. module.exports.mergeWith = function (overrides) {
  66. return merge(overrides, module.exports)
  67. }