settings.coffee 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  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://dockerhost/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 "dockerhost"
  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'
  84. # The name this is used to describe your ShareLaTeX Installation
  85. appName: process.env["SHARELATEX_APP_NAME"] or "ShareLaTeX (Community Edition)"
  86. # The email address which users will be directed to as the main point of
  87. # contact for this installation of ShareLaTeX.
  88. adminEmail: process.env["SHARELATEX_ADMIN_EMAIL"] or "placeholder@example.com"
  89. # If provided, a sessionSecret is used to sign cookies so that they cannot be
  90. # spoofed. This is recommended.
  91. security:
  92. sessionSecret: "CRYPTO_RANDOM" # This was randomly generated for you
  93. # These credentials are used for authenticating api requests
  94. # between services that may need to go over public channels
  95. httpAuthUsers: httpAuthUsers
  96. # Should javascript assets be served minified or not. Note that you will
  97. # need to run `grunt compile:minify` within the web-sharelatex directory
  98. # to generate these.
  99. useMinifiedJs: true
  100. # Should static assets be sent with a header to tell the browser to cache
  101. # them. This should be false in development where changes are being made,
  102. # but should be set to true in production.
  103. cacheStaticAssets: true
  104. # If you are running ShareLaTeX over https, set this to true to send the
  105. # cookie with a secure flag (recommended).
  106. secureCookie: process.env["SHARELATEX_SECURE_COOKIE"]?
  107. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  108. # then set this to true to allow it to correctly detect the forwarded IP
  109. # address and http/https protocol information.
  110. behindProxy: true
  111. # Sending Email
  112. # -------------
  113. #
  114. # You must configure a mail server to be able to send invite emails from
  115. # ShareLaTeX. The config settings are passed to nodemailer. See the nodemailer
  116. # documentation for available options:
  117. #
  118. # http://www.nodemailer.com/docs/transports
  119. #
  120. # email:
  121. # fromAddress: ""
  122. # replyTo: ""
  123. # transport: "SES"
  124. # parameters:
  125. # AWSAccessKeyID: ""
  126. # AWSSecretKey: ""
  127. # Spell Check Languages
  128. # ---------------------
  129. #
  130. # You must have the corresponding aspell dictionary installed to
  131. # be able to use a language. Run `grunt check:aspell` to check which
  132. # dictionaries you have installed. These should be set for the `code` for
  133. # each language.
  134. languages: [{
  135. "code":"en",
  136. "name":"English (American)"
  137. },{
  138. "code":"en_GB",
  139. "name":"English (British)"
  140. },{
  141. "code":"af",
  142. "name":"Africaans"
  143. },{
  144. "code":"am",
  145. "name":"Amharic"
  146. },{
  147. "code":"ar",
  148. "name":"Arabic"
  149. },{
  150. "code":"hy",
  151. "name":"Armenian"
  152. },{
  153. "code":"gl",
  154. "name":"Galician"
  155. },{
  156. "code":"eu",
  157. "name":"Basque"
  158. },{
  159. "code":"bn",
  160. "name":"Bengali"
  161. },{
  162. "code":"br",
  163. "name":"Breton"
  164. },{
  165. "code":"bg",
  166. "name":"Bulgarian"
  167. },{
  168. "code":"ca",
  169. "name":"Catalan"
  170. },{
  171. "code":"hr",
  172. "name":"Croatian"
  173. },{
  174. "code":"cs",
  175. "name":"Czech"
  176. },{
  177. "code":"da",
  178. "name":"Danish"
  179. },{
  180. "code":"nl",
  181. "name":"Dutch"
  182. },{
  183. "code":"eo",
  184. "name":"Esperanto"
  185. },{
  186. "code":"et",
  187. "name":"Estonian"
  188. },{
  189. "code":"fo",
  190. "name":"Faroese"
  191. },{
  192. "code":"fr",
  193. "name":"French"
  194. },{
  195. "code":"de",
  196. "name":"German"
  197. },{
  198. "code":"el",
  199. "name":"Greek"
  200. },{
  201. "code":"gu",
  202. "name":"Gujarati"
  203. },{
  204. "code":"he",
  205. "name":"Hebrew"
  206. },{
  207. "code":"hi",
  208. "name":"Hindi"
  209. },{
  210. "code":"hu",
  211. "name":"Hungarian"
  212. },{
  213. "code":"is",
  214. "name":"Icelandic"
  215. },{
  216. "code":"id",
  217. "name":"Indonesian"
  218. },{
  219. "code":"ga",
  220. "name":"Irish"
  221. },{
  222. "code":"it",
  223. "name":"Italian"
  224. },{
  225. "code":"kn",
  226. "name":"Kannada"
  227. },{
  228. "code":"kk",
  229. "name":"Kazakh"
  230. },{
  231. "code":"ku",
  232. "name":"Kurdish"
  233. },{
  234. "code":"lv",
  235. "name":"Latvian"
  236. },{
  237. "code":"lt",
  238. "name":"Lithuanian"
  239. },{
  240. "code":"ml",
  241. "name":"Malayalam"
  242. },{
  243. "code":"mr",
  244. "name":"Marathi"
  245. },{
  246. "code":"nr",
  247. "name":"Ndebele"
  248. },{
  249. "code":"ns",
  250. "name":"Northern Sotho"
  251. },{
  252. "code":"no",
  253. "name":"Norwegian"
  254. },{
  255. "code":"or",
  256. "name":"Oriya"
  257. },{
  258. "code":"fa",
  259. "name":"Persian"
  260. },{
  261. "code":"pl",
  262. "name":"Polish"
  263. },{
  264. "code":"pt_BR",
  265. "name":"Portuguese (Brazilian)"
  266. },{
  267. "code":"pt_PT",
  268. "name":"Portuguese (European)"
  269. },{
  270. "code":"pa",
  271. "name":"Punjabi"
  272. },{
  273. "code":"ro",
  274. "name":"Romanian"
  275. },{
  276. "code":"ru",
  277. "name":"Russian"
  278. },{
  279. "code":"sk",
  280. "name":"Slovak"
  281. },{
  282. "code":"sl",
  283. "name":"Slovenian"
  284. },{
  285. "code":"st",
  286. "name":"Southern Sotho"
  287. },{
  288. "code":"es",
  289. "name":"Spanish"
  290. },{
  291. "code":"ss",
  292. "name":"Swazi"
  293. },{
  294. "code":"sv",
  295. "name":"Swedish"
  296. },{
  297. "code":"tl",
  298. "name":"Tagalog"
  299. },{
  300. "code":"ta",
  301. "name":"Tamil"
  302. },{
  303. "code":"te",
  304. "name":"Telugu"
  305. },{
  306. "code":"ts",
  307. "name":"Tsonga"
  308. },{
  309. "code":"tn",
  310. "name":"Tswana"
  311. },{
  312. "code":"uk",
  313. "name":"Ukrainian"
  314. },{
  315. "code":"hsb",
  316. "name":"Upper Sorbian"
  317. },{
  318. "code":"uz",
  319. "name":"Uzbek"
  320. },{
  321. "code":"cy",
  322. "name":"Welsh"
  323. },{
  324. "code":"xh",
  325. "name":"Xhosa"
  326. },{
  327. "code":"zu",
  328. "name":"Zulu"
  329. }
  330. ]
  331. # Service locations
  332. # -----------------
  333. # ShareLaTeX is comprised of many small services, which each expose
  334. # an HTTP API running on a different port. Generally you
  335. # can leave these as they are unless you have some other services
  336. # running which conflict, or want to run the web process on port 80.
  337. # internal:
  338. # web:
  339. # port: webPort = 3000
  340. # host: "localhost"
  341. # documentupdater:
  342. # port: docUpdaterPort = 3003
  343. # host: "localhost"
  344. # filestore:
  345. # port: filestorePort = 3009
  346. # host: "localhost"
  347. # chat:
  348. # port: chatPort = 3010
  349. # host: "localhost"
  350. # tags:
  351. # port: tagsPort = 3012
  352. # host: "localhost"
  353. # clsi:
  354. # port: clsiPort = 3013
  355. # host: "localhost"
  356. # trackchanges:
  357. # port: trackchangesPort = 3015
  358. # host: "localhost"
  359. # docstore:
  360. # port: docstorePort = 3016
  361. # host: "localhost"
  362. # spelling:
  363. # port: spellingPort = 3005
  364. # host: "localhost"
  365. # If you change the above config, or run some services on remote servers,
  366. # you need to tell the other services where to find them:
  367. apis:
  368. web:
  369. url: "http://localhost:3000"
  370. user: httpAuthUser
  371. pass: httpAuthPass
  372. # documentupdater:
  373. # url : "http://localhost:#{docUpdaterPort}"
  374. # clsi:
  375. # url: "http://localhost:#{clsiPort}"
  376. # filestore:
  377. # url: "http://localhost:#{filestorePort}"
  378. # trackchanges:
  379. # url: "http://localhost:#{trackchangesPort}"
  380. # docstore:
  381. # url: "http://localhost:#{docstorePort}"
  382. # tags:
  383. # url: "http://localhost:#{tagsPort}"
  384. # spelling:
  385. # url: "http://localhost:#{spellingPort}"
  386. # chat:
  387. # url: "http://localhost:#{chatPort}"
  388. # With lots of incoming and outgoing HTTP connections to different services,
  389. # sometimes long running, it is a good idea to increase the default number
  390. # of sockets that Node will hold open.
  391. http = require('http')
  392. http.globalAgent.maxSockets = 300
  393. https = require('https')
  394. https.globalAgent.maxSockets = 300