settings.test.defaults.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. cdn: {
  21. web: {
  22. host: 'cdn.example.com',
  23. },
  24. },
  25. apis: {
  26. linkedUrlProxy: {
  27. url: process.env.LINKED_URL_PROXY,
  28. },
  29. web: {
  30. url: 'http://localhost:23000',
  31. user: httpAuthUser,
  32. pass: httpAuthPass,
  33. },
  34. haveIBeenPwned: {
  35. enabled: false,
  36. url: 'http://localhost:1337',
  37. },
  38. documentupdater: {
  39. url: 'http://localhost:23003',
  40. },
  41. spelling: {
  42. url: 'http://localhost:23005',
  43. host: 'localhost',
  44. },
  45. trackchanges: {
  46. url: 'http://localhost:23015',
  47. },
  48. docstore: {
  49. url: 'http://localhost:23016',
  50. pubUrl: 'http://localhost:23016',
  51. },
  52. chat: {
  53. internal_url: 'http://localhost:23010',
  54. },
  55. filestore: {
  56. url: 'http://localhost:23009',
  57. },
  58. clsi: {
  59. url: 'http://localhost:23013',
  60. },
  61. realTime: {
  62. url: 'http://localhost:23026',
  63. },
  64. contacts: {
  65. url: 'http://localhost:23036',
  66. },
  67. notifications: {
  68. url: 'http://localhost:23042',
  69. },
  70. webpack: {
  71. url: 'http://localhost:23808',
  72. },
  73. },
  74. // for registration via SL, set enableLegacyRegistration to true
  75. // for registration via Overleaf v1, set enableLegacyLogin to true
  76. // Currently, acceptance tests require enableLegacyRegistration.
  77. enableLegacyRegistration: true,
  78. features: (features = {
  79. v1_free: {
  80. collaborators: 1,
  81. dropbox: false,
  82. versioning: false,
  83. github: true,
  84. gitBridge: true,
  85. templates: false,
  86. references: false,
  87. referencesSearch: false,
  88. mendeley: true,
  89. zotero: true,
  90. compileTimeout: 60,
  91. compileGroup: 'standard',
  92. trackChanges: false,
  93. symbolPalette: false,
  94. },
  95. personal: {
  96. collaborators: 1,
  97. dropbox: false,
  98. versioning: false,
  99. github: false,
  100. gitBridge: false,
  101. templates: false,
  102. references: false,
  103. referencesSearch: false,
  104. mendeley: false,
  105. zotero: false,
  106. compileTimeout: 60,
  107. compileGroup: 'standard',
  108. trackChanges: false,
  109. symbolPalette: false,
  110. },
  111. collaborator: {
  112. collaborators: 10,
  113. dropbox: true,
  114. versioning: true,
  115. github: true,
  116. gitBridge: true,
  117. templates: true,
  118. references: true,
  119. referencesSearch: true,
  120. mendeley: true,
  121. zotero: true,
  122. compileTimeout: 180,
  123. compileGroup: 'priority',
  124. trackChanges: true,
  125. symbolPalette: true,
  126. },
  127. professional: {
  128. collaborators: -1,
  129. dropbox: true,
  130. versioning: true,
  131. github: true,
  132. gitBridge: true,
  133. templates: true,
  134. references: true,
  135. referencesSearch: true,
  136. mendeley: true,
  137. zotero: true,
  138. compileTimeout: 180,
  139. compileGroup: 'priority',
  140. trackChanges: true,
  141. symbolPalette: true,
  142. },
  143. }),
  144. defaultFeatures: features.personal,
  145. defaultPlanCode: 'personal',
  146. institutionPlanCode: 'professional',
  147. plans: [
  148. {
  149. planCode: 'v1_free',
  150. name: 'V1 Free',
  151. price_in_cents: 0,
  152. features: features.v1_free,
  153. },
  154. {
  155. planCode: 'personal',
  156. name: 'Personal',
  157. price_in_cents: 0,
  158. features: features.personal,
  159. },
  160. {
  161. planCode: 'collaborator',
  162. name: 'Collaborator',
  163. price_in_cents: 1500,
  164. features: features.collaborator,
  165. },
  166. {
  167. planCode: 'professional',
  168. name: 'Professional',
  169. price_in_cents: 3000,
  170. features: features.professional,
  171. },
  172. ],
  173. bonus_features: {
  174. 1: {
  175. collaborators: 2,
  176. dropbox: false,
  177. versioning: false,
  178. },
  179. 3: {
  180. collaborators: 4,
  181. dropbox: false,
  182. versioning: false,
  183. },
  184. 6: {
  185. collaborators: 4,
  186. dropbox: true,
  187. versioning: true,
  188. },
  189. 9: {
  190. collaborators: -1,
  191. dropbox: true,
  192. versioning: true,
  193. },
  194. },
  195. redirects: {
  196. '/redirect/one': '/destination/one',
  197. '/redirect/get_and_post': {
  198. methods: ['get', 'post'],
  199. url: '/destination/get_and_post',
  200. },
  201. '/redirect/base_url': {
  202. baseUrl: 'https://example.com',
  203. url: '/destination/base_url',
  204. },
  205. '/redirect/params/:id': {
  206. url(params) {
  207. return `/destination/${params.id}/params`
  208. },
  209. },
  210. '/redirect/qs': '/destination/qs',
  211. '/docs_v1': {
  212. url: '/docs',
  213. },
  214. },
  215. reconfirmNotificationDays: 14,
  216. unsupportedBrowsers: {
  217. ie: '<=11',
  218. },
  219. recaptcha: {
  220. siteKey: 'siteKey',
  221. disabled: {
  222. invite: true,
  223. login: false,
  224. passwordReset: true,
  225. register: true,
  226. },
  227. },
  228. // No email in tests
  229. email: undefined,
  230. test: {
  231. counterInit: 0,
  232. },
  233. }
  234. module.exports.mergeWith = function (overrides) {
  235. return merge(overrides, module.exports)
  236. }