settings.test.defaults.js 5.5 KB

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