settings.test.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. const base = require('../../../config/settings.overrides.saas')
  2. let features
  3. const v1Api = {
  4. url: 'http://localhost:5000',
  5. user: 'overleaf',
  6. pass: 'password',
  7. }
  8. const httpAuthUser = 'sharelatex'
  9. const httpAuthPass = 'password'
  10. const httpAuthUsers = {}
  11. httpAuthUsers[httpAuthUser] = httpAuthPass
  12. module.exports = base.mergeWith({
  13. catchErrors: false,
  14. clsiCookie: undefined,
  15. cacheStaticAssets: true,
  16. enableSubscriptions: true,
  17. httpAuthUsers,
  18. secureCookie: false,
  19. security: {
  20. sessionSecret: 'static-secret-for-tests',
  21. },
  22. adminDomains: ['example.com'],
  23. apis: {
  24. web: {
  25. user: httpAuthUser,
  26. pass: httpAuthPass,
  27. },
  28. v1: {
  29. url: v1Api.url,
  30. user: v1Api.user,
  31. pass: v1Api.pass,
  32. },
  33. recurly: {
  34. // Set up our own mock recurly server
  35. url: 'http://localhost:6034',
  36. subdomain: 'test',
  37. apiKey: 'private-nonsense',
  38. webhookUser: 'recurly',
  39. webhookPass: 'webhook',
  40. },
  41. tpdsworker: {
  42. // Disable tpdsworker in CI.
  43. url: undefined,
  44. },
  45. },
  46. // for registration via SL, set enableLegacyRegistration to true
  47. // for registration via Overleaf v1, set enableLegacyLogin to true
  48. // Currently, acceptance tests require enableLegacyRegistration.
  49. enableLegacyRegistration: true,
  50. features: (features = {
  51. v1_free: {
  52. collaborators: 1,
  53. dropbox: false,
  54. versioning: false,
  55. github: true,
  56. gitBridge: true,
  57. templates: false,
  58. references: false,
  59. referencesSearch: false,
  60. mendeley: true,
  61. zotero: true,
  62. compileTimeout: 60,
  63. compileGroup: 'standard',
  64. trackChanges: false,
  65. },
  66. personal: {
  67. collaborators: 1,
  68. dropbox: false,
  69. versioning: false,
  70. github: false,
  71. gitBridge: false,
  72. templates: false,
  73. references: false,
  74. referencesSearch: false,
  75. mendeley: false,
  76. zotero: false,
  77. compileTimeout: 60,
  78. compileGroup: 'standard',
  79. trackChanges: false,
  80. },
  81. collaborator: {
  82. collaborators: 10,
  83. dropbox: true,
  84. versioning: true,
  85. github: true,
  86. gitBridge: true,
  87. templates: true,
  88. references: true,
  89. referencesSearch: true,
  90. mendeley: true,
  91. zotero: true,
  92. compileTimeout: 180,
  93. compileGroup: 'priority',
  94. trackChanges: true,
  95. },
  96. professional: {
  97. collaborators: -1,
  98. dropbox: true,
  99. versioning: true,
  100. github: true,
  101. gitBridge: true,
  102. templates: true,
  103. references: true,
  104. referencesSearch: true,
  105. mendeley: true,
  106. zotero: true,
  107. compileTimeout: 180,
  108. compileGroup: 'priority',
  109. trackChanges: true,
  110. },
  111. }),
  112. defaultFeatures: features.personal,
  113. defaultPlanCode: 'personal',
  114. institutionPlanCode: 'professional',
  115. plans: [
  116. {
  117. planCode: 'v1_free',
  118. name: 'V1 Free',
  119. price: 0,
  120. features: features.v1_free,
  121. },
  122. {
  123. planCode: 'personal',
  124. name: 'Personal',
  125. price: 0,
  126. features: features.personal,
  127. },
  128. {
  129. planCode: 'collaborator',
  130. name: 'Collaborator',
  131. price: 1500,
  132. features: features.collaborator,
  133. },
  134. {
  135. planCode: 'professional',
  136. name: 'Professional',
  137. price: 3000,
  138. features: features.professional,
  139. },
  140. ],
  141. bonus_features: {
  142. 1: {
  143. collaborators: 2,
  144. dropbox: false,
  145. versioning: false,
  146. },
  147. 3: {
  148. collaborators: 4,
  149. dropbox: false,
  150. versioning: false,
  151. },
  152. 6: {
  153. collaborators: 4,
  154. dropbox: true,
  155. versioning: true,
  156. },
  157. 9: {
  158. collaborators: -1,
  159. dropbox: true,
  160. versioning: true,
  161. },
  162. },
  163. proxyUrls: {
  164. '/institutions/list': { baseUrl: v1Api.url, path: '/universities/list' },
  165. '/institutions/list/:id': {
  166. baseUrl: v1Api.url,
  167. path(params) {
  168. return `/universities/list/${params.id}`
  169. },
  170. },
  171. '/institutions/domains': {
  172. baseUrl: v1Api.url,
  173. path: '/university/domains',
  174. },
  175. '/proxy/missing/baseUrl': { path: '/foo/bar' },
  176. '/proxy/get_and_post': {
  177. methods: ['get', 'post'],
  178. path: '/destination/get_and_post',
  179. },
  180. },
  181. redirects: {
  182. '/redirect/one': '/destination/one',
  183. '/redirect/get_and_post': {
  184. methods: ['get', 'post'],
  185. url: '/destination/get_and_post',
  186. },
  187. '/redirect/base_url': {
  188. baseUrl: 'https://example.com',
  189. url: '/destination/base_url',
  190. },
  191. '/redirect/params/:id': {
  192. url(params) {
  193. return `/destination/${params.id}/params`
  194. },
  195. },
  196. '/redirect/qs': '/destination/qs',
  197. '/docs_v1': {
  198. url: '/docs',
  199. },
  200. },
  201. oauthProviders: {
  202. provider: {
  203. name: 'provider',
  204. },
  205. collabratec: {
  206. name: 'collabratec',
  207. },
  208. google: {
  209. name: 'google',
  210. },
  211. },
  212. // for testing /user/bonus
  213. social: {
  214. twitter: {
  215. handle: 'overleaf',
  216. },
  217. facebook: {
  218. appId: '400474170024644',
  219. picture: 'https://www.overleaf.com/img/ol-brand/logo-horizontal.png',
  220. redirectUri: 'https://www.overleaf.com',
  221. },
  222. },
  223. overleaf: {
  224. oauth: undefined,
  225. },
  226. saml: undefined,
  227. reconfirmNotificationDays: 14,
  228. unsupportedBrowsers: {
  229. ie: '<=11',
  230. },
  231. // Disable contentful module.
  232. contentful: undefined,
  233. // No email in tests
  234. email: undefined,
  235. test: {
  236. counterInit: 0,
  237. },
  238. })
  239. for (const redisKey of Object.keys(base.redis)) {
  240. base.redis[redisKey].host = process.env.REDIS_HOST || 'localhost'
  241. }