settings.defaults.coffee 11 KB

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