settings.test.defaults.js 5.5 KB

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