settings.test.defaults.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. user: httpAuthUser,
  26. pass: httpAuthPass,
  27. },
  28. },
  29. // for registration via SL, set enableLegacyRegistration to true
  30. // for registration via Overleaf v1, set enableLegacyLogin to true
  31. // Currently, acceptance tests require enableLegacyRegistration.
  32. enableLegacyRegistration: true,
  33. features: (features = {
  34. v1_free: {
  35. collaborators: 1,
  36. dropbox: false,
  37. versioning: false,
  38. github: true,
  39. gitBridge: true,
  40. templates: false,
  41. references: false,
  42. referencesSearch: false,
  43. mendeley: true,
  44. zotero: true,
  45. compileTimeout: 60,
  46. compileGroup: 'standard',
  47. trackChanges: false,
  48. symbolPalette: false,
  49. },
  50. personal: {
  51. collaborators: 1,
  52. dropbox: false,
  53. versioning: false,
  54. github: false,
  55. gitBridge: false,
  56. templates: false,
  57. references: false,
  58. referencesSearch: false,
  59. mendeley: false,
  60. zotero: false,
  61. compileTimeout: 60,
  62. compileGroup: 'standard',
  63. trackChanges: false,
  64. symbolPalette: false,
  65. },
  66. collaborator: {
  67. collaborators: 10,
  68. dropbox: true,
  69. versioning: true,
  70. github: true,
  71. gitBridge: true,
  72. templates: true,
  73. references: true,
  74. referencesSearch: true,
  75. mendeley: true,
  76. zotero: true,
  77. compileTimeout: 180,
  78. compileGroup: 'priority',
  79. trackChanges: true,
  80. symbolPalette: true,
  81. },
  82. professional: {
  83. collaborators: -1,
  84. dropbox: true,
  85. versioning: true,
  86. github: true,
  87. gitBridge: true,
  88. templates: true,
  89. references: true,
  90. referencesSearch: true,
  91. mendeley: true,
  92. zotero: true,
  93. compileTimeout: 180,
  94. compileGroup: 'priority',
  95. trackChanges: true,
  96. symbolPalette: true,
  97. },
  98. }),
  99. defaultFeatures: features.personal,
  100. defaultPlanCode: 'personal',
  101. institutionPlanCode: 'professional',
  102. plans: [
  103. {
  104. planCode: 'v1_free',
  105. name: 'V1 Free',
  106. price: 0,
  107. features: features.v1_free,
  108. },
  109. {
  110. planCode: 'personal',
  111. name: 'Personal',
  112. price: 0,
  113. features: features.personal,
  114. },
  115. {
  116. planCode: 'collaborator',
  117. name: 'Collaborator',
  118. price: 1500,
  119. features: features.collaborator,
  120. },
  121. {
  122. planCode: 'professional',
  123. name: 'Professional',
  124. price: 3000,
  125. features: features.professional,
  126. },
  127. ],
  128. bonus_features: {
  129. 1: {
  130. collaborators: 2,
  131. dropbox: false,
  132. versioning: false,
  133. },
  134. 3: {
  135. collaborators: 4,
  136. dropbox: false,
  137. versioning: false,
  138. },
  139. 6: {
  140. collaborators: 4,
  141. dropbox: true,
  142. versioning: true,
  143. },
  144. 9: {
  145. collaborators: -1,
  146. dropbox: true,
  147. versioning: true,
  148. },
  149. },
  150. redirects: {
  151. '/redirect/one': '/destination/one',
  152. '/redirect/get_and_post': {
  153. methods: ['get', 'post'],
  154. url: '/destination/get_and_post',
  155. },
  156. '/redirect/base_url': {
  157. baseUrl: 'https://example.com',
  158. url: '/destination/base_url',
  159. },
  160. '/redirect/params/:id': {
  161. url(params) {
  162. return `/destination/${params.id}/params`
  163. },
  164. },
  165. '/redirect/qs': '/destination/qs',
  166. '/docs_v1': {
  167. url: '/docs',
  168. },
  169. },
  170. reconfirmNotificationDays: 14,
  171. unsupportedBrowsers: {
  172. ie: '<=11',
  173. },
  174. // No email in tests
  175. email: undefined,
  176. test: {
  177. counterInit: 0,
  178. },
  179. }
  180. module.exports.mergeWith = function (overrides) {
  181. return merge(overrides, module.exports)
  182. }