settings.test.defaults.js 5.3 KB

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