settings.test.defaults.js 5.1 KB

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