settings.coffee 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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 : '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:
  27. host: "localhost"
  28. port: "6379"
  29. password: ""
  30. # The compile server (the clsi) uses a SQL database to cache files and
  31. # meta-data. sqllite is the default, and the load is low enough that this will
  32. # be fine in production (we use sqllite at sharelatex.com).
  33. #
  34. # If you want to configure a different database, see the Sequelize documentation
  35. # for available options:
  36. #
  37. # https://github.com/sequelize/sequelize/wiki/API-Reference-Sequelize#example-usage
  38. #
  39. mysql:
  40. clsi:
  41. database: "clsi"
  42. username: "clsi"
  43. password: ""
  44. dialect: "sqlite"
  45. storage: Path.join(DATA_DIR, "db.sqlite")
  46. # File storage
  47. # ------------
  48. # ShareLaTeX can store binary files like images either locally or in Amazon
  49. # S3. The default is locally:
  50. filestore:
  51. backend: "fs"
  52. stores:
  53. user_files: Path.join(DATA_DIR, "user_files")
  54. # To use Amazon S3 as a storage backend, comment out the above config, and
  55. # uncomment the following, filling in your key, secret, and bucket name:
  56. #
  57. # filestore:
  58. # backend: "s3"
  59. # stores:
  60. # user_files: "BUCKET_NAME"
  61. # s3:
  62. # key: "AWS_KEY"
  63. # secret: "AWS_SECRET"
  64. #
  65. # Local disk caching
  66. # ------------------
  67. path:
  68. # If we ever need to write something to disk (e.g. incoming requests
  69. # that need processing but may be too big for memory), then write
  70. # them to disk here:
  71. dumpFolder: Path.join(TMP_DIR, "dumpFolder")
  72. # Where to write uploads before they are processed
  73. uploadFolder: Path.join(TMP_DIR, "uploads")
  74. # Where to write the project to disk before running LaTeX on it
  75. compilesDir: Path.join(DATA_DIR, "compiles")
  76. # Where to cache downloaded URLs for the CLSI
  77. clsiCacheDir: Path.join(DATA_DIR, "cache")
  78. # Server Config
  79. # -------------
  80. # Where your instance of ShareLaTeX can be found publicly. This is used
  81. # when emails are sent out and in generated links:
  82. siteUrl : 'http://localhost:3000'
  83. # If provided, a sessionSecret is used to sign cookies so that they cannot be
  84. # spoofed. This is recommended.
  85. security:
  86. sessionSecret: "CRYPTO_RANDOM" # This was randomly generated for you
  87. # These credentials are used for authenticating api requests
  88. # between services that may need to go over public channels
  89. httpAuthUsers: httpAuthUsers
  90. # Should javascript assets be served minified or not. Note that you will
  91. # need to run `grunt compile:minify` within the web-sharelatex directory
  92. # to generate these.
  93. useMinifiedJs: false
  94. # Should static assets be sent with a header to tell the browser to cache
  95. # them. This should be false in development where changes are being made,
  96. # but should be set to true in production.
  97. cacheStaticAssets: false
  98. # If you are running ShareLaTeX over https, set this to true to send the
  99. # cookie with a secure flag (recommended).
  100. secureCookie: false
  101. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  102. # then set this to true to allow it to correctly detect the forwarded IP
  103. # address and http/https protocol information.
  104. behindProxy: false
  105. # Sending Email
  106. # -------------
  107. #
  108. # You must configure a mail server to be able to send invite emails from
  109. # ShareLaTeX. The config settings are passed to nodemailer. See the nodemailer
  110. # documentation for available options:
  111. #
  112. # http://www.nodemailer.com/docs/transports
  113. #
  114. # email:
  115. # fromAddress: ""
  116. # replyTo: ""
  117. # transport: "SES"
  118. # parameters:
  119. # AWSAccessKeyID: ""
  120. # AWSSecretKey: ""
  121. # Spell Check Languages
  122. # ---------------------
  123. #
  124. # You must have the corresponding aspell dictionary installed to
  125. # be able to use a language. Run `grunt check:aspell` to check which
  126. # dictionaries you have installed. These should be set for the `code` for
  127. # each language.
  128. languages: [
  129. {name: "English", code: "en"}
  130. ]
  131. # Service locations
  132. # -----------------
  133. # ShareLaTeX is comprised of many small services, which each expose
  134. # an HTTP API running on a different port. Generally you
  135. # can leave these as they are unless you have some other services
  136. # running which conflict, or want to run the web process on port 80.
  137. # internal:
  138. # web:
  139. # port: webPort = 3000
  140. # host: "localhost"
  141. # documentupdater:
  142. # port: docUpdaterPort = 3003
  143. # host: "localhost"
  144. # filestore:
  145. # port: filestorePort = 3009
  146. # host: "localhost"
  147. # chat:
  148. # port: chatPort = 3010
  149. # host: "localhost"
  150. # tags:
  151. # port: tagsPort = 3012
  152. # host: "localhost"
  153. # clsi:
  154. # port: clsiPort = 3013
  155. # host: "localhost"
  156. # trackchanges:
  157. # port: trackchangesPort = 3015
  158. # host: "localhost"
  159. # docstore:
  160. # port: docstorePort = 3016
  161. # host: "localhost"
  162. # spelling:
  163. # port: spellingPort = 3005
  164. # host: "localhost"
  165. # If you change the above config, or run some services on remote servers,
  166. # you need to tell the other services where to find them:
  167. apis:
  168. web:
  169. url: "http://localhost:3000"
  170. user: httpAuthUser
  171. pass: httpAuthPass
  172. # documentupdater:
  173. # url : "http://localhost:#{docUpdaterPort}"
  174. # clsi:
  175. # url: "http://localhost:#{clsiPort}"
  176. # filestore:
  177. # url: "http://localhost:#{filestorePort}"
  178. # trackchanges:
  179. # url: "http://localhost:#{trackchangesPort}"
  180. # docstore:
  181. # url: "http://localhost:#{docstorePort}"
  182. # tags:
  183. # url: "http://localhost:#{tagsPort}"
  184. # spelling:
  185. # url: "http://localhost:#{spellingPort}"
  186. # chat:
  187. # url: "http://localhost:#{chatPort}"
  188. # With lots of incoming and outgoing HTTP connections to different services,
  189. # sometimes long running, it is a good idea to increase the default number
  190. # of sockets that Node will hold open.
  191. http = require('http')
  192. http.globalAgent.maxSockets = 300
  193. https = require('https')
  194. https.globalAgent.maxSockets = 300