settings.test.defaults.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. haveIBeenPwned: {
  29. enabled: false,
  30. url: 'http://localhost:1337',
  31. },
  32. },
  33. // for registration via SL, set enableLegacyRegistration to true
  34. // for registration via Overleaf v1, set enableLegacyLogin to true
  35. // Currently, acceptance tests require enableLegacyRegistration.
  36. enableLegacyRegistration: true,
  37. features: (features = {
  38. v1_free: {
  39. collaborators: 1,
  40. dropbox: false,
  41. versioning: false,
  42. github: true,
  43. gitBridge: true,
  44. templates: false,
  45. references: false,
  46. referencesSearch: false,
  47. mendeley: true,
  48. zotero: true,
  49. compileTimeout: 60,
  50. compileGroup: 'standard',
  51. trackChanges: false,
  52. symbolPalette: false,
  53. },
  54. personal: {
  55. collaborators: 1,
  56. dropbox: false,
  57. versioning: false,
  58. github: false,
  59. gitBridge: false,
  60. templates: false,
  61. references: false,
  62. referencesSearch: false,
  63. mendeley: false,
  64. zotero: false,
  65. compileTimeout: 60,
  66. compileGroup: 'standard',
  67. trackChanges: false,
  68. symbolPalette: false,
  69. },
  70. collaborator: {
  71. collaborators: 10,
  72. dropbox: true,
  73. versioning: true,
  74. github: true,
  75. gitBridge: true,
  76. templates: true,
  77. references: true,
  78. referencesSearch: true,
  79. mendeley: true,
  80. zotero: true,
  81. compileTimeout: 180,
  82. compileGroup: 'priority',
  83. trackChanges: true,
  84. symbolPalette: true,
  85. },
  86. professional: {
  87. collaborators: -1,
  88. dropbox: true,
  89. versioning: true,
  90. github: true,
  91. gitBridge: true,
  92. templates: true,
  93. references: true,
  94. referencesSearch: true,
  95. mendeley: true,
  96. zotero: true,
  97. compileTimeout: 180,
  98. compileGroup: 'priority',
  99. trackChanges: true,
  100. symbolPalette: true,
  101. },
  102. }),
  103. defaultFeatures: features.personal,
  104. defaultPlanCode: 'personal',
  105. institutionPlanCode: 'professional',
  106. plans: [
  107. {
  108. planCode: 'v1_free',
  109. name: 'V1 Free',
  110. price_in_cents: 0,
  111. features: features.v1_free,
  112. },
  113. {
  114. planCode: 'personal',
  115. name: 'Personal',
  116. price_in_cents: 0,
  117. features: features.personal,
  118. },
  119. {
  120. planCode: 'collaborator',
  121. name: 'Collaborator',
  122. price_in_cents: 1500,
  123. features: features.collaborator,
  124. },
  125. {
  126. planCode: 'professional',
  127. name: 'Professional',
  128. price_in_cents: 3000,
  129. features: features.professional,
  130. },
  131. ],
  132. bonus_features: {
  133. 1: {
  134. collaborators: 2,
  135. dropbox: false,
  136. versioning: false,
  137. },
  138. 3: {
  139. collaborators: 4,
  140. dropbox: false,
  141. versioning: false,
  142. },
  143. 6: {
  144. collaborators: 4,
  145. dropbox: true,
  146. versioning: true,
  147. },
  148. 9: {
  149. collaborators: -1,
  150. dropbox: true,
  151. versioning: true,
  152. },
  153. },
  154. redirects: {
  155. '/redirect/one': '/destination/one',
  156. '/redirect/get_and_post': {
  157. methods: ['get', 'post'],
  158. url: '/destination/get_and_post',
  159. },
  160. '/redirect/base_url': {
  161. baseUrl: 'https://example.com',
  162. url: '/destination/base_url',
  163. },
  164. '/redirect/params/:id': {
  165. url(params) {
  166. return `/destination/${params.id}/params`
  167. },
  168. },
  169. '/redirect/qs': '/destination/qs',
  170. '/docs_v1': {
  171. url: '/docs',
  172. },
  173. },
  174. reconfirmNotificationDays: 14,
  175. unsupportedBrowsers: {
  176. ie: '<=11',
  177. },
  178. recaptcha: {
  179. siteKey: 'siteKey',
  180. disabled: {
  181. invite: true,
  182. login: false,
  183. passwordReset: true,
  184. register: true,
  185. },
  186. },
  187. // No email in tests
  188. email: undefined,
  189. test: {
  190. counterInit: 0,
  191. },
  192. }
  193. module.exports.mergeWith = function (overrides) {
  194. return merge(overrides, module.exports)
  195. }