settings.defaults.coffee 13 KB

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