settings.defaults.coffee 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. Path = require('path')
  2. http = require('http')
  3. http.globalAgent.maxSockets = 300
  4. # Make time interval config easier.
  5. seconds = 1000
  6. minutes = 60 * seconds
  7. # These credentials are used for authenticating api requests
  8. # between services that may need to go over public channels
  9. httpAuthUser = "sharelatex"
  10. httpAuthPass = "password"
  11. httpAuthUsers = {}
  12. httpAuthUsers[httpAuthUser] = httpAuthPass
  13. sessionSecret = "secret-please-change"
  14. module.exports = settings =
  15. allowAnonymousReadAndWriteSharing:
  16. process.env['SHARELATEX_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING'] == 'true'
  17. # File storage
  18. # ------------
  19. #
  20. # ShareLaTeX stores binary files like images in S3.
  21. # Fill in your Amazon S3 credential below.
  22. s3:
  23. key: ""
  24. secret: ""
  25. bucketName : ""
  26. # Databases
  27. # ---------
  28. mongo:
  29. url : 'mongodb://127.0.0.1/sharelatex'
  30. redis:
  31. web:
  32. host: "localhost"
  33. port: "6379"
  34. password: ""
  35. # websessions:
  36. # cluster: [
  37. # {host: 'localhost', port: 7000}
  38. # {host: 'localhost', port: 7001}
  39. # {host: 'localhost', port: 7002}
  40. # {host: 'localhost', port: 7003}
  41. # {host: 'localhost', port: 7004}
  42. # {host: 'localhost', port: 7005}
  43. # ]
  44. # ratelimiter:
  45. # cluster: [
  46. # {host: 'localhost', port: 7000}
  47. # {host: 'localhost', port: 7001}
  48. # {host: 'localhost', port: 7002}
  49. # {host: 'localhost', port: 7003}
  50. # {host: 'localhost', port: 7004}
  51. # {host: 'localhost', port: 7005}
  52. # ]
  53. # cooldown:
  54. # cluster: [
  55. # {host: 'localhost', port: 7000}
  56. # {host: 'localhost', port: 7001}
  57. # {host: 'localhost', port: 7002}
  58. # {host: 'localhost', port: 7003}
  59. # {host: 'localhost', port: 7004}
  60. # {host: 'localhost', port: 7005}
  61. # ]
  62. api:
  63. host: "localhost"
  64. port: "6379"
  65. password: ""
  66. # Service locations
  67. # -----------------
  68. # Configure which ports to run each service on. Generally you
  69. # can leave these as they are unless you have some other services
  70. # running which conflict, or want to run the web process on port 80.
  71. internal:
  72. web:
  73. port: webPort = 3000
  74. documentupdater:
  75. port: docUpdaterPort = 3003
  76. # Tell each service where to find the other services. If everything
  77. # is running locally then this is easy, but they exist as separate config
  78. # options incase you want to run some services on remote hosts.
  79. apis:
  80. web:
  81. url: "http://localhost:#{webPort}"
  82. user: httpAuthUser
  83. pass: httpAuthPass
  84. documentupdater:
  85. url : "http://localhost:#{docUpdaterPort}"
  86. thirdPartyDataStore:
  87. url : "http://localhost:3002"
  88. emptyProjectFlushDelayMiliseconds: 5 * seconds
  89. tags:
  90. url :"http://localhost:3012"
  91. spelling:
  92. url : "http://localhost:3005"
  93. trackchanges:
  94. url : "http://localhost:3015"
  95. project_history:
  96. enabled: false
  97. url : "http://localhost:3054"
  98. docstore:
  99. url : "http://localhost:3016"
  100. pubUrl: "http://localhost:3016"
  101. chat:
  102. url: "http://localhost:3010"
  103. internal_url: "http://localhost:3010"
  104. blog:
  105. port: 3008
  106. university:
  107. url: "http://localhost:3011"
  108. filestore:
  109. url: "http://localhost:3009"
  110. clsi:
  111. url: "http://localhost:3013"
  112. templates:
  113. url: "http://localhost:3007"
  114. githubSync:
  115. url: "http://localhost:3022"
  116. recurly:
  117. privateKey: ""
  118. apiKey: ""
  119. subdomain: ""
  120. geoIpLookup:
  121. url: "http://localhost:8080/json"
  122. realTime:
  123. url: "http://localhost:3026"
  124. contacts:
  125. url: "http://localhost:3036"
  126. sixpack:
  127. url: ""
  128. # references:
  129. # url: "http://localhost:3040"
  130. notifications:
  131. url: "http://localhost:3042"
  132. templates:
  133. user_id: process.env.TEMPLATES_USER_ID or "5395eb7aad1f29a88756c7f2"
  134. showSocialButtons: false
  135. showComments: false
  136. # cdn:
  137. # web:
  138. # host:"http://nowhere.sharelatex.dev"
  139. # darkHost:"http://cdn.sharelatex.dev:3000"
  140. # Where your instance of ShareLaTeX can be found publically. Used in emails
  141. # that are sent out, generated links, etc.
  142. siteUrl : siteUrl = 'http://localhost:3000'
  143. # cookie domain
  144. # use full domain for cookies to only be accessible from that domain,
  145. # replace subdomain with dot to have them accessible on all subdomains
  146. # cookieDomain: ".sharelatex.dev"
  147. cookieName:"sharelatex.sid"
  148. # this is only used if cookies are used for clsi backend
  149. #clsiCookieKey: "clsiserver"
  150. # Same, but with http auth credentials.
  151. httpAuthSiteUrl: 'http://#{httpAuthUser}:#{httpAuthPass}@localhost:3000'
  152. maxEntitiesPerProject: 2000
  153. # Security
  154. # --------
  155. security:
  156. sessionSecret: sessionSecret
  157. bcryptRounds: 12 # number of rounds used to hash user passwords (raised to power 2)
  158. httpAuthUsers: httpAuthUsers
  159. # Default features
  160. # ----------------
  161. #
  162. # You can select the features that are enabled by default for new
  163. # new users.
  164. defaultFeatures: defaultFeatures =
  165. collaborators: -1
  166. dropbox: true
  167. versioning: true
  168. compileTimeout: 180
  169. compileGroup: "standard"
  170. references: true
  171. templates: true
  172. trackChanges: true
  173. plans: plans = [{
  174. planCode: "personal"
  175. name: "Personal"
  176. price: 0
  177. features: defaultFeatures
  178. }]
  179. enableSubscriptions:false
  180. # i18n
  181. # ------
  182. #
  183. i18n:
  184. subdomainLang:
  185. www: {lngCode:"en", url: siteUrl}
  186. defaultLng: "en"
  187. # Spelling languages
  188. # ------------------
  189. #
  190. # You must have the corresponding aspell package installed to
  191. # be able to use a language.
  192. languages: [
  193. {name: "English", code: "en"},
  194. {name: "French", code: "fr"}
  195. ]
  196. # Password Settings
  197. # -----------
  198. # These restrict the passwords users can use when registering
  199. # opts are from http://antelle.github.io/passfield
  200. # passwordStrengthOptions:
  201. # pattern: "aA$3"
  202. # length:
  203. # min: 6
  204. # max: 128
  205. # Email support
  206. # -------------
  207. #
  208. # ShareLaTeX uses nodemailer (http://www.nodemailer.com/) to send transactional emails.
  209. # To see the range of transport and options they support, see http://www.nodemailer.com/docs/transports
  210. #email:
  211. # fromAddress: ""
  212. # replyTo: ""
  213. # lifecycle: false
  214. ## Example transport and parameter settings for Amazon SES
  215. # transport: "SES"
  216. # parameters:
  217. # AWSAccessKeyID: ""
  218. # AWSSecretKey: ""
  219. # Third party services
  220. # --------------------
  221. #
  222. # ShareLaTeX's regular newsletter is managed by Markdown mail. Add your
  223. # credentials here to integrate with this.
  224. # markdownmail:
  225. # secret: ""
  226. # list_id: ""
  227. #
  228. # Fill in your unique token from various analytics services to enable
  229. # them.
  230. # analytics:
  231. # ga:
  232. # token: ""
  233. #
  234. # ShareLaTeX's help desk is provided by tenderapp.com
  235. # tenderUrl: ""
  236. #
  237. # Client-side error logging is provided by getsentry.com
  238. # sentry:
  239. # src: ""
  240. # publicDSN: ""
  241. #
  242. # src should be either a remote url like
  243. # //cdn.ravenjs.com/1.1.22/jquery,native/raven.min.js
  244. # or a local file in the js/libs directory.
  245. # The publicDSN is the token for the client-side getSentry service.
  246. # Production Settings
  247. # -------------------
  248. # Should javascript assets be served minified or not. Note that you will
  249. # need to run `grunt compile:minify` within the web-sharelatex directory
  250. # to generate these.
  251. useMinifiedJs: false
  252. # Should static assets be sent with a header to tell the browser to cache
  253. # them.
  254. cacheStaticAssets: false
  255. # If you are running ShareLaTeX over https, set this to true to send the
  256. # cookie with a secure flag (recommended).
  257. secureCookie: false
  258. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  259. # then set this to true to allow it to correctly detect the forwarded IP
  260. # address and http/https protocol information.
  261. behindProxy: false
  262. # Cookie max age (in milliseconds). Set to false for a browser session.
  263. cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
  264. # When true, only allow invites to be sent to email addresses that
  265. # already have user accounts
  266. restrictInvitesToExistingAccounts: false
  267. # Should we allow access to any page without logging in? This includes
  268. # public projects, /learn, /templates, about pages, etc.
  269. allowPublicAccess: if process.env["SHARELATEX_ALLOW_PUBLIC_ACCESS"] == 'true' then true else false
  270. # Use a single compile directory for all users in a project
  271. # (otherwise each user has their own directory)
  272. # disablePerUserCompiles: true
  273. # Maximum size of text documents in the real-time editing system.
  274. max_doc_length: 2 * 1024 * 1024 # 2mb
  275. # Internal configs
  276. # ----------------
  277. path:
  278. # If we ever need to write something to disk (e.g. incoming requests
  279. # that need processing but may be too big for memory, then write
  280. # them to disk here).
  281. dumpFolder: Path.resolve __dirname + "/../data/dumpFolder"
  282. uploadFolder: Path.resolve __dirname + "/../data/uploads"
  283. # Automatic Snapshots
  284. # -------------------
  285. automaticSnapshots:
  286. # How long should we wait after the user last edited to
  287. # take a snapshot?
  288. waitTimeAfterLastEdit: 5 * minutes
  289. # Even if edits are still taking place, this is maximum
  290. # time to wait before taking another snapshot.
  291. maxTimeBetweenSnapshots: 30 * minutes
  292. # Smoke test
  293. # ----------
  294. # Provide log in credentials and a project to be able to run
  295. # some basic smoke tests to check the core functionality.
  296. #
  297. # smokeTest:
  298. # user: ""
  299. # password: ""
  300. # projectId: ""
  301. appName: "ShareLaTeX (Community Edition)"
  302. adminEmail: "placeholder@example.com"
  303. brandPrefix: "" # Set to 'ol-' for overleaf styles
  304. nav:
  305. title: "ShareLaTeX Community Edition"
  306. left_footer: [{
  307. text: "Powered by <a href='https://www.sharelatex.com'>ShareLaTeX</a> © 2016"
  308. }]
  309. right_footer: [{
  310. text: "<i class='fa fa-github-square'></i> Fork on Github!"
  311. url: "https://github.com/sharelatex/sharelatex"
  312. }]
  313. showSubscriptionLink: false
  314. header_extras: []
  315. # Example:
  316. # header_extras: [{text: "Some Page", url: "http://example.com/some/page", class: "subdued"}]
  317. customisation: {}
  318. # templates: [{
  319. # name : "cv_or_resume",
  320. # url : "/templates/cv"
  321. # }, {
  322. # name : "cover_letter",
  323. # url : "/templates/cover-letters"
  324. # }, {
  325. # name : "journal_article",
  326. # url : "/templates/journals"
  327. # }, {
  328. # name : "presentation",
  329. # url : "/templates/presentations"
  330. # }, {
  331. # name : "thesis",
  332. # url : "/templates/thesis"
  333. # }, {
  334. # name : "bibliographies",
  335. # url : "/templates/bibliographies"
  336. # }, {
  337. # name : "view_all",
  338. # url : "/templates"
  339. # }]
  340. redirects:
  341. "/templates/index": "/templates/"
  342. proxyUrls: {}
  343. reloadModuleViewsOnEachRequest: true
  344. domainLicences: [
  345. ]
  346. sixpack:
  347. domain:""
  348. # ShareLaTeX Server Pro options (https://www.sharelatex.com/university/onsite.html)
  349. # ----------
  350. # LDAP
  351. # ----------
  352. # Settings below use a working LDAP test server kindly provided by forumsys.com
  353. # When testing with forumsys.com use username = einstein and password = password
  354. # ldap :
  355. # host: 'ldap://ldap.forumsys.com'
  356. # dn: 'uid=:userKey,dc=example,dc=com'
  357. # baseSearch: 'dc=example,dc=com'
  358. # filter: "(uid=:userKey)"
  359. # failMessage: 'LDAP User Fail'
  360. # fieldName: 'LDAP User'
  361. # placeholder: 'email@example.com'
  362. # emailAtt: 'mail'
  363. # anonymous: false
  364. # adminDN: 'cn=read-only-admin,dc=example,dc=com'
  365. # adminPW: 'password'
  366. # starttls: true
  367. # tlsOptions:
  368. # rejectUnauthorized: false
  369. # ca: ['/etc/ldap/ca_certs.pem']
  370. #templateLinks: [{
  371. # name : "CV projects",
  372. # url : "/templates/cv"
  373. #},{
  374. # name : "all projects",
  375. # url: "/templates/all"
  376. #}]
  377. rateLimits:
  378. autoCompile:
  379. everyone: 100
  380. standard: 25