settings.defaults.coffee 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  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-v2'
  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. precompilePugTemplatesAtBootTime: if process.env['PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME'] then process.env['PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME'] == 'true' else process.env.NODE_ENV == 'production'
  423. # Should javascript assets be served minified or not. Note that you will
  424. # need to run `grunt compile:minify` within the web-sharelatex directory
  425. # to generate these.
  426. useMinifiedJs: process.env['MINIFIED_JS'] == 'true' or false
  427. # Should static assets be sent with a header to tell the browser to cache
  428. # them.
  429. cacheStaticAssets: false
  430. # If you are running ShareLaTeX over https, set this to true to send the
  431. # cookie with a secure flag (recommended).
  432. secureCookie: false
  433. # 'SameSite' cookie setting. Can be set to 'lax', 'none' or 'strict'
  434. # 'lax' is recommended, as 'strict' will prevent people linking to projects
  435. # https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
  436. sameSiteCookie: 'lax'
  437. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  438. # then set this to true to allow it to correctly detect the forwarded IP
  439. # address and http/https protocol information.
  440. behindProxy: false
  441. # Expose the hostname in the `X-Served-By` response header
  442. exposeHostname: process.env['EXPOSE_HOSTNAME'] == 'true'
  443. # Cookie max age (in milliseconds). Set to false for a browser session.
  444. cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
  445. # When true, only allow invites to be sent to email addresses that
  446. # already have user accounts
  447. restrictInvitesToExistingAccounts: false
  448. # Should we allow access to any page without logging in? This includes
  449. # public projects, /learn, /templates, about pages, etc.
  450. allowPublicAccess: if process.env["SHARELATEX_ALLOW_PUBLIC_ACCESS"] == 'true' then true else false
  451. enableHomepage: process.env["HOME_PAGE_ENABLED"] == 'true'
  452. # editor should be open by default
  453. editorIsOpen: if process.env["EDITOR_OPEN"] == 'false' then false else true
  454. # site should be open by default
  455. siteIsOpen: if process.env["SITE_OPEN"] == 'false' then false else true
  456. # Use a single compile directory for all users in a project
  457. # (otherwise each user has their own directory)
  458. # disablePerUserCompiles: true
  459. # Domain the client (pdfjs) should download the compiled pdf from
  460. pdfDownloadDomain: process.env["PDF_DOWNLOAD_DOMAIN"] #"http://clsi-lb:3014"
  461. # By default turn on feature flag, can be overridden per request.
  462. enablePdfCaching: process.env["ENABLE_PDF_CACHING"] == "true"
  463. # Maximum size of text documents in the real-time editing system.
  464. max_doc_length: 2 * 1024 * 1024 # 2mb
  465. # Maximum JSON size in HTTP requests
  466. # We should be able to process twice the max doc length, to allow for
  467. # - the doc content
  468. # - text ranges spanning the whole doc
  469. #
  470. # There's also overhead required for the JSON encoding and the UTF-8 encoding,
  471. # theoretically up to 3 times the max doc length. On the other hand, we don't
  472. # want to block the event loop with JSON parsing, so we try to find a
  473. # practical compromise.
  474. max_json_request_size: parseInt(process.env["MAX_JSON_REQUEST_SIZE"]) || 6 * 1024 * 1024 # 6 MB
  475. # Internal configs
  476. # ----------------
  477. path:
  478. # If we ever need to write something to disk (e.g. incoming requests
  479. # that need processing but may be too big for memory, then write
  480. # them to disk here).
  481. dumpFolder: "./data/dumpFolder"
  482. uploadFolder: "./data/uploads"
  483. # Automatic Snapshots
  484. # -------------------
  485. automaticSnapshots:
  486. # How long should we wait after the user last edited to
  487. # take a snapshot?
  488. waitTimeAfterLastEdit: 5 * minutes
  489. # Even if edits are still taking place, this is maximum
  490. # time to wait before taking another snapshot.
  491. maxTimeBetweenSnapshots: 30 * minutes
  492. # Smoke test
  493. # ----------
  494. # Provide log in credentials and a project to be able to run
  495. # some basic smoke tests to check the core functionality.
  496. #
  497. smokeTest:
  498. user: process.env['SMOKE_TEST_USER']
  499. userId: process.env['SMOKE_TEST_USER_ID']
  500. password: process.env['SMOKE_TEST_PASSWORD']
  501. projectId: process.env['SMOKE_TEST_PROJECT_ID']
  502. rateLimitSubject: process.env['SMOKE_TEST_RATE_LIMIT_SUBJECT'] or "127.0.0.1"
  503. stepTimeout: parseInt(process.env['SMOKE_TEST_STEP_TIMEOUT'] or "10000", 10)
  504. appName: process.env['APP_NAME'] or "ShareLaTeX (Community Edition)"
  505. adminEmail: process.env['ADMIN_EMAIL'] or "placeholder@example.com"
  506. adminDomains: JSON.parse(process.env['ADMIN_DOMAINS'] or 'null')
  507. salesEmail: process.env['SALES_EMAIL'] or "placeholder@example.com"
  508. statusPageUrl: process.env['OVERLEAF_STATUS_URL'] or "status.overleaf.com"
  509. nav:
  510. title: "ShareLaTeX Community Edition"
  511. left_footer: [{
  512. text: "Powered by <a href='https://www.sharelatex.com'>ShareLaTeX</a> © 2016"
  513. }]
  514. right_footer: [{
  515. text: "<i class='fa fa-github-square'></i> Fork on Github!"
  516. url: "https://github.com/sharelatex/sharelatex"
  517. }]
  518. showSubscriptionLink: false
  519. header_extras: []
  520. # Example:
  521. # header_extras: [{text: "Some Page", url: "http://example.com/some/page", class: "subdued"}]
  522. recaptcha:
  523. disabled:
  524. invite: true
  525. register: true
  526. customisation: {}
  527. # templates: [{
  528. # name : "cv_or_resume",
  529. # url : "/templates/cv"
  530. # }, {
  531. # name : "cover_letter",
  532. # url : "/templates/cover-letters"
  533. # }, {
  534. # name : "journal_article",
  535. # url : "/templates/journals"
  536. # }, {
  537. # name : "presentation",
  538. # url : "/templates/presentations"
  539. # }, {
  540. # name : "thesis",
  541. # url : "/templates/thesis"
  542. # }, {
  543. # name : "bibliographies",
  544. # url : "/templates/bibliographies"
  545. # }, {
  546. # name : "view_all",
  547. # url : "/templates"
  548. # }]
  549. redirects:
  550. "/templates/index": "/templates/"
  551. reloadModuleViewsOnEachRequest: process.env['NODE_ENV'] == 'development'
  552. disableModule:
  553. 'user-activate': process.env['DISABLE_MODULE_USER_ACTIVATE'] == 'true'
  554. 'launchpad': process.env['DISABLE_MODULE_LAUNCHPAD'] == 'true'
  555. domainLicences: [
  556. ]
  557. sixpack:
  558. domain:""
  559. # ShareLaTeX Server Pro options (https://www.sharelatex.com/university/onsite.html)
  560. # ----------
  561. # LDAP
  562. # ----------
  563. # Settings below use a working LDAP test server kindly provided by forumsys.com
  564. # When testing with forumsys.com use username = einstein and password = password
  565. # ldap :
  566. # host: 'ldap://ldap.forumsys.com'
  567. # dn: 'uid=:userKey,dc=example,dc=com'
  568. # baseSearch: 'dc=example,dc=com'
  569. # filter: "(uid=:userKey)"
  570. # failMessage: 'LDAP User Fail'
  571. # fieldName: 'LDAP User'
  572. # placeholder: 'email@example.com'
  573. # emailAtt: 'mail'
  574. # anonymous: false
  575. # adminDN: 'cn=read-only-admin,dc=example,dc=com'
  576. # adminPW: 'password'
  577. # starttls: true
  578. # tlsOptions:
  579. # rejectUnauthorized: false
  580. # ca: ['/etc/ldap/ca_certs.pem']
  581. #templateLinks: [{
  582. # name : "CV projects",
  583. # url : "/templates/cv"
  584. #},{
  585. # name : "all projects",
  586. # url: "/templates/all"
  587. #}]
  588. rateLimit:
  589. autoCompile:
  590. everyone: process.env['RATE_LIMIT_AUTO_COMPILE_EVERYONE'] or 100
  591. standard: process.env['RATE_LIMIT_AUTO_COMPILE_STANDARD'] or 25
  592. analytics:
  593. enabled: process.env['ANALYTICS_ENABLED'] == 'true'
  594. # currentImage: "texlive-full:2017.1"
  595. # imageRoot: "<DOCKER REPOSITORY ROOT>" # without any trailing slash
  596. compileBodySizeLimitMb: process.env['COMPILE_BODY_SIZE_LIMIT_MB'] or 5
  597. textExtensions: defaultTextExtensions.concat(parseTextExtensions(process.env["ADDITIONAL_TEXT_EXTENSIONS"]))
  598. validRootDocExtensions: ['tex', 'Rtex', 'ltx']
  599. emailConfirmationDisabled: (process.env['EMAIL_CONFIRMATION_DISABLED'] == "true") or false
  600. # allowedImageNames: [
  601. # {imageName: 'texlive-full:2017.1', imageDesc: 'TeXLive 2017'}
  602. # {imageName: 'wl_texlive:2018.1', imageDesc: 'Legacy OL TeXLive 2015'}
  603. # {imageName: 'texlive-full:2016.1', imageDesc: 'Legacy SL TeXLive 2016'}
  604. # {imageName: 'texlive-full:2015.1', imageDesc: 'Legacy SL TeXLive 2015'}
  605. # {imageName: 'texlive-full:2014.2', imageDesc: 'Legacy SL TeXLive 2014.2'}
  606. # ]
  607. enabledServices: (process.env['ENABLED_SERVICES'] || 'web,api').split(',').map((s) => s.trim())
  608. # module options
  609. # ----------
  610. modules:
  611. sanitize:
  612. options:
  613. 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' ]
  614. allowedAttributes:
  615. 'a': [ 'href', 'name', 'target', 'class', 'event-tracking', 'event-tracking-ga', 'event-tracking-label', 'event-tracking-trigger' ]
  616. 'div': [ 'class', 'id', 'style' ]
  617. 'h1': [ 'class', 'id' ]
  618. 'h2': [ 'class', 'id' ]
  619. 'h3': [ 'class', 'id' ]
  620. 'h4': [ 'class', 'id' ]
  621. 'h5': [ 'class', 'id' ]
  622. 'h6': [ 'class', 'id' ]
  623. 'col': [ 'width' ]
  624. 'figure': [ 'class', 'id', 'style']
  625. 'figcaption': [ 'class', 'id', 'style']
  626. 'i': [ 'aria-hidden', 'aria-label', 'class', 'id' ]
  627. 'iframe': [ 'allowfullscreen', 'frameborder', 'height', 'src', 'style', 'width' ]
  628. 'img': [ 'alt', 'class', 'src', 'style' ]
  629. 'source': [ 'src', 'type' ]
  630. 'span': [ 'class', 'id', 'style' ]
  631. 'strong': [ 'style' ]
  632. 'table': [ 'border', 'class', 'id', 'style' ]
  633. 'td': [ 'colspan', 'rowspan', 'headers', 'style' ]
  634. 'th': [ 'abbr', 'headers', 'colspan', 'rowspan', 'scope', 'sorted', 'style' ]
  635. 'tr': [ 'class' ]
  636. 'video': [ 'alt', 'class', 'controls', 'height', 'width' ]
  637. overleafModuleImports: {
  638. # modules to import (an empty array for each set of modules)
  639. createFileModes: []
  640. gitBridge: []
  641. publishModal: []
  642. tprLinkedFileInfo: []
  643. tprLinkedFileRefreshError: []
  644. }
  645. csp: {
  646. percentage: parseFloat(process.env.CSP_PERCENTAGE) || 0
  647. enabled: process.env.CSP_ENABLED == 'true'
  648. reportOnly: process.env.CSP_REPORT_ONLY == 'true'
  649. reportPercentage: parseFloat(process.env.CSP_REPORT_PERCENTAGE) || 0
  650. reportUri: process.env.CSP_REPORT_URI
  651. exclude: [
  652. 'app/views/project/editor',
  653. 'app/views/project/list',
  654. ]
  655. }
  656. unsupportedBrowsers: {
  657. ie: '<=11'
  658. }