settings.defaults.coffee 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  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']
  10. httpAuthPass = process.env['WEB_API_PASSWORD']
  11. httpAuthUsers = {}
  12. if httpAuthUser and httpAuthPass
  13. httpAuthUsers[httpAuthUser] = httpAuthPass
  14. sessionSecret = process.env['SESSION_SECRET'] or "secret-please-change"
  15. if process.env['V1_API_URL'] or process.env['V1_HOST']
  16. v1Api =
  17. url: process.env['V1_API_URL'] or "http://#{process.env['V1_HOST']}:5000"
  18. user: process.env['V1_API_USER']
  19. pass: process.env['V1_API_PASSWORD']
  20. else
  21. v1Api =
  22. url: undefined
  23. user: undefined
  24. pass: undefined
  25. intFromEnv = (name, defaultValue) ->
  26. if defaultValue in [null, undefined] or typeof defaultValue != 'number'
  27. throw new Error("Bad default integer value for setting: #{name}, #{defaultValue}")
  28. parseInt(process.env[name], 10) || defaultValue
  29. defaultTextExtensions = [
  30. 'tex',
  31. 'latex',
  32. 'sty',
  33. 'cls',
  34. 'bst',
  35. 'bib',
  36. 'bibtex',
  37. 'txt',
  38. 'tikz',
  39. 'mtx',
  40. 'rtex',
  41. 'md',
  42. 'asy',
  43. 'latexmkrc',
  44. 'lbx',
  45. 'bbx',
  46. 'cbx',
  47. 'm',
  48. 'lco',
  49. 'dtx',
  50. 'ins',
  51. 'ist',
  52. 'def',
  53. 'clo',
  54. 'ldf',
  55. 'rmd',
  56. 'lua',
  57. 'gv',
  58. 'mf'
  59. ]
  60. parseTextExtensions = (extensions) ->
  61. if extensions
  62. extensions.split(',').map((ext) => ext.trim())
  63. else
  64. []
  65. module.exports = settings =
  66. allowAnonymousReadAndWriteSharing:
  67. process.env['SHARELATEX_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING'] == 'true'
  68. # Databases
  69. # ---------
  70. mongo:
  71. options: {
  72. appname: 'web'
  73. useUnifiedTopology: (process.env['MONGO_USE_UNIFIED_TOPOLOGY'] || 'true') == 'true',
  74. poolSize: parseInt(process.env['MONGO_POOL_SIZE'], 10) || 10,
  75. serverSelectionTimeoutMS: parseInt(process.env['MONGO_SERVER_SELECTION_TIMEOUT'], 10) || 60000,
  76. socketTimeoutMS: parseInt(process.env['MONGO_SOCKET_TIMEOUT'], 10) || 30000,
  77. },
  78. url : process.env['MONGO_CONNECTION_STRING'] || process.env['MONGO_URL'] || "mongodb://#{process.env['MONGO_HOST'] or '127.0.0.1'}/sharelatex"
  79. redis:
  80. web:
  81. host: process.env['REDIS_HOST'] || "localhost"
  82. port: process.env['REDIS_PORT'] || "6379"
  83. password: process.env["REDIS_PASSWORD"] or ""
  84. maxRetriesPerRequest: parseInt(process.env["REDIS_MAX_RETRIES_PER_REQUEST"] || '20')
  85. # websessions:
  86. # cluster: [
  87. # {host: 'localhost', port: 7000}
  88. # {host: 'localhost', port: 7001}
  89. # {host: 'localhost', port: 7002}
  90. # {host: 'localhost', port: 7003}
  91. # {host: 'localhost', port: 7004}
  92. # {host: 'localhost', port: 7005}
  93. # ]
  94. # ratelimiter:
  95. # cluster: [
  96. # {host: 'localhost', port: 7000}
  97. # {host: 'localhost', port: 7001}
  98. # {host: 'localhost', port: 7002}
  99. # {host: 'localhost', port: 7003}
  100. # {host: 'localhost', port: 7004}
  101. # {host: 'localhost', port: 7005}
  102. # ]
  103. # cooldown:
  104. # cluster: [
  105. # {host: 'localhost', port: 7000}
  106. # {host: 'localhost', port: 7001}
  107. # {host: 'localhost', port: 7002}
  108. # {host: 'localhost', port: 7003}
  109. # {host: 'localhost', port: 7004}
  110. # {host: 'localhost', port: 7005}
  111. # ]
  112. api:
  113. host: process.env['REDIS_HOST'] || "localhost"
  114. port: process.env['REDIS_PORT'] || "6379"
  115. password: process.env["REDIS_PASSWORD"] or ""
  116. maxRetriesPerRequest: parseInt(process.env["REDIS_MAX_RETRIES_PER_REQUEST"] || '20')
  117. queues:
  118. host: process.env['QUEUES_REDIS_HOST'] || 'localhost'
  119. port: process.env['QUEUES_REDIS_PORT'] || '6379'
  120. password: process.env['QUEUES_REDIS_PASSWORD'] || ''
  121. # Service locations
  122. # -----------------
  123. # Configure which ports to run each service on. Generally you
  124. # can leave these as they are unless you have some other services
  125. # running which conflict, or want to run the web process on port 80.
  126. internal:
  127. web:
  128. port: webPort = process.env['WEB_PORT'] or 3000
  129. host: process.env['LISTEN_ADDRESS'] or 'localhost'
  130. documentupdater:
  131. port: docUpdaterPort = 3003
  132. gitBridgePublicBaseUrl: "http://#{process.env['GIT_BRIDGE_HOST'] || 'localhost'}:8000"
  133. # Tell each service where to find the other services. If everything
  134. # is running locally then this is easy, but they exist as separate config
  135. # options incase you want to run some services on remote hosts.
  136. apis:
  137. web:
  138. 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}"
  139. user: httpAuthUser
  140. pass: httpAuthPass
  141. documentupdater:
  142. url : "http://#{process.env['DOCUPDATER_HOST'] or process.env['DOCUMENT_UPDATER_HOST'] or 'localhost'}:#{docUpdaterPort}"
  143. thirdPartyDataStore:
  144. url : "http://#{process.env['TPDS_HOST'] or 'localhost'}:3002"
  145. emptyProjectFlushDelayMiliseconds: 5 * seconds
  146. dropboxApp: process.env['TPDS_DROPBOX_APP']
  147. tags:
  148. url :"http://#{process.env['TAGS_HOST'] or 'localhost'}:3012"
  149. spelling:
  150. url : "http://#{process.env['SPELLING_HOST'] or 'localhost'}:3005"
  151. host: process.env['SPELLING_HOST']
  152. trackchanges:
  153. url : "http://#{process.env['TRACK_CHANGES_HOST'] or 'localhost'}:3015"
  154. project_history:
  155. sendProjectStructureOps: process.env.PROJECT_HISTORY_ENABLED == 'true' or false
  156. initializeHistoryForNewProjects: process.env.PROJECT_HISTORY_ENABLED == 'true' or false
  157. displayHistoryForNewProjects: process.env.PROJECT_HISTORY_ENABLED == 'true' or false
  158. url : "http://#{process.env['PROJECT_HISTORY_HOST'] or 'localhost'}:3054"
  159. docstore:
  160. url : "http://#{process.env['DOCSTORE_HOST'] or 'localhost'}:3016"
  161. pubUrl: "http://#{process.env['DOCSTORE_HOST'] or 'localhost'}:3016"
  162. chat:
  163. url: "http://#{process.env['CHAT_HOST'] or 'localhost'}:3010"
  164. internal_url: "http://#{process.env['CHAT_HOST'] or 'localhost'}:3010"
  165. blog:
  166. url: "http://localhost:3008"
  167. port: 3008
  168. university:
  169. url: "http://localhost:3011"
  170. filestore:
  171. url: "http://#{process.env['FILESTORE_HOST'] or 'localhost'}:3009"
  172. clsi:
  173. url: "http://#{process.env['CLSI_HOST'] or 'localhost'}:3013"
  174. # url: "http://#{process.env['CLSI_LB_HOST']}:3014"
  175. backendGroupName: undefined
  176. templates:
  177. url: "http://#{process.env['TEMPLATES_HOST'] or 'localhost'}:3007"
  178. githubSync:
  179. url: "http://#{process.env['GITHUB_SYNC_HOST'] or 'localhost'}:3022"
  180. recurly:
  181. apiKey: process.env['RECURLY_API_KEY'] or ''
  182. apiVersion: process.env['RECURLY_API_VERSION']
  183. subdomain: process.env['RECURLY_SUBDOMAIN'] or ''
  184. publicKey: process.env['RECURLY_PUBLIC_KEY'] or ''
  185. geoIpLookup:
  186. url: "http://#{process.env['GEOIP_HOST'] or process.env['FREEGEOIP_HOST'] or 'localhost'}:8080/json/"
  187. realTime:
  188. url: "http://#{process.env['REALTIME_HOST'] or 'localhost'}:3026"
  189. contacts:
  190. url: "http://#{process.env['CONTACTS_HOST'] or 'localhost'}:3036"
  191. sixpack:
  192. url: ""
  193. references:
  194. url: if process.env['REFERENCES_HOST']? then "http://#{process.env['REFERENCES_HOST']}:3040" else undefined
  195. notifications:
  196. url: "http://#{process.env['NOTIFICATIONS_HOST'] or 'localhost'}:3042"
  197. analytics:
  198. url: "http://#{process.env['ANALYTICS_HOST'] or 'localhost'}:3050"
  199. linkedUrlProxy:
  200. url: process.env['LINKED_URL_PROXY']
  201. thirdpartyreferences:
  202. url: "http://#{process.env['THIRD_PARTY_REFERENCES_HOST'] or 'localhost'}:3046"
  203. timeout: parseInt(process.env['THIRD_PARTY_REFERENCES_TIMEOUT'] || '30000', 10)
  204. v1:
  205. url: v1Api.url
  206. user: v1Api.user
  207. pass: v1Api.pass
  208. v1_history:
  209. url: "http://#{process.env['V1_HISTORY_HOST'] or "localhost"}:3100/api"
  210. user: process.env['V1_HISTORY_USER'] or 'staging'
  211. pass: process.env['V1_HISTORY_PASSWORD'] or 'password'
  212. templates:
  213. user_id: process.env.TEMPLATES_USER_ID or "5395eb7aad1f29a88756c7f2"
  214. showSocialButtons: false
  215. showComments: false
  216. splitTests: [
  217. {
  218. id: 'example-project'
  219. active: process.env['SPLITTEST_EXAMPLE_PROJECT_ACTIVE'] == 'true'
  220. variants: [
  221. {
  222. id: 'example-frog'
  223. rolloutPercent: parseInt(process.env['SPLITTEST_EXAMPLE_PROJECT_FROG_VARIANT_ROLLOUT_PERCENT'] || '0', 10)
  224. }
  225. ]
  226. }
  227. ]
  228. # cdn:
  229. # web:
  230. # host:"http://nowhere.sharelatex.dev"
  231. # darkHost:"http://cdn.sharelatex.dev:3000"
  232. # Where your instance of ShareLaTeX can be found publically. Used in emails
  233. # that are sent out, generated links, etc.
  234. siteUrl : siteUrl = process.env['PUBLIC_URL'] or 'http://localhost:3000'
  235. lockManager:
  236. lockTestInterval: intFromEnv('LOCK_MANAGER_LOCK_TEST_INTERVAL', 50)
  237. maxTestInterval: intFromEnv('LOCK_MANAGER_MAX_TEST_INTERVAL', 1000)
  238. maxLockWaitTime: intFromEnv('LOCK_MANAGER_MAX_LOCK_WAIT_TIME', 10000)
  239. redisLockExpiry: intFromEnv('LOCK_MANAGER_REDIS_LOCK_EXPIRY', 30)
  240. slowExecutionThreshold: intFromEnv('LOCK_MANAGER_SLOW_EXECUTION_THRESHOLD', 5000)
  241. # Used to close the editor off to users
  242. editorIsOpen: process.env['EDITOR_IS_OPEN'] or true
  243. # Optional separate location for websocket connections, if unset defaults to siteUrl.
  244. wsUrl: process.env['WEBSOCKET_URL']
  245. wsUrlV2: process.env['WEBSOCKET_URL_V2']
  246. wsUrlBeta: process.env['WEBSOCKET_URL_BETA']
  247. wsUrlV2Percentage: parseInt(process.env['WEBSOCKET_URL_V2_PERCENTAGE'] || '0', 10)
  248. wsRetryHandshake: parseInt(process.env['WEBSOCKET_RETRY_HANDSHAKE'] || '5', 10)
  249. # Compile UI rollout percentages
  250. logsUIPercentageBeta: parseInt(process.env['LOGS_UI_PERCENTAGE_BETA'] || '0', 10)
  251. logsUIPercentageWithoutPopupBeta: parseInt(process.env['LOGS_UI_WITHOUT_POPUP_PERCENTAGE_BETA'] || '0', 10)
  252. logsUIPercentage: parseInt(process.env['LOGS_UI_PERCENTAGE'] || '0', 10)
  253. logsUIPercentageWithoutPopup: parseInt(process.env['LOGS_UI_WITHOUT_POPUP_PERCENTAGE'] || '0', 10)
  254. # cookie domain
  255. # use full domain for cookies to only be accessible from that domain,
  256. # replace subdomain with dot to have them accessible on all subdomains
  257. cookieDomain: process.env['COOKIE_DOMAIN']
  258. cookieName: process.env['COOKIE_NAME'] or "sharelatex.sid"
  259. # this is only used if cookies are used for clsi backend
  260. #clsiCookieKey: "clsiserver"
  261. # Same, but with http auth credentials.
  262. httpAuthSiteUrl: "http://#{httpAuthUser}:#{httpAuthPass}@#{siteUrl}"
  263. robotsNoindex: (process.env['ROBOTS_NOINDEX'] == "true") or false
  264. maxEntitiesPerProject: 2000
  265. maxUploadSize: 50 * 1024 * 1024 # 50 MB
  266. # start failing the health check if active handles exceeds this limit
  267. maxActiveHandles: if process.env['MAX_ACTIVE_HANDLES'] then parseInt(process.env['MAX_ACTIVE_HANDLES'], 10)
  268. # Security
  269. # --------
  270. security:
  271. sessionSecret: sessionSecret
  272. bcryptRounds: (parseInt(process.env['BCRYPT_ROUNDS'], 10) || 12) # number of rounds used to hash user passwords (raised to power 2)
  273. httpAuthUsers: httpAuthUsers
  274. twoFactorAuthentication:
  275. enabled: process.env['TWO_FACTOR_AUTHENTICATION_ENABLED'] == 'true'
  276. requiredForStaff: process.env['TWO_FACTOR_AUTHENTICATION_REQUIRED_FOR_STAFF'] == 'true'
  277. jwt:
  278. key: process.env['OT_JWT_AUTH_KEY']
  279. algorithm: process.env['OT_JWT_AUTH_ALG'] || 'HS256'
  280. # Default features
  281. # ----------------
  282. #
  283. # You can select the features that are enabled by default for new
  284. # new users.
  285. defaultFeatures: defaultFeatures =
  286. collaborators: -1
  287. dropbox: true
  288. github: true
  289. gitBridge: true
  290. versioning: true
  291. compileTimeout: 180
  292. compileGroup: "standard"
  293. references: true
  294. templates: true
  295. trackChanges: true
  296. features:
  297. personal: defaultFeatures
  298. plans: plans = [{
  299. planCode: "personal"
  300. name: "Personal"
  301. price: 0
  302. features: defaultFeatures
  303. }]
  304. enableSubscriptions:false
  305. enabledLinkedFileTypes: (process.env['ENABLED_LINKED_FILE_TYPES'] or '').split(',')
  306. # i18n
  307. # ------
  308. #
  309. i18n:
  310. checkForHTMLInVars: process.env['I18N_CHECK_FOR_HTML_IN_VARS'] == 'true'
  311. escapeHTMLInVars: process.env['I18N_ESCAPE_HTML_IN_VARS'] == 'true'
  312. subdomainLang:
  313. www: {lngCode:"en", url: siteUrl}
  314. defaultLng: "en"
  315. # Spelling languages
  316. # ------------------
  317. #
  318. # You must have the corresponding aspell package installed to
  319. # be able to use a language.
  320. languages: [
  321. {code: "en", name: "English"},
  322. {code: "en_US", name: "English (American)"},
  323. {code: "en_GB", name: "English (British)"},
  324. {code: "en_CA", name: "English (Canadian)"},
  325. {code: "af", name: "Afrikaans"},
  326. {code: "ar", name: "Arabic"},
  327. {code: "gl", name: "Galician"},
  328. {code: "eu", name: "Basque"},
  329. {code: "br", name: "Breton"},
  330. {code: "bg", name: "Bulgarian"},
  331. {code: "ca", name: "Catalan"},
  332. {code: "hr", name: "Croatian"},
  333. {code: "cs", name: "Czech"},
  334. {code: "da", name: "Danish"},
  335. {code: "nl", name: "Dutch"},
  336. {code: "eo", name: "Esperanto"},
  337. {code: "et", name: "Estonian"},
  338. {code: "fo", name: "Faroese"},
  339. {code: "fr", name: "French"},
  340. {code: "de", name: "German"},
  341. {code: "el", name: "Greek"},
  342. {code: "id", name: "Indonesian"},
  343. {code: "ga", name: "Irish"},
  344. {code: "it", name: "Italian"},
  345. {code: "kk", name: "Kazakh"},
  346. {code: "ku", name: "Kurdish"},
  347. {code: "lv", name: "Latvian"},
  348. {code: "lt", name: "Lithuanian"},
  349. {code: "nr", name: "Ndebele"},
  350. {code: "ns", name: "Northern Sotho"},
  351. {code: "no", name: "Norwegian"},
  352. {code: "fa", name: "Persian"},
  353. {code: "pl", name: "Polish"},
  354. {code: "pt_BR", name: "Portuguese (Brazilian)"},
  355. {code: "pt_PT", name: "Portuguese (European)"},
  356. {code: "pa", name: "Punjabi"},
  357. {code: "ro", name: "Romanian"},
  358. {code: "ru", name: "Russian"},
  359. {code: "sk", name: "Slovak"},
  360. {code: "sl", name: "Slovenian"},
  361. {code: "st", name: "Southern Sotho"},
  362. {code: "es", name: "Spanish"},
  363. {code: "sv", name: "Swedish"},
  364. {code: "tl", name: "Tagalog"},
  365. {code: "ts", name: "Tsonga"},
  366. {code: "tn", name: "Tswana"},
  367. {code: "hsb", name: "Upper Sorbian"},
  368. {code: "cy", name: "Welsh"},
  369. {code: "xh", name: "Xhosa"}
  370. ]
  371. # Password Settings
  372. # -----------
  373. # These restrict the passwords users can use when registering
  374. # opts are from http://antelle.github.io/passfield
  375. # passwordStrengthOptions:
  376. # pattern: "aA$3"
  377. # length:
  378. # min: 6
  379. # max: 128
  380. # Email support
  381. # -------------
  382. #
  383. # ShareLaTeX uses nodemailer (http://www.nodemailer.com/) to send transactional emails.
  384. # To see the range of transport and options they support, see http://www.nodemailer.com/docs/transports
  385. #email:
  386. # fromAddress: ""
  387. # replyTo: ""
  388. # lifecycle: false
  389. ## Example transport and parameter settings for Amazon SES
  390. # transport: "SES"
  391. # parameters:
  392. # AWSAccessKeyID: ""
  393. # AWSSecretKey: ""
  394. # Third party services
  395. # --------------------
  396. #
  397. # ShareLaTeX's regular newsletter is managed by mailchimp. Add your
  398. # credentials here to integrate with this.
  399. # mailchimp:
  400. # api_key: ""
  401. # list_id: ""
  402. #
  403. # Fill in your unique token from various analytics services to enable
  404. # them.
  405. # analytics:
  406. # ga:
  407. # token: ""
  408. # gaOptimize:
  409. # id: ""
  410. # ShareLaTeX's help desk is provided by tenderapp.com
  411. # tenderUrl: ""
  412. #
  413. # Client-side error logging is provided by getsentry.com
  414. sentry:
  415. environment: process.env['SENTRY_ENVIRONMENT']
  416. release: process.env['SENTRY_RELEASE']
  417. # publicDSN: ""
  418. # The publicDSN is the token for the client-side getSentry service.
  419. # Production Settings
  420. # -------------------
  421. debugPugTemplates: process.env['DEBUG_PUG_TEMPLATES'] == 'true'
  422. # Should javascript assets be served minified or not. Note that you will
  423. # need to run `grunt compile:minify` within the web-sharelatex directory
  424. # to generate these.
  425. useMinifiedJs: process.env['MINIFIED_JS'] == 'true' or false
  426. # Should static assets be sent with a header to tell the browser to cache
  427. # them.
  428. cacheStaticAssets: false
  429. # If you are running ShareLaTeX over https, set this to true to send the
  430. # cookie with a secure flag (recommended).
  431. secureCookie: false
  432. # 'SameSite' cookie setting. Can be set to 'lax', 'none' or 'strict'
  433. # 'lax' is recommended, as 'strict' will prevent people linking to projects
  434. # https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
  435. sameSiteCookie: 'lax'
  436. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  437. # then set this to true to allow it to correctly detect the forwarded IP
  438. # address and http/https protocol information.
  439. behindProxy: false
  440. # Expose the hostname in the `X-Served-By` response header
  441. exposeHostname: process.env['EXPOSE_HOSTNAME'] == 'true'
  442. # Cookie max age (in milliseconds). Set to false for a browser session.
  443. cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
  444. # When true, only allow invites to be sent to email addresses that
  445. # already have user accounts
  446. restrictInvitesToExistingAccounts: false
  447. # Should we allow access to any page without logging in? This includes
  448. # public projects, /learn, /templates, about pages, etc.
  449. allowPublicAccess: if process.env["SHARELATEX_ALLOW_PUBLIC_ACCESS"] == 'true' then true else false
  450. enableHomepage: process.env["HOME_PAGE_ENABLED"] == 'true'
  451. # editor should be open by default
  452. editorIsOpen: if process.env["EDITOR_OPEN"] == 'false' then false else true
  453. # site should be open by default
  454. siteIsOpen: if process.env["SITE_OPEN"] == 'false' then false else true
  455. # Use a single compile directory for all users in a project
  456. # (otherwise each user has their own directory)
  457. # disablePerUserCompiles: true
  458. # Domain the client (pdfjs) should download the compiled pdf from
  459. pdfDownloadDomain: process.env["PDF_DOWNLOAD_DOMAIN"] #"http://clsi-lb:3014"
  460. # Maximum size of text documents in the real-time editing system.
  461. max_doc_length: 2 * 1024 * 1024 # 2mb
  462. # Maximum JSON size in HTTP requests
  463. # We should be able to process twice the max doc length, to allow for
  464. # - the doc content
  465. # - text ranges spanning the whole doc
  466. #
  467. # There's also overhead required for the JSON encoding and the UTF-8 encoding,
  468. # theoretically up to 3 times the max doc length. On the other hand, we don't
  469. # want to block the event loop with JSON parsing, so we try to find a
  470. # practical compromise.
  471. max_json_request_size: parseInt(process.env["MAX_JSON_REQUEST_SIZE"]) || 6 * 1024 * 1024 # 6 MB
  472. # Internal configs
  473. # ----------------
  474. path:
  475. # If we ever need to write something to disk (e.g. incoming requests
  476. # that need processing but may be too big for memory, then write
  477. # them to disk here).
  478. dumpFolder: "./data/dumpFolder"
  479. uploadFolder: "./data/uploads"
  480. # Automatic Snapshots
  481. # -------------------
  482. automaticSnapshots:
  483. # How long should we wait after the user last edited to
  484. # take a snapshot?
  485. waitTimeAfterLastEdit: 5 * minutes
  486. # Even if edits are still taking place, this is maximum
  487. # time to wait before taking another snapshot.
  488. maxTimeBetweenSnapshots: 30 * minutes
  489. # Smoke test
  490. # ----------
  491. # Provide log in credentials and a project to be able to run
  492. # some basic smoke tests to check the core functionality.
  493. #
  494. smokeTest:
  495. user: process.env['SMOKE_TEST_USER']
  496. userId: process.env['SMOKE_TEST_USER_ID']
  497. password: process.env['SMOKE_TEST_PASSWORD']
  498. projectId: process.env['SMOKE_TEST_PROJECT_ID']
  499. rateLimitSubject: process.env['SMOKE_TEST_RATE_LIMIT_SUBJECT'] or "127.0.0.1"
  500. stepTimeout: parseInt(process.env['SMOKE_TEST_STEP_TIMEOUT'] or "10000", 10)
  501. appName: process.env['APP_NAME'] or "ShareLaTeX (Community Edition)"
  502. adminEmail: process.env['ADMIN_EMAIL'] or "placeholder@example.com"
  503. adminDomains: JSON.parse(process.env['ADMIN_DOMAINS'] or 'null')
  504. salesEmail: process.env['SALES_EMAIL'] or "placeholder@example.com"
  505. statusPageUrl: process.env['OVERLEAF_STATUS_URL'] or "status.overleaf.com"
  506. nav:
  507. title: "ShareLaTeX Community Edition"
  508. left_footer: [{
  509. text: "Powered by <a href='https://www.sharelatex.com'>ShareLaTeX</a> © 2016"
  510. }]
  511. right_footer: [{
  512. text: "<i class='fa fa-github-square'></i> Fork on Github!"
  513. url: "https://github.com/sharelatex/sharelatex"
  514. }]
  515. showSubscriptionLink: false
  516. header_extras: []
  517. # Example:
  518. # header_extras: [{text: "Some Page", url: "http://example.com/some/page", class: "subdued"}]
  519. recaptcha:
  520. disabled:
  521. invite: true
  522. register: true
  523. customisation: {}
  524. # templates: [{
  525. # name : "cv_or_resume",
  526. # url : "/templates/cv"
  527. # }, {
  528. # name : "cover_letter",
  529. # url : "/templates/cover-letters"
  530. # }, {
  531. # name : "journal_article",
  532. # url : "/templates/journals"
  533. # }, {
  534. # name : "presentation",
  535. # url : "/templates/presentations"
  536. # }, {
  537. # name : "thesis",
  538. # url : "/templates/thesis"
  539. # }, {
  540. # name : "bibliographies",
  541. # url : "/templates/bibliographies"
  542. # }, {
  543. # name : "view_all",
  544. # url : "/templates"
  545. # }]
  546. redirects:
  547. "/templates/index": "/templates/"
  548. reloadModuleViewsOnEachRequest: process.env['NODE_ENV'] == 'development'
  549. disableModule:
  550. 'user-activate': process.env['DISABLE_MODULE_USER_ACTIVATE'] == 'true'
  551. 'launchpad': process.env['DISABLE_MODULE_LAUNCHPAD'] == 'true'
  552. domainLicences: [
  553. ]
  554. sixpack:
  555. domain:""
  556. # ShareLaTeX Server Pro options (https://www.sharelatex.com/university/onsite.html)
  557. # ----------
  558. # LDAP
  559. # ----------
  560. # Settings below use a working LDAP test server kindly provided by forumsys.com
  561. # When testing with forumsys.com use username = einstein and password = password
  562. # ldap :
  563. # host: 'ldap://ldap.forumsys.com'
  564. # dn: 'uid=:userKey,dc=example,dc=com'
  565. # baseSearch: 'dc=example,dc=com'
  566. # filter: "(uid=:userKey)"
  567. # failMessage: 'LDAP User Fail'
  568. # fieldName: 'LDAP User'
  569. # placeholder: 'email@example.com'
  570. # emailAtt: 'mail'
  571. # anonymous: false
  572. # adminDN: 'cn=read-only-admin,dc=example,dc=com'
  573. # adminPW: 'password'
  574. # starttls: true
  575. # tlsOptions:
  576. # rejectUnauthorized: false
  577. # ca: ['/etc/ldap/ca_certs.pem']
  578. #templateLinks: [{
  579. # name : "CV projects",
  580. # url : "/templates/cv"
  581. #},{
  582. # name : "all projects",
  583. # url: "/templates/all"
  584. #}]
  585. rateLimit:
  586. autoCompile:
  587. everyone: process.env['RATE_LIMIT_AUTO_COMPILE_EVERYONE'] or 100
  588. standard: process.env['RATE_LIMIT_AUTO_COMPILE_STANDARD'] or 25
  589. analytics:
  590. enabled: process.env['ANALYTICS_ENABLED'] == 'true'
  591. # currentImage: "texlive-full:2017.1"
  592. # imageRoot: "<DOCKER REPOSITORY ROOT>" # without any trailing slash
  593. compileBodySizeLimitMb: process.env['COMPILE_BODY_SIZE_LIMIT_MB'] or 5
  594. textExtensions: defaultTextExtensions.concat(parseTextExtensions(process.env["ADDITIONAL_TEXT_EXTENSIONS"]))
  595. validRootDocExtensions: ['tex', 'Rtex', 'ltx']
  596. emailConfirmationDisabled: (process.env['EMAIL_CONFIRMATION_DISABLED'] == "true") or false
  597. # allowedImageNames: [
  598. # {imageName: 'texlive-full:2017.1', imageDesc: 'TeXLive 2017'}
  599. # {imageName: 'wl_texlive:2018.1', imageDesc: 'Legacy OL TeXLive 2015'}
  600. # {imageName: 'texlive-full:2016.1', imageDesc: 'Legacy SL TeXLive 2016'}
  601. # {imageName: 'texlive-full:2015.1', imageDesc: 'Legacy SL TeXLive 2015'}
  602. # {imageName: 'texlive-full:2014.2', imageDesc: 'Legacy SL TeXLive 2014.2'}
  603. # ]
  604. enabledServices: (process.env['ENABLED_SERVICES'] || 'web,api').split(',').map((s) => s.trim())
  605. # module options
  606. # ----------
  607. modules:
  608. sanitize:
  609. options:
  610. 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' ]
  611. allowedAttributes:
  612. 'a': [ 'href', 'name', 'target', 'class', 'event-tracking', 'event-tracking-ga', 'event-tracking-label', 'event-tracking-trigger' ]
  613. 'div': [ 'class', 'id', 'style' ]
  614. 'h1': [ 'class', 'id' ]
  615. 'h2': [ 'class', 'id' ]
  616. 'h3': [ 'class', 'id' ]
  617. 'h4': [ 'class', 'id' ]
  618. 'h5': [ 'class', 'id' ]
  619. 'h6': [ 'class', 'id' ]
  620. 'col': [ 'width' ]
  621. 'figure': [ 'class', 'id', 'style']
  622. 'figcaption': [ 'class', 'id', 'style']
  623. 'i': [ 'aria-hidden', 'aria-label', 'class', 'id' ]
  624. 'iframe': [ 'allowfullscreen', 'frameborder', 'height', 'src', 'style', 'width' ]
  625. 'img': [ 'alt', 'class', 'src', 'style' ]
  626. 'source': [ 'src', 'type' ]
  627. 'span': [ 'class', 'id', 'style' ]
  628. 'strong': [ 'style' ]
  629. 'table': [ 'border', 'class', 'id', 'style' ]
  630. 'td': [ 'colspan', 'rowspan', 'headers', 'style' ]
  631. 'th': [ 'abbr', 'headers', 'colspan', 'rowspan', 'scope', 'sorted', 'style' ]
  632. 'tr': [ 'class' ]
  633. 'video': [ 'alt', 'class', 'controls', 'height', 'width' ]
  634. overleafModuleImports: {
  635. # modules to import (an empty array for each set of modules)
  636. createFileModes: []
  637. gitBridge: []
  638. publishModal: []
  639. tprLinkedFileInfo: []
  640. tprLinkedFileRefreshError: []
  641. }
  642. csp: {
  643. percentage: parseFloat(process.env.CSP_PERCENTAGE) || 0
  644. enabled: process.env.CSP_ENABLED == 'true'
  645. reportOnly: process.env.CSP_REPORT_ONLY == 'true'
  646. reportPercentage: parseFloat(process.env.CSP_REPORT_PERCENTAGE) || 0
  647. reportUri: process.env.CSP_REPORT_URI
  648. exclude: [
  649. 'app/views/project/editor',
  650. 'app/views/project/list',
  651. ]
  652. }
  653. unsupportedBrowsers: {
  654. ie: '<=11'
  655. }