settings.test.defaults.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. docstore: {
  46. url: 'http://localhost:23016',
  47. pubUrl: 'http://localhost:23016',
  48. },
  49. chat: {
  50. internal_url: 'http://localhost:23010',
  51. },
  52. filestore: {
  53. url: 'http://localhost:23009',
  54. },
  55. clsi: {
  56. url: 'http://localhost:23013',
  57. },
  58. realTime: {
  59. url: 'http://localhost:23026',
  60. },
  61. contacts: {
  62. url: 'http://localhost:23036',
  63. },
  64. notifications: {
  65. url: 'http://localhost:23042',
  66. },
  67. project_history: {
  68. sendProjectStructureOps: true,
  69. url: `http://localhost:23054`,
  70. },
  71. v1_history: {
  72. url: `http://localhost:23100/api`,
  73. user: 'overleaf',
  74. pass: 'password',
  75. },
  76. webpack: {
  77. url: 'http://localhost:23808',
  78. },
  79. gitBridge: {
  80. url: 'http://localhost:28000',
  81. },
  82. },
  83. // for registration via SL, set enableLegacyRegistration to true
  84. // for registration via Overleaf v1, set enableLegacyLogin to true
  85. // Currently, acceptance tests require enableLegacyRegistration.
  86. enableLegacyRegistration: true,
  87. features: (features = {
  88. v1_free: {
  89. collaborators: 1,
  90. dropbox: false,
  91. versioning: false,
  92. github: true,
  93. gitBridge: true,
  94. templates: false,
  95. references: false,
  96. referencesSearch: false,
  97. mendeley: true,
  98. zotero: true,
  99. compileTimeout: 60,
  100. compileGroup: 'standard',
  101. trackChanges: false,
  102. symbolPalette: false,
  103. },
  104. personal: {
  105. collaborators: 1,
  106. dropbox: false,
  107. versioning: false,
  108. github: false,
  109. gitBridge: false,
  110. templates: false,
  111. references: false,
  112. referencesSearch: false,
  113. mendeley: false,
  114. zotero: false,
  115. compileTimeout: 60,
  116. compileGroup: 'standard',
  117. trackChanges: false,
  118. symbolPalette: false,
  119. },
  120. collaborator: {
  121. collaborators: 10,
  122. dropbox: true,
  123. versioning: true,
  124. github: true,
  125. gitBridge: true,
  126. templates: true,
  127. references: true,
  128. referencesSearch: true,
  129. mendeley: true,
  130. zotero: true,
  131. compileTimeout: 180,
  132. compileGroup: 'priority',
  133. trackChanges: true,
  134. symbolPalette: true,
  135. },
  136. professional: {
  137. collaborators: -1,
  138. dropbox: true,
  139. versioning: true,
  140. github: true,
  141. gitBridge: true,
  142. templates: 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. unsupportedBrowsers: {
  226. ie: '<=11',
  227. },
  228. recaptcha: {
  229. siteKey: 'siteKey',
  230. disabled: {
  231. invite: true,
  232. login: false,
  233. passwordReset: true,
  234. register: true,
  235. },
  236. },
  237. // No email in tests
  238. email: undefined,
  239. test: {
  240. counterInit: 0,
  241. },
  242. }
  243. module.exports.mergeWith = function (overrides) {
  244. return merge(overrides, module.exports)
  245. }