settings.test.js 4.9 KB

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