settings.test.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. },
  32. },
  33. // for registration via SL, set enableLegacyRegistration to true
  34. // for registration via Overleaf v1, set enableLegacyLogin to true
  35. // Currently, acceptance tests require enableLegacyRegistration.
  36. enableLegacyRegistration: true,
  37. features: (features = {
  38. v1_free: {
  39. collaborators: 1,
  40. dropbox: false,
  41. versioning: false,
  42. github: true,
  43. gitBridge: true,
  44. templates: false,
  45. references: false,
  46. referencesSearch: false,
  47. mendeley: true,
  48. compileTimeout: 60,
  49. compileGroup: 'standard',
  50. trackChanges: false,
  51. },
  52. personal: {
  53. collaborators: 1,
  54. dropbox: false,
  55. versioning: false,
  56. github: false,
  57. gitBridge: false,
  58. templates: false,
  59. references: false,
  60. referencesSearch: false,
  61. mendeley: false,
  62. compileTimeout: 60,
  63. compileGroup: 'standard',
  64. trackChanges: 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. compileTimeout: 180,
  77. compileGroup: 'priority',
  78. trackChanges: true,
  79. },
  80. professional: {
  81. collaborators: -1,
  82. dropbox: true,
  83. versioning: true,
  84. github: true,
  85. gitBridge: true,
  86. templates: true,
  87. references: true,
  88. referencesSearch: true,
  89. mendeley: true,
  90. compileTimeout: 180,
  91. compileGroup: 'priority',
  92. trackChanges: true,
  93. },
  94. }),
  95. defaultFeatures: features.personal,
  96. defaultPlanCode: 'personal',
  97. institutionPlanCode: 'professional',
  98. plans: [
  99. {
  100. planCode: 'v1_free',
  101. name: 'V1 Free',
  102. price: 0,
  103. features: features.v1_free,
  104. },
  105. {
  106. planCode: 'personal',
  107. name: 'Personal',
  108. price: 0,
  109. features: features.personal,
  110. },
  111. {
  112. planCode: 'collaborator',
  113. name: 'Collaborator',
  114. price: 1500,
  115. features: features.collaborator,
  116. },
  117. {
  118. planCode: 'professional',
  119. name: 'Professional',
  120. price: 3000,
  121. features: features.professional,
  122. },
  123. ],
  124. bonus_features: {
  125. 1: {
  126. collaborators: 2,
  127. dropbox: false,
  128. versioning: false,
  129. },
  130. 3: {
  131. collaborators: 4,
  132. dropbox: false,
  133. versioning: false,
  134. },
  135. 6: {
  136. collaborators: 4,
  137. dropbox: true,
  138. versioning: true,
  139. },
  140. 9: {
  141. collaborators: -1,
  142. dropbox: true,
  143. versioning: true,
  144. },
  145. },
  146. proxyUrls: {
  147. '/institutions/list': { baseUrl: v1Api.url, path: '/universities/list' },
  148. '/institutions/list/:id': {
  149. baseUrl: v1Api.url,
  150. path(params) {
  151. return `/universities/list/${params.id}`
  152. },
  153. },
  154. '/institutions/domains': {
  155. baseUrl: v1Api.url,
  156. path: '/university/domains',
  157. },
  158. '/proxy/missing/baseUrl': { path: '/foo/bar' },
  159. '/proxy/get_and_post': {
  160. methods: ['get', 'post'],
  161. path: '/destination/get_and_post',
  162. },
  163. },
  164. redirects: {
  165. '/redirect/one': '/destination/one',
  166. '/redirect/get_and_post': {
  167. methods: ['get', 'post'],
  168. url: '/destination/get_and_post',
  169. },
  170. '/redirect/base_url': {
  171. baseUrl: 'https://example.com',
  172. url: '/destination/base_url',
  173. },
  174. '/redirect/params/:id': {
  175. url(params) {
  176. return `/destination/${params.id}/params`
  177. },
  178. },
  179. '/redirect/qs': '/destination/qs',
  180. '/docs_v1': {
  181. url: '/docs',
  182. },
  183. },
  184. oauthProviders: {
  185. provider: {
  186. name: 'provider',
  187. },
  188. collabratec: {
  189. name: 'collabratec',
  190. },
  191. google: {
  192. name: 'google',
  193. },
  194. },
  195. // for testing /user/bonus
  196. social: {
  197. twitter: {
  198. handle: 'overleaf',
  199. },
  200. facebook: {
  201. appId: '400474170024644',
  202. picture: 'https://www.overleaf.com/img/ol-brand/logo-horizontal.png',
  203. redirectUri: 'https://www.overleaf.com',
  204. },
  205. },
  206. // setting to true since many features are enabled/disabled after availability of this
  207. // property (check Features.js)
  208. overleaf: true,
  209. reconfirmNotificationDays: 14,
  210. unsupportedBrowsers: {
  211. ie: '<=11',
  212. },
  213. test: {
  214. counterInit: 0,
  215. },
  216. }