settings.test.saas.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 = 'sharelatex'
  5. const httpAuthPass = 'password'
  6. const httpAuthUsers = {}
  7. httpAuthUsers[httpAuthUser] = httpAuthPass
  8. const overrides = {
  9. enableSubscriptions: true,
  10. apis: {
  11. project_history: {
  12. sendProjectStructureOps: true,
  13. initializeHistoryForNewProjects: true,
  14. displayHistoryForNewProjects: true,
  15. url: `http://localhost:3054`,
  16. },
  17. recurly: {
  18. url: 'http://localhost:6034',
  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://localhost:5000',
  30. user: 'overleaf',
  31. pass: 'password',
  32. },
  33. v1_history: {
  34. url: `http://localhost:3100/api`,
  35. user: 'overleaf',
  36. pass: 'password',
  37. },
  38. },
  39. oauthProviders: {
  40. provider: {
  41. name: 'provider',
  42. },
  43. collabratec: {
  44. name: 'collabratec',
  45. },
  46. google: {
  47. name: 'google',
  48. },
  49. },
  50. overleaf: {
  51. oauth: undefined,
  52. },
  53. saml: undefined,
  54. // Disable contentful module.
  55. contentful: undefined,
  56. }
  57. module.exports = baseApp.mergeWith(baseTest.mergeWith(overrides))
  58. for (const redisKey of Object.keys(module.exports.redis)) {
  59. module.exports.redis[redisKey].host = process.env.REDIS_HOST || 'localhost'
  60. }
  61. module.exports.mergeWith = function (overrides) {
  62. return merge(overrides, module.exports)
  63. }