settings.test.defaults.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. const { merge } = require('@overleaf/settings/merge')
  2. let features
  3. const httpAuthUser = 'sharelatex'
  4. const httpAuthPass = 'password'
  5. const httpAuthUsers = {}
  6. httpAuthUsers[httpAuthUser] = httpAuthPass
  7. module.exports = {
  8. catchErrors: false,
  9. clsiCookie: undefined,
  10. cacheStaticAssets: true,
  11. httpAuthUsers,
  12. secureCookie: false,
  13. security: {
  14. sessionSecret: 'static-secret-for-tests',
  15. },
  16. adminDomains: process.env.ADMIN_DOMAINS
  17. ? JSON.parse(process.env.ADMIN_DOMAINS)
  18. : ['example.com'],
  19. statusPageUrl: 'status.example.com',
  20. apis: {
  21. linkedUrlProxy: {
  22. url: process.env.LINKED_URL_PROXY,
  23. },
  24. web: {
  25. user: httpAuthUser,
  26. pass: httpAuthPass,
  27. },
  28. },
  29. // for registration via SL, set enableLegacyRegistration to true
  30. // for registration via Overleaf v1, set enableLegacyLogin to true
  31. // Currently, acceptance tests require enableLegacyRegistration.
  32. enableLegacyRegistration: true,
  33. features: (features = {
  34. v1_free: {
  35. collaborators: 1,
  36. dropbox: false,
  37. versioning: false,
  38. github: true,
  39. gitBridge: true,
  40. templates: false,
  41. references: false,
  42. referencesSearch: false,
  43. mendeley: true,
  44. zotero: true,
  45. compileTimeout: 60,
  46. compileGroup: 'standard',
  47. trackChanges: false,
  48. },
  49. personal: {
  50. collaborators: 1,
  51. dropbox: false,
  52. versioning: false,
  53. github: false,
  54. gitBridge: false,
  55. templates: false,
  56. references: false,
  57. referencesSearch: false,
  58. mendeley: false,
  59. zotero: false,
  60. compileTimeout: 60,
  61. compileGroup: 'standard',
  62. trackChanges: false,
  63. },
  64. collaborator: {
  65. collaborators: 10,
  66. dropbox: true,
  67. versioning: true,
  68. github: true,
  69. gitBridge: true,
  70. templates: true,
  71. references: true,
  72. referencesSearch: true,
  73. mendeley: true,
  74. zotero: true,
  75. compileTimeout: 180,
  76. compileGroup: 'priority',
  77. trackChanges: true,
  78. },
  79. professional: {
  80. collaborators: -1,
  81. dropbox: true,
  82. versioning: true,
  83. github: true,
  84. gitBridge: true,
  85. templates: true,
  86. references: true,
  87. referencesSearch: true,
  88. mendeley: true,
  89. zotero: true,
  90. compileTimeout: 180,
  91. compileGroup: 'priority',
  92. trackChanges: true,
  93. },
  94. }),
  95. defaultFeatures: features.personal,
  96. defaultPlanCode: 'personal',
  97. institutionPlanCode: 'professional',
  98. plans: [
  99. {
  100. planCode: 'v1_free',
  101. name: 'V1 Free',
  102. price: 0,
  103. features: features.v1_free,
  104. },
  105. {
  106. planCode: 'personal',
  107. name: 'Personal',
  108. price: 0,
  109. features: features.personal,
  110. },
  111. {
  112. planCode: 'collaborator',
  113. name: 'Collaborator',
  114. price: 1500,
  115. features: features.collaborator,
  116. },
  117. {
  118. planCode: 'professional',
  119. name: 'Professional',
  120. price: 3000,
  121. features: features.professional,
  122. },
  123. ],
  124. bonus_features: {
  125. 1: {
  126. collaborators: 2,
  127. dropbox: false,
  128. versioning: false,
  129. },
  130. 3: {
  131. collaborators: 4,
  132. dropbox: false,
  133. versioning: false,
  134. },
  135. 6: {
  136. collaborators: 4,
  137. dropbox: true,
  138. versioning: true,
  139. },
  140. 9: {
  141. collaborators: -1,
  142. dropbox: true,
  143. versioning: true,
  144. },
  145. },
  146. redirects: {
  147. '/redirect/one': '/destination/one',
  148. '/redirect/get_and_post': {
  149. methods: ['get', 'post'],
  150. url: '/destination/get_and_post',
  151. },
  152. '/redirect/base_url': {
  153. baseUrl: 'https://example.com',
  154. url: '/destination/base_url',
  155. },
  156. '/redirect/params/:id': {
  157. url(params) {
  158. return `/destination/${params.id}/params`
  159. },
  160. },
  161. '/redirect/qs': '/destination/qs',
  162. '/docs_v1': {
  163. url: '/docs',
  164. },
  165. },
  166. reconfirmNotificationDays: 14,
  167. unsupportedBrowsers: {
  168. ie: '<=11',
  169. },
  170. // No email in tests
  171. email: undefined,
  172. test: {
  173. counterInit: 0,
  174. },
  175. }
  176. module.exports.mergeWith = function (overrides) {
  177. return merge(overrides, module.exports)
  178. }