settings.defaults.coffee 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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 = process.env['WEB_API_USER'] or "sharelatex"
  10. httpAuthPass = process.env['WEB_API_PASSWORD'] or "password"
  11. httpAuthUsers = {}
  12. httpAuthUsers[httpAuthUser] = httpAuthPass
  13. sessionSecret = process.env['SESSION_SECRET'] or "secret-please-change"
  14. v1Api =
  15. url: process.env['V1_API_URL'] or "http://#{process.env['V1_HOST'] or 'localhost'}:5000"
  16. user: process.env['V1_API_USER'] or 'overleaf'
  17. pass: process.env['V1_API_PASSWORD'] or '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_CONNECTION_STRING'] || 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: process.env["REDIS_PASSWORD"] or ""
  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: process.env["REDIS_PASSWORD"] or ""
  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 = process.env['WEB_PORT'] or 3000
  78. host: process.env['LISTEN_ADDRESS'] or 'localhost'
  79. documentupdater:
  80. port: docUpdaterPort = 3003
  81. gitBridgePublicBaseUrl: "http://#{process.env['GIT_BRIDGE_HOST'] || 'localhost'}:8000"
  82. # Tell each service where to find the other services. If everything
  83. # is running locally then this is easy, but they exist as separate config
  84. # options incase you want to run some services on remote hosts.
  85. apis:
  86. web:
  87. url: "http://#{process.env['WEB_API_HOST'] or process.env['WEB_HOST'] or "localhost"}:#{process.env['WEB_API_PORT'] or process.env['WEB_PORT'] or 3000}"
  88. user: httpAuthUser
  89. pass: httpAuthPass
  90. documentupdater:
  91. url : "http://#{process.env['DOCUPDATER_HOST'] or process.env['DOCUMENT_UPDATER_HOST'] or 'localhost'}:#{docUpdaterPort}"
  92. thirdPartyDataStore:
  93. url : "http://#{process.env['TPDS_HOST'] or 'localhost'}:3002"
  94. emptyProjectFlushDelayMiliseconds: 5 * seconds
  95. dropboxApp: process.env['TPDS_DROPBOX_APP']
  96. tags:
  97. url :"http://#{process.env['TAGS_HOST'] or 'localhost'}:3012"
  98. spelling:
  99. url : "http://#{process.env['SPELLING_HOST'] or 'localhost'}:3005"
  100. trackchanges:
  101. url : "http://#{process.env['TRACK_CHANGES_HOST'] or 'localhost'}:3015"
  102. project_history:
  103. sendProjectStructureOps: process.env.PROJECT_HISTORY_ENABLED == 'true' or false
  104. initializeHistoryForNewProjects: process.env.PROJECT_HISTORY_ENABLED == 'true' or false
  105. displayHistoryForNewProjects: process.env.PROJECT_HISTORY_ENABLED == 'true' or false
  106. url : "http://#{process.env['PROJECT_HISTORY_HOST'] or 'localhost'}:3054"
  107. docstore:
  108. url : "http://#{process.env['DOCSTORE_HOST'] or 'localhost'}:3016"
  109. pubUrl: "http://#{process.env['DOCSTORE_HOST'] or 'localhost'}:3016"
  110. chat:
  111. url: "http://#{process.env['CHAT_HOST'] or 'localhost'}:3010"
  112. internal_url: "http://#{process.env['CHAT_HOST'] or 'localhost'}:3010"
  113. blog:
  114. url: "http://localhost:3008"
  115. port: 3008
  116. university:
  117. url: "http://localhost:3011"
  118. filestore:
  119. url: "http://#{process.env['FILESTORE_HOST'] or 'localhost'}:3009"
  120. clsi:
  121. url: "http://#{process.env['CLSI_HOST'] or 'localhost'}:3013"
  122. # url: "http://#{process.env['CLSI_LB_HOST']}:3014"
  123. backendGroupName: undefined
  124. templates:
  125. url: "http://#{process.env['TEMPLATES_HOST'] or 'localhost'}:3007"
  126. githubSync:
  127. url: "http://#{process.env['GITHUB_SYNC_HOST'] or 'localhost'}:3022"
  128. recurly:
  129. privateKey: process.env['RECURLY_PRIVATE_KEY'] or ''
  130. apiKey: process.env['RECURLY_API_KEY'] or ''
  131. subdomain: process.env['RECURLY_SUBDOMAIN'] or ''
  132. publicKey: process.env['RECURLY_PUBLIC_KEY'] or ''
  133. geoIpLookup:
  134. url: "http://#{process.env['GEOIP_HOST'] or process.env['FREEGEOIP_HOST'] or 'localhost'}:8080/json/"
  135. realTime:
  136. url: "http://#{process.env['REALTIME_HOST'] or 'localhost'}:3026"
  137. contacts:
  138. url: "http://#{process.env['CONTACTS_HOST'] or 'localhost'}:3036"
  139. sixpack:
  140. url: ""
  141. references:
  142. url: "http://#{process.env['REFERENCES_HOST'] or 'localhost'}:3040"
  143. notifications:
  144. url: "http://#{process.env['NOTIFICATIONS_HOST'] or 'localhost'}:3042"
  145. analytics:
  146. url: "http://#{process.env['ANALYTICS_HOST'] or 'localhost'}:3050"
  147. linkedUrlProxy:
  148. url: process.env['LINKED_URL_PROXY']
  149. thirdpartyreferences:
  150. url: "http://#{process.env['THIRD_PARTY_REFERENCES_HOST'] or 'localhost'}:3046"
  151. v1:
  152. url: v1Api.url
  153. user: v1Api.user
  154. pass: v1Api.pass
  155. v1_history:
  156. url: "http://#{process.env['V1_HISTORY_HOST'] or "localhost"}:3100/api"
  157. user: 'staging'
  158. pass: 'password'
  159. templates:
  160. user_id: process.env.TEMPLATES_USER_ID or "5395eb7aad1f29a88756c7f2"
  161. showSocialButtons: false
  162. showComments: false
  163. # cdn:
  164. # web:
  165. # host:"http://nowhere.sharelatex.dev"
  166. # darkHost:"http://cdn.sharelatex.dev:3000"
  167. # Where your instance of ShareLaTeX can be found publically. Used in emails
  168. # that are sent out, generated links, etc.
  169. siteUrl : siteUrl = process.env['PUBLIC_URL'] or 'http://localhost:3000'
  170. # Used to close the editor off to users
  171. editorIsOpen: process.env['EDITOR_IS_OPEN'] or true
  172. # Optional separate location for websocket connections, if unset defaults to siteUrl.
  173. wsUrl: process.env['WEBSOCKET_URL']
  174. # cookie domain
  175. # use full domain for cookies to only be accessible from that domain,
  176. # replace subdomain with dot to have them accessible on all subdomains
  177. cookieDomain: process.env['COOKIE_DOMAIN']
  178. cookieName: process.env['COOKIE_NAME'] or "sharelatex.sid"
  179. # this is only used if cookies are used for clsi backend
  180. #clsiCookieKey: "clsiserver"
  181. # Same, but with http auth credentials.
  182. httpAuthSiteUrl: 'http://#{httpAuthUser}:#{httpAuthPass}@#{siteUrl}'
  183. maxEntitiesPerProject: 2000
  184. # Security
  185. # --------
  186. security:
  187. sessionSecret: sessionSecret
  188. bcryptRounds: 12 # number of rounds used to hash user passwords (raised to power 2)
  189. httpAuthUsers: httpAuthUsers
  190. # Default features
  191. # ----------------
  192. #
  193. # You can select the features that are enabled by default for new
  194. # new users.
  195. defaultFeatures: defaultFeatures =
  196. collaborators: -1
  197. dropbox: true
  198. github: true
  199. gitBridge: true
  200. versioning: true
  201. compileTimeout: 180
  202. compileGroup: "standard"
  203. references: true
  204. templates: true
  205. trackChanges: true
  206. features:
  207. personal: defaultFeatures
  208. plans: plans = [{
  209. planCode: "personal"
  210. name: "Personal"
  211. price: 0
  212. features: defaultFeatures
  213. }]
  214. enableSubscriptions:false
  215. enabledLinkedFileTypes: (process.env['ENABLED_LINKED_FILE_TYPES'] or '').split(',')
  216. # i18n
  217. # ------
  218. #
  219. i18n:
  220. subdomainLang:
  221. www: {lngCode:"en", url: siteUrl}
  222. defaultLng: "en"
  223. # Spelling languages
  224. # ------------------
  225. #
  226. # You must have the corresponding aspell package installed to
  227. # be able to use a language.
  228. languages: [
  229. {name: "English", code: "en"},
  230. {name: "French", code: "fr"}
  231. ]
  232. # Password Settings
  233. # -----------
  234. # These restrict the passwords users can use when registering
  235. # opts are from http://antelle.github.io/passfield
  236. # passwordStrengthOptions:
  237. # pattern: "aA$3"
  238. # length:
  239. # min: 6
  240. # max: 128
  241. # Email support
  242. # -------------
  243. #
  244. # ShareLaTeX uses nodemailer (http://www.nodemailer.com/) to send transactional emails.
  245. # To see the range of transport and options they support, see http://www.nodemailer.com/docs/transports
  246. #email:
  247. # fromAddress: ""
  248. # replyTo: ""
  249. # lifecycle: false
  250. ## Example transport and parameter settings for Amazon SES
  251. # transport: "SES"
  252. # parameters:
  253. # AWSAccessKeyID: ""
  254. # AWSSecretKey: ""
  255. # Third party services
  256. # --------------------
  257. #
  258. # ShareLaTeX's regular newsletter is managed by mailchimp. Add your
  259. # credentials here to integrate with this.
  260. # mailchimp:
  261. # api_key: ""
  262. # list_id: ""
  263. #
  264. # Fill in your unique token from various analytics services to enable
  265. # them.
  266. # analytics:
  267. # ga:
  268. # token: ""
  269. #
  270. # ShareLaTeX's help desk is provided by tenderapp.com
  271. # tenderUrl: ""
  272. #
  273. # Client-side error logging is provided by getsentry.com
  274. # sentry:
  275. # src: ""
  276. # publicDSN: ""
  277. #
  278. # src should be either a remote url like
  279. # //cdn.ravenjs.com/1.1.22/jquery,native/raven.min.js
  280. # or a local file in the js/libs directory.
  281. # The publicDSN is the token for the client-side getSentry service.
  282. # Production Settings
  283. # -------------------
  284. # Should javascript assets be served minified or not. Note that you will
  285. # need to run `grunt compile:minify` within the web-sharelatex directory
  286. # to generate these.
  287. useMinifiedJs: process.env['MINIFIED_JS'] == 'true' or false
  288. # Should static assets be sent with a header to tell the browser to cache
  289. # them.
  290. cacheStaticAssets: false
  291. # If you are running ShareLaTeX over https, set this to true to send the
  292. # cookie with a secure flag (recommended).
  293. secureCookie: false
  294. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  295. # then set this to true to allow it to correctly detect the forwarded IP
  296. # address and http/https protocol information.
  297. behindProxy: false
  298. # Cookie max age (in milliseconds). Set to false for a browser session.
  299. cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
  300. # When true, only allow invites to be sent to email addresses that
  301. # already have user accounts
  302. restrictInvitesToExistingAccounts: false
  303. # Should we allow access to any page without logging in? This includes
  304. # public projects, /learn, /templates, about pages, etc.
  305. allowPublicAccess: if process.env["SHARELATEX_ALLOW_PUBLIC_ACCESS"] == 'true' then true else false
  306. enableHomepage: process.env["HOME_PAGE_ENABLED"] == 'true'
  307. # editor should be open by default
  308. editorIsOpen: if process.env["EDITOR_OPEN"] == 'false' then false else true
  309. # site should be open by default
  310. siteIsOpen: if process.env["SITE_OPEN"] == 'false' then false else true
  311. # Use a single compile directory for all users in a project
  312. # (otherwise each user has their own directory)
  313. # disablePerUserCompiles: true
  314. # Domain the client (pdfjs) should download the compiled pdf from
  315. pdfDownloadDomain: process.env["PDF_DOWNLOAD_DOMAIN"] #"http://clsi-lb:3014"
  316. # Maximum size of text documents in the real-time editing system.
  317. max_doc_length: 2 * 1024 * 1024 # 2mb
  318. # Internal configs
  319. # ----------------
  320. path:
  321. # If we ever need to write something to disk (e.g. incoming requests
  322. # that need processing but may be too big for memory, then write
  323. # them to disk here).
  324. dumpFolder: "/data/dumpFolder"
  325. uploadFolder: "/data/uploads"
  326. # Automatic Snapshots
  327. # -------------------
  328. automaticSnapshots:
  329. # How long should we wait after the user last edited to
  330. # take a snapshot?
  331. waitTimeAfterLastEdit: 5 * minutes
  332. # Even if edits are still taking place, this is maximum
  333. # time to wait before taking another snapshot.
  334. maxTimeBetweenSnapshots: 30 * minutes
  335. # Smoke test
  336. # ----------
  337. # Provide log in credentials and a project to be able to run
  338. # some basic smoke tests to check the core functionality.
  339. #
  340. smokeTest:
  341. user: process.env['SMOKE_TEST_USER']
  342. userId: process.env['SMOKE_TEST_USER_ID']
  343. password: process.env['SMOKE_TEST_PASSWORD']
  344. projectId: process.env['SMOKE_TEST_PROJECT_ID']
  345. rateLimitSubject: process.env['SMOKE_TEST_RATE_LIMIT_SUBJECT'] or "127.0.0.1"
  346. appName: process.env['APP_NAME'] or "ShareLaTeX (Community Edition)"
  347. adminEmail: process.env['ADMIN_EMAIL'] or "placeholder@example.com"
  348. brandPrefix: process.env['BRAND_PREFIX'] or "sl-" # Set to 'ol-' for overleaf styles
  349. nav:
  350. title: "ShareLaTeX Community Edition"
  351. left_footer: [{
  352. text: "Powered by <a href='https://www.sharelatex.com'>ShareLaTeX</a> © 2016"
  353. }]
  354. right_footer: [{
  355. text: "<i class='fa fa-github-square'></i> Fork on Github!"
  356. url: "https://github.com/sharelatex/sharelatex"
  357. }]
  358. showSubscriptionLink: false
  359. header_extras: []
  360. # Example:
  361. # header_extras: [{text: "Some Page", url: "http://example.com/some/page", class: "subdued"}]
  362. customisation: {}
  363. # templates: [{
  364. # name : "cv_or_resume",
  365. # url : "/templates/cv"
  366. # }, {
  367. # name : "cover_letter",
  368. # url : "/templates/cover-letters"
  369. # }, {
  370. # name : "journal_article",
  371. # url : "/templates/journals"
  372. # }, {
  373. # name : "presentation",
  374. # url : "/templates/presentations"
  375. # }, {
  376. # name : "thesis",
  377. # url : "/templates/thesis"
  378. # }, {
  379. # name : "bibliographies",
  380. # url : "/templates/bibliographies"
  381. # }, {
  382. # name : "view_all",
  383. # url : "/templates"
  384. # }]
  385. redirects:
  386. "/templates/index": "/templates/"
  387. reloadModuleViewsOnEachRequest: process.env['NODE_ENV'] != 'production'
  388. domainLicences: [
  389. ]
  390. sixpack:
  391. domain:""
  392. # ShareLaTeX Server Pro options (https://www.sharelatex.com/university/onsite.html)
  393. # ----------
  394. # LDAP
  395. # ----------
  396. # Settings below use a working LDAP test server kindly provided by forumsys.com
  397. # When testing with forumsys.com use username = einstein and password = password
  398. # ldap :
  399. # host: 'ldap://ldap.forumsys.com'
  400. # dn: 'uid=:userKey,dc=example,dc=com'
  401. # baseSearch: 'dc=example,dc=com'
  402. # filter: "(uid=:userKey)"
  403. # failMessage: 'LDAP User Fail'
  404. # fieldName: 'LDAP User'
  405. # placeholder: 'email@example.com'
  406. # emailAtt: 'mail'
  407. # anonymous: false
  408. # adminDN: 'cn=read-only-admin,dc=example,dc=com'
  409. # adminPW: 'password'
  410. # starttls: true
  411. # tlsOptions:
  412. # rejectUnauthorized: false
  413. # ca: ['/etc/ldap/ca_certs.pem']
  414. #templateLinks: [{
  415. # name : "CV projects",
  416. # url : "/templates/cv"
  417. #},{
  418. # name : "all projects",
  419. # url: "/templates/all"
  420. #}]
  421. rateLimits:
  422. autoCompile:
  423. everyone: 100
  424. standard: 25
  425. # currentImage: "texlive-full:2017.1"
  426. # imageRoot: "<DOCKER REPOSITORY ROOT>" # without any trailing slash
  427. compileBodySizeLimitMb: process.env['COMPILE_BODY_SIZE_LIMIT_MB'] or 5
  428. # allowedImageNames: [
  429. # {imageName: 'texlive-full:2017.1', imageDesc: 'TeXLive 2017'}
  430. # {imageName: 'wl_texlive:2018.1', imageDesc: 'Legacy OL TeXLive 2015'}
  431. # {imageName: 'texlive-full:2016.1', imageDesc: 'Legacy SL TeXLive 2016'}
  432. # {imageName: 'texlive-full:2015.1', imageDesc: 'Legacy SL TeXLive 2015'}
  433. # {imageName: 'texlive-full:2014.2', imageDesc: 'Legacy SL TeXLive 2014.2'}
  434. # ]
  435. # module options
  436. # ----------
  437. modules:
  438. sanitize:
  439. options:
  440. allowedTags: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div', 'table', 'thead', 'col', 'caption', 'tbody', 'tr', 'th', 'td', 'tfoot', 'pre', 'iframe', 'img', 'figure', 'figcaption', 'span', 'source', 'video', 'del' ]
  441. allowedAttributes:
  442. 'a': [ 'href', 'name', 'target', 'class', 'event-tracking', 'event-tracking-ga', 'event-tracking-label', 'event-tracking-trigger' ]
  443. 'div': [ 'class', 'id', 'style' ]
  444. 'h1': [ 'class', 'id' ]
  445. 'h2': [ 'class', 'id' ]
  446. 'h3': [ 'class', 'id' ]
  447. 'h4': [ 'class', 'id' ]
  448. 'h5': [ 'class', 'id' ]
  449. 'h6': [ 'class', 'id' ]
  450. 'col': [ 'width' ]
  451. 'figure': [ 'class', 'id', 'style']
  452. 'figcaption': [ 'class', 'id', 'style']
  453. 'i': [ 'aria-hidden', 'aria-label', 'class', 'id' ]
  454. 'iframe': [ 'allowfullscreen', 'frameborder', 'height', 'src', 'style', 'width' ]
  455. 'img': [ 'alt', 'class', 'src', 'style' ]
  456. 'source': [ 'src', 'type' ]
  457. 'span': [ 'class', 'id', 'style' ]
  458. 'table': [ 'border', 'class', 'id', 'style' ]
  459. 'td': [ 'colspan', 'rowspan', 'headers' ]
  460. 'th': [ 'abbr', 'headers', 'colspan', 'rowspan', 'scope', 'sorted' ]
  461. 'video': [ 'alt', 'class', 'controls', 'height', 'width' ]