settings.test.defaults.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. const { merge } = require('@overleaf/settings/merge')
  2. let features
  3. const httpAuthUser = 'overleaf'
  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. features: (features = {
  89. v1_free: {
  90. collaborators: 1,
  91. dropbox: false,
  92. versioning: false,
  93. github: true,
  94. gitBridge: true,
  95. templates: false,
  96. references: false,
  97. referencesSearch: false,
  98. mendeley: true,
  99. zotero: true,
  100. compileTimeout: 60,
  101. compileGroup: 'standard',
  102. trackChanges: false,
  103. symbolPalette: false,
  104. },
  105. personal: {
  106. collaborators: 1,
  107. dropbox: false,
  108. versioning: false,
  109. github: false,
  110. gitBridge: false,
  111. templates: false,
  112. references: false,
  113. referencesSearch: false,
  114. mendeley: false,
  115. zotero: false,
  116. compileTimeout: 60,
  117. compileGroup: 'standard',
  118. trackChanges: false,
  119. symbolPalette: false,
  120. },
  121. collaborator: {
  122. collaborators: 10,
  123. dropbox: true,
  124. versioning: true,
  125. github: true,
  126. gitBridge: true,
  127. templates: true,
  128. references: true,
  129. referencesSearch: true,
  130. mendeley: true,
  131. zotero: true,
  132. compileTimeout: 180,
  133. compileGroup: 'priority',
  134. trackChanges: true,
  135. symbolPalette: true,
  136. },
  137. professional: {
  138. collaborators: -1,
  139. dropbox: true,
  140. versioning: true,
  141. github: true,
  142. gitBridge: true,
  143. templates: true,
  144. references: true,
  145. referencesSearch: true,
  146. mendeley: true,
  147. zotero: true,
  148. compileTimeout: 180,
  149. compileGroup: 'priority',
  150. trackChanges: true,
  151. symbolPalette: true,
  152. },
  153. }),
  154. defaultFeatures: features.personal,
  155. defaultPlanCode: 'personal',
  156. institutionPlanCode: 'professional',
  157. plans: [
  158. {
  159. planCode: 'v1_free',
  160. name: 'V1 Free',
  161. price_in_cents: 0,
  162. features: features.v1_free,
  163. },
  164. {
  165. planCode: 'personal',
  166. name: 'Personal',
  167. price_in_cents: 0,
  168. features: features.personal,
  169. },
  170. {
  171. planCode: 'collaborator',
  172. name: 'Collaborator',
  173. price_in_cents: 1500,
  174. features: features.collaborator,
  175. },
  176. {
  177. planCode: 'professional',
  178. name: 'Professional',
  179. price_in_cents: 3000,
  180. features: features.professional,
  181. },
  182. ],
  183. bonus_features: {
  184. 1: {
  185. collaborators: 2,
  186. dropbox: false,
  187. versioning: false,
  188. },
  189. 3: {
  190. collaborators: 4,
  191. dropbox: false,
  192. versioning: false,
  193. },
  194. 6: {
  195. collaborators: 4,
  196. dropbox: true,
  197. versioning: true,
  198. },
  199. 9: {
  200. collaborators: -1,
  201. dropbox: true,
  202. versioning: true,
  203. },
  204. },
  205. redirects: {
  206. '/redirect/one': '/destination/one',
  207. '/redirect/get_and_post': {
  208. methods: ['get', 'post'],
  209. url: '/destination/get_and_post',
  210. },
  211. '/redirect/base_url': {
  212. baseUrl: 'https://example.com',
  213. url: '/destination/base_url',
  214. },
  215. '/redirect/params/:id': {
  216. url(params) {
  217. return `/destination/${params.id}/params`
  218. },
  219. },
  220. '/redirect/qs': '/destination/qs',
  221. '/docs_v1': {
  222. url: '/docs',
  223. },
  224. },
  225. reconfirmNotificationDays: 14,
  226. unsupportedBrowsers: {
  227. ie: '<=11',
  228. },
  229. recaptcha: {
  230. siteKey: 'siteKey',
  231. disabled: {
  232. invite: true,
  233. login: false,
  234. passwordReset: true,
  235. register: true,
  236. addEmail: true,
  237. },
  238. },
  239. // No email in tests
  240. email: undefined,
  241. test: {
  242. counterInit: 0,
  243. },
  244. splitTest: {
  245. devToolbar: {
  246. enabled: false,
  247. },
  248. },
  249. }
  250. module.exports.mergeWith = function (overrides) {
  251. return merge(overrides, module.exports)
  252. }