settings.coffee 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. Path = require('path')
  2. # These credentials are used for authenticating api requests
  3. # between services that may need to go over public channels
  4. httpAuthUser = "sharelatex"
  5. httpAuthPass = "CRYPTO_RANDOM" # Randomly generated for you
  6. httpAuthUsers = {}
  7. httpAuthUsers[httpAuthUser] = httpAuthPass
  8. DATA_DIR = '/var/lib/sharelatex/data'
  9. TMP_DIR = '/var/lib/sharelatex/tmp'
  10. module.exports =
  11. # Databases
  12. # ---------
  13. # ShareLaTeX's main persistant data store is MongoDB (http://www.mongodb.org/)
  14. # Documentation about the URL connection string format can be found at:
  15. #
  16. # http://docs.mongodb.org/manual/reference/connection-string/
  17. #
  18. # The following works out of the box with Mongo's default settings:
  19. mongo:
  20. url : process.env["SHARELATEX_MONGO_URL"] or 'mongodb://127.0.0.1/sharelatex'
  21. # Redis is used in ShareLaTeX for high volume queries, like real-time
  22. # editing, and session management.
  23. #
  24. # The following config will work with Redis's default settings:
  25. redis:
  26. web: redisConfig =
  27. host: process.env["SHARELATEX_REDIS_HOST"] or "localhost"
  28. port: process.env["SHARELATEX_REDIS_PORT"] or "6379"
  29. password: process.env["SHARELATEX_REDIS_PASS"] or ""
  30. fairy: redisConfig
  31. # The compile server (the clsi) uses a SQL database to cache files and
  32. # meta-data. sqllite is the default, and the load is low enough that this will
  33. # be fine in production (we use sqllite at sharelatex.com).
  34. #
  35. # If you want to configure a different database, see the Sequelize documentation
  36. # for available options:
  37. #
  38. # https://github.com/sequelize/sequelize/wiki/API-Reference-Sequelize#example-usage
  39. #
  40. mysql:
  41. clsi:
  42. database: "clsi"
  43. username: "clsi"
  44. password: ""
  45. dialect: "sqlite"
  46. storage: Path.join(DATA_DIR, "db.sqlite")
  47. # File storage
  48. # ------------
  49. # ShareLaTeX can store binary files like images either locally or in Amazon
  50. # S3. The default is locally:
  51. filestore:
  52. backend: "fs"
  53. stores:
  54. user_files: Path.join(DATA_DIR, "user_files")
  55. # To use Amazon S3 as a storage backend, comment out the above config, and
  56. # uncomment the following, filling in your key, secret, and bucket name:
  57. #
  58. # filestore:
  59. # backend: "s3"
  60. # stores:
  61. # user_files: "BUCKET_NAME"
  62. # s3:
  63. # key: "AWS_KEY"
  64. # secret: "AWS_SECRET"
  65. #
  66. # Local disk caching
  67. # ------------------
  68. path:
  69. # If we ever need to write something to disk (e.g. incoming requests
  70. # that need processing but may be too big for memory), then write
  71. # them to disk here:
  72. dumpFolder: Path.join(TMP_DIR, "dumpFolder")
  73. # Where to write uploads before they are processed
  74. uploadFolder: Path.join(TMP_DIR, "uploads")
  75. # Where to write the project to disk before running LaTeX on it
  76. compilesDir: Path.join(DATA_DIR, "compiles")
  77. # Where to cache downloaded URLs for the CLSI
  78. clsiCacheDir: Path.join(DATA_DIR, "cache")
  79. # Server Config
  80. # -------------
  81. # Where your instance of ShareLaTeX can be found publicly. This is used
  82. # when emails are sent out and in generated links:
  83. siteUrl: siteUrl = process.env["SHARELATEX_SITE_URL"] or 'http://localhost:3000'
  84. # The websocket layer of ShareLaTeX runs as separate service.
  85. # When running locally or in development, you can point the client to this
  86. # service directly. If you are running behind a reverse proxy (Nginx, etc)
  87. # then websocketsUrl should be the same as siteUrl, with your reverse
  88. # proxy responible for sending websocket traffic to the websocket service
  89. # rather than connecting directly.
  90. websocketsUrl: siteUrl
  91. # If provided, a sessionSecret is used to sign cookies so that they cannot be
  92. # spoofed. This is recommended.
  93. security:
  94. sessionSecret: "CRYPTO_RANDOM" # This was randomly generated for you
  95. # These credentials are used for authenticating api requests
  96. # between services that may need to go over public channels
  97. httpAuthUsers: httpAuthUsers
  98. # Should javascript assets be served minified or not. Note that you will
  99. # need to run `grunt compile:minify` within the web-sharelatex directory
  100. # to generate these.
  101. useMinifiedJs: true
  102. # Should static assets be sent with a header to tell the browser to cache
  103. # them. This should be false in development where changes are being made,
  104. # but should be set to true in production.
  105. cacheStaticAssets: true
  106. # If you are running ShareLaTeX over https, set this to true to send the
  107. # cookie with a secure flag (recommended).
  108. secureCookie: process.env["SHARELATEX_SECURE_COOKIE"]?
  109. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  110. # then set this to true to allow it to correctly detect the forwarded IP
  111. # address and http/https protocol information.
  112. behindProxy: true
  113. # Sending Email
  114. # -------------
  115. #
  116. # You must configure a mail server to be able to send invite emails from
  117. # ShareLaTeX. The config settings are passed to nodemailer. See the nodemailer
  118. # documentation for available options:
  119. #
  120. # http://www.nodemailer.com/docs/transports
  121. #
  122. # email:
  123. # fromAddress: ""
  124. # replyTo: ""
  125. # transport: "SES"
  126. # parameters:
  127. # AWSAccessKeyID: ""
  128. # AWSSecretKey: ""
  129. # Spell Check Languages
  130. # ---------------------
  131. #
  132. # You must have the corresponding aspell dictionary installed to
  133. # be able to use a language. Run `grunt check:aspell` to check which
  134. # dictionaries you have installed. These should be set for the `code` for
  135. # each language.
  136. languages: [{
  137. "code":"en",
  138. "name":"English (American)"
  139. },{
  140. "code":"en_GB",
  141. "name":"English (British)"
  142. },{
  143. "code":"af",
  144. "name":"Africaans"
  145. },{
  146. "code":"am",
  147. "name":"Amharic"
  148. },{
  149. "code":"ar",
  150. "name":"Arabic"
  151. },{
  152. "code":"hy",
  153. "name":"Armenian"
  154. },{
  155. "code":"gl",
  156. "name":"Galician"
  157. },{
  158. "code":"eu",
  159. "name":"Basque"
  160. },{
  161. "code":"bn",
  162. "name":"Bengali"
  163. },{
  164. "code":"br",
  165. "name":"Breton"
  166. },{
  167. "code":"bg",
  168. "name":"Bulgarian"
  169. },{
  170. "code":"ca",
  171. "name":"Catalan"
  172. },{
  173. "code":"hr",
  174. "name":"Croatian"
  175. },{
  176. "code":"cs",
  177. "name":"Czech"
  178. },{
  179. "code":"da",
  180. "name":"Danish"
  181. },{
  182. "code":"nl",
  183. "name":"Dutch"
  184. },{
  185. "code":"eo",
  186. "name":"Esperanto"
  187. },{
  188. "code":"et",
  189. "name":"Estonian"
  190. },{
  191. "code":"fo",
  192. "name":"Faroese"
  193. },{
  194. "code":"fr",
  195. "name":"French"
  196. },{
  197. "code":"de",
  198. "name":"German"
  199. },{
  200. "code":"el",
  201. "name":"Greek"
  202. },{
  203. "code":"gu",
  204. "name":"Gujarati"
  205. },{
  206. "code":"he",
  207. "name":"Hebrew"
  208. },{
  209. "code":"hi",
  210. "name":"Hindi"
  211. },{
  212. "code":"hu",
  213. "name":"Hungarian"
  214. },{
  215. "code":"is",
  216. "name":"Icelandic"
  217. },{
  218. "code":"id",
  219. "name":"Indonesian"
  220. },{
  221. "code":"ga",
  222. "name":"Irish"
  223. },{
  224. "code":"it",
  225. "name":"Italian"
  226. },{
  227. "code":"kn",
  228. "name":"Kannada"
  229. },{
  230. "code":"kk",
  231. "name":"Kazakh"
  232. },{
  233. "code":"ku",
  234. "name":"Kurdish"
  235. },{
  236. "code":"lv",
  237. "name":"Latvian"
  238. },{
  239. "code":"lt",
  240. "name":"Lithuanian"
  241. },{
  242. "code":"ml",
  243. "name":"Malayalam"
  244. },{
  245. "code":"mr",
  246. "name":"Marathi"
  247. },{
  248. "code":"nr",
  249. "name":"Ndebele"
  250. },{
  251. "code":"ns",
  252. "name":"Northern Sotho"
  253. },{
  254. "code":"no",
  255. "name":"Norwegian"
  256. },{
  257. "code":"or",
  258. "name":"Oriya"
  259. },{
  260. "code":"fa",
  261. "name":"Persian"
  262. },{
  263. "code":"pl",
  264. "name":"Polish"
  265. },{
  266. "code":"pt_BR",
  267. "name":"Portuguese (Brazilian)"
  268. },{
  269. "code":"pt_PT",
  270. "name":"Portuguese (European)"
  271. },{
  272. "code":"pa",
  273. "name":"Punjabi"
  274. },{
  275. "code":"ro",
  276. "name":"Romanian"
  277. },{
  278. "code":"ru",
  279. "name":"Russian"
  280. },{
  281. "code":"sk",
  282. "name":"Slovak"
  283. },{
  284. "code":"sl",
  285. "name":"Slovenian"
  286. },{
  287. "code":"st",
  288. "name":"Southern Sotho"
  289. },{
  290. "code":"es",
  291. "name":"Spanish"
  292. },{
  293. "code":"ss",
  294. "name":"Swazi"
  295. },{
  296. "code":"sv",
  297. "name":"Swedish"
  298. },{
  299. "code":"tl",
  300. "name":"Tagalog"
  301. },{
  302. "code":"ta",
  303. "name":"Tamil"
  304. },{
  305. "code":"te",
  306. "name":"Telugu"
  307. },{
  308. "code":"ts",
  309. "name":"Tsonga"
  310. },{
  311. "code":"tn",
  312. "name":"Tswana"
  313. },{
  314. "code":"uk",
  315. "name":"Ukrainian"
  316. },{
  317. "code":"hsb",
  318. "name":"Upper Sorbian"
  319. },{
  320. "code":"uz",
  321. "name":"Uzbek"
  322. },{
  323. "code":"cy",
  324. "name":"Welsh"
  325. },{
  326. "code":"xh",
  327. "name":"Xhosa"
  328. },{
  329. "code":"zu",
  330. "name":"Zulu"
  331. }
  332. ]
  333. # Service locations
  334. # -----------------
  335. # ShareLaTeX is comprised of many small services, which each expose
  336. # an HTTP API running on a different port. Generally you
  337. # can leave these as they are unless you have some other services
  338. # running which conflict, or want to run the web process on port 80.
  339. # internal:
  340. # web:
  341. # port: webPort = 3000
  342. # host: "localhost"
  343. # documentupdater:
  344. # port: docUpdaterPort = 3003
  345. # host: "localhost"
  346. # filestore:
  347. # port: filestorePort = 3009
  348. # host: "localhost"
  349. # chat:
  350. # port: chatPort = 3010
  351. # host: "localhost"
  352. # tags:
  353. # port: tagsPort = 3012
  354. # host: "localhost"
  355. # clsi:
  356. # port: clsiPort = 3013
  357. # host: "localhost"
  358. # trackchanges:
  359. # port: trackchangesPort = 3015
  360. # host: "localhost"
  361. # docstore:
  362. # port: docstorePort = 3016
  363. # host: "localhost"
  364. # spelling:
  365. # port: spellingPort = 3005
  366. # host: "localhost"
  367. # If you change the above config, or run some services on remote servers,
  368. # you need to tell the other services where to find them:
  369. apis:
  370. web:
  371. url: "http://localhost:3000"
  372. user: httpAuthUser
  373. pass: httpAuthPass
  374. # documentupdater:
  375. # url : "http://localhost:#{docUpdaterPort}"
  376. # clsi:
  377. # url: "http://localhost:#{clsiPort}"
  378. # filestore:
  379. # url: "http://localhost:#{filestorePort}"
  380. # trackchanges:
  381. # url: "http://localhost:#{trackchangesPort}"
  382. # docstore:
  383. # url: "http://localhost:#{docstorePort}"
  384. # tags:
  385. # url: "http://localhost:#{tagsPort}"
  386. # spelling:
  387. # url: "http://localhost:#{spellingPort}"
  388. # chat:
  389. # url: "http://localhost:#{chatPort}"
  390. # With lots of incoming and outgoing HTTP connections to different services,
  391. # sometimes long running, it is a good idea to increase the default number
  392. # of sockets that Node will hold open.
  393. http = require('http')
  394. http.globalAgent.maxSockets = 300
  395. https = require('https')
  396. https.globalAgent.maxSockets = 300