settings.defaults.coffee 13 KB

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