settings.defaults.coffee 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  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. id: 'subscription-page'
  229. active: process.env['SPLITTEST_SUBSCRIPTION_PAGE_ACTIVE'] == 'true'
  230. variants: [
  231. {
  232. id: 'new'
  233. rolloutPercent: parseInt(process.env['SPLITTEST_SUBSCRIPTION_PAGE_NEW_VARIANT_ROLLOUT_PERCENT'] || '0', 10)
  234. }
  235. ]
  236. }
  237. ]
  238. # cdn:
  239. # web:
  240. # host:"http://nowhere.sharelatex.dev"
  241. # darkHost:"http://cdn.sharelatex.dev:3000"
  242. # Where your instance of ShareLaTeX can be found publically. Used in emails
  243. # that are sent out, generated links, etc.
  244. siteUrl : siteUrl = process.env['PUBLIC_URL'] or 'http://localhost:3000'
  245. lockManager:
  246. lockTestInterval: intFromEnv('LOCK_MANAGER_LOCK_TEST_INTERVAL', 50)
  247. maxTestInterval: intFromEnv('LOCK_MANAGER_MAX_TEST_INTERVAL', 1000)
  248. maxLockWaitTime: intFromEnv('LOCK_MANAGER_MAX_LOCK_WAIT_TIME', 10000)
  249. redisLockExpiry: intFromEnv('LOCK_MANAGER_REDIS_LOCK_EXPIRY', 30)
  250. slowExecutionThreshold: intFromEnv('LOCK_MANAGER_SLOW_EXECUTION_THRESHOLD', 5000)
  251. # Used to close the editor off to users
  252. editorIsOpen: process.env['EDITOR_IS_OPEN'] or true
  253. # Optional separate location for websocket connections, if unset defaults to siteUrl.
  254. wsUrl: process.env['WEBSOCKET_URL']
  255. wsUrlV2: process.env['WEBSOCKET_URL_V2']
  256. wsUrlBeta: process.env['WEBSOCKET_URL_BETA']
  257. wsUrlV2Percentage: parseInt(process.env['WEBSOCKET_URL_V2_PERCENTAGE'] || '0', 10)
  258. wsRetryHandshake: parseInt(process.env['WEBSOCKET_RETRY_HANDSHAKE'] || '5', 10)
  259. # Compile UI rollout percentages
  260. logsUIPercentageBeta: parseInt(process.env['LOGS_UI_PERCENTAGE_BETA'] || '0', 10)
  261. logsUIPercentageWithoutPopupBeta: parseInt(process.env['LOGS_UI_WITHOUT_POPUP_PERCENTAGE_BETA'] || '0', 10)
  262. logsUIPercentage: parseInt(process.env['LOGS_UI_PERCENTAGE'] || '0', 10)
  263. logsUIPercentageWithoutPopup: parseInt(process.env['LOGS_UI_WITHOUT_POPUP_PERCENTAGE'] || '0', 10)
  264. # cookie domain
  265. # use full domain for cookies to only be accessible from that domain,
  266. # replace subdomain with dot to have them accessible on all subdomains
  267. cookieDomain: process.env['COOKIE_DOMAIN']
  268. cookieName: process.env['COOKIE_NAME'] or "sharelatex.sid"
  269. # this is only used if cookies are used for clsi backend
  270. #clsiCookieKey: "clsiserver"
  271. # Same, but with http auth credentials.
  272. httpAuthSiteUrl: "http://#{httpAuthUser}:#{httpAuthPass}@#{siteUrl}"
  273. robotsNoindex: (process.env['ROBOTS_NOINDEX'] == "true") or false
  274. maxEntitiesPerProject: 2000
  275. maxUploadSize: 50 * 1024 * 1024 # 50 MB
  276. # start failing the health check if active handles exceeds this limit
  277. maxActiveHandles: if process.env['MAX_ACTIVE_HANDLES'] then parseInt(process.env['MAX_ACTIVE_HANDLES'], 10)
  278. # Security
  279. # --------
  280. security:
  281. sessionSecret: sessionSecret
  282. bcryptRounds: (parseInt(process.env['BCRYPT_ROUNDS'], 10) || 12) # number of rounds used to hash user passwords (raised to power 2)
  283. httpAuthUsers: httpAuthUsers
  284. twoFactorAuthentication:
  285. enabled: process.env['TWO_FACTOR_AUTHENTICATION_ENABLED'] == 'true'
  286. requiredForStaff: process.env['TWO_FACTOR_AUTHENTICATION_REQUIRED_FOR_STAFF'] == 'true'
  287. jwt:
  288. key: process.env['OT_JWT_AUTH_KEY']
  289. algorithm: process.env['OT_JWT_AUTH_ALG'] || 'HS256'
  290. # Default features
  291. # ----------------
  292. #
  293. # You can select the features that are enabled by default for new
  294. # new users.
  295. defaultFeatures: defaultFeatures =
  296. collaborators: -1
  297. dropbox: true
  298. github: true
  299. gitBridge: true
  300. versioning: true
  301. compileTimeout: 180
  302. compileGroup: "standard"
  303. references: true
  304. templates: true
  305. trackChanges: true
  306. features:
  307. personal: defaultFeatures
  308. plans: plans = [{
  309. planCode: "personal"
  310. name: "Personal"
  311. price: 0
  312. features: defaultFeatures
  313. }]
  314. enableSubscriptions:false
  315. enabledLinkedFileTypes: (process.env['ENABLED_LINKED_FILE_TYPES'] or '').split(',')
  316. # i18n
  317. # ------
  318. #
  319. i18n:
  320. checkForHTMLInVars: process.env['I18N_CHECK_FOR_HTML_IN_VARS'] == 'true'
  321. escapeHTMLInVars: process.env['I18N_ESCAPE_HTML_IN_VARS'] == 'true'
  322. subdomainLang:
  323. www: {lngCode:"en", url: siteUrl}
  324. defaultLng: "en"
  325. # Spelling languages
  326. # ------------------
  327. #
  328. # You must have the corresponding aspell package installed to
  329. # be able to use a language.
  330. languages: [
  331. {code: "en", name: "English"},
  332. {code: "en_US", name: "English (American)"},
  333. {code: "en_GB", name: "English (British)"},
  334. {code: "en_CA", name: "English (Canadian)"},
  335. {code: "af", name: "Afrikaans"},
  336. {code: "ar", name: "Arabic"},
  337. {code: "gl", name: "Galician"},
  338. {code: "eu", name: "Basque"},
  339. {code: "br", name: "Breton"},
  340. {code: "bg", name: "Bulgarian"},
  341. {code: "ca", name: "Catalan"},
  342. {code: "hr", name: "Croatian"},
  343. {code: "cs", name: "Czech"},
  344. {code: "da", name: "Danish"},
  345. {code: "nl", name: "Dutch"},
  346. {code: "eo", name: "Esperanto"},
  347. {code: "et", name: "Estonian"},
  348. {code: "fo", name: "Faroese"},
  349. {code: "fr", name: "French"},
  350. {code: "de", name: "German"},
  351. {code: "el", name: "Greek"},
  352. {code: "id", name: "Indonesian"},
  353. {code: "ga", name: "Irish"},
  354. {code: "it", name: "Italian"},
  355. {code: "kk", name: "Kazakh"},
  356. {code: "ku", name: "Kurdish"},
  357. {code: "lv", name: "Latvian"},
  358. {code: "lt", name: "Lithuanian"},
  359. {code: "nr", name: "Ndebele"},
  360. {code: "ns", name: "Northern Sotho"},
  361. {code: "no", name: "Norwegian"},
  362. {code: "fa", name: "Persian"},
  363. {code: "pl", name: "Polish"},
  364. {code: "pt_BR", name: "Portuguese (Brazilian)"},
  365. {code: "pt_PT", name: "Portuguese (European)"},
  366. {code: "pa", name: "Punjabi"},
  367. {code: "ro", name: "Romanian"},
  368. {code: "ru", name: "Russian"},
  369. {code: "sk", name: "Slovak"},
  370. {code: "sl", name: "Slovenian"},
  371. {code: "st", name: "Southern Sotho"},
  372. {code: "es", name: "Spanish"},
  373. {code: "sv", name: "Swedish"},
  374. {code: "tl", name: "Tagalog"},
  375. {code: "ts", name: "Tsonga"},
  376. {code: "tn", name: "Tswana"},
  377. {code: "hsb", name: "Upper Sorbian"},
  378. {code: "cy", name: "Welsh"},
  379. {code: "xh", name: "Xhosa"}
  380. ]
  381. # Password Settings
  382. # -----------
  383. # These restrict the passwords users can use when registering
  384. # opts are from http://antelle.github.io/passfield
  385. # passwordStrengthOptions:
  386. # pattern: "aA$3"
  387. # length:
  388. # min: 6
  389. # max: 128
  390. # Email support
  391. # -------------
  392. #
  393. # ShareLaTeX uses nodemailer (http://www.nodemailer.com/) to send transactional emails.
  394. # To see the range of transport and options they support, see http://www.nodemailer.com/docs/transports
  395. #email:
  396. # fromAddress: ""
  397. # replyTo: ""
  398. # lifecycle: false
  399. ## Example transport and parameter settings for Amazon SES
  400. # transport: "SES"
  401. # parameters:
  402. # AWSAccessKeyID: ""
  403. # AWSSecretKey: ""
  404. # Third party services
  405. # --------------------
  406. #
  407. # ShareLaTeX's regular newsletter is managed by mailchimp. Add your
  408. # credentials here to integrate with this.
  409. # mailchimp:
  410. # api_key: ""
  411. # list_id: ""
  412. #
  413. # Fill in your unique token from various analytics services to enable
  414. # them.
  415. # analytics:
  416. # ga:
  417. # token: ""
  418. # gaOptimize:
  419. # id: ""
  420. # ShareLaTeX's help desk is provided by tenderapp.com
  421. # tenderUrl: ""
  422. #
  423. # Client-side error logging is provided by getsentry.com
  424. sentry:
  425. environment: process.env['SENTRY_ENVIRONMENT']
  426. release: process.env['SENTRY_RELEASE']
  427. # publicDSN: ""
  428. # The publicDSN is the token for the client-side getSentry service.
  429. # Production Settings
  430. # -------------------
  431. debugPugTemplates: process.env['DEBUG_PUG_TEMPLATES'] == 'true'
  432. 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'
  433. # Should javascript assets be served minified or not. Note that you will
  434. # need to run `grunt compile:minify` within the web-sharelatex directory
  435. # to generate these.
  436. useMinifiedJs: process.env['MINIFIED_JS'] == 'true' or false
  437. # Should static assets be sent with a header to tell the browser to cache
  438. # them.
  439. cacheStaticAssets: false
  440. # If you are running ShareLaTeX over https, set this to true to send the
  441. # cookie with a secure flag (recommended).
  442. secureCookie: false
  443. # 'SameSite' cookie setting. Can be set to 'lax', 'none' or 'strict'
  444. # 'lax' is recommended, as 'strict' will prevent people linking to projects
  445. # https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
  446. sameSiteCookie: 'lax'
  447. # If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc)
  448. # then set this to true to allow it to correctly detect the forwarded IP
  449. # address and http/https protocol information.
  450. behindProxy: false
  451. # Expose the hostname in the `X-Served-By` response header
  452. exposeHostname: process.env['EXPOSE_HOSTNAME'] == 'true'
  453. # Cookie max age (in milliseconds). Set to false for a browser session.
  454. cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
  455. # When true, only allow invites to be sent to email addresses that
  456. # already have user accounts
  457. restrictInvitesToExistingAccounts: false
  458. # Should we allow access to any page without logging in? This includes
  459. # public projects, /learn, /templates, about pages, etc.
  460. allowPublicAccess: if process.env["SHARELATEX_ALLOW_PUBLIC_ACCESS"] == 'true' then true else false
  461. enableHomepage: process.env["HOME_PAGE_ENABLED"] == 'true'
  462. # editor should be open by default
  463. editorIsOpen: if process.env["EDITOR_OPEN"] == 'false' then false else true
  464. # site should be open by default
  465. siteIsOpen: if process.env["SITE_OPEN"] == 'false' then false else true
  466. # Use a single compile directory for all users in a project
  467. # (otherwise each user has their own directory)
  468. # disablePerUserCompiles: true
  469. # Domain the client (pdfjs) should download the compiled pdf from
  470. pdfDownloadDomain: process.env["PDF_DOWNLOAD_DOMAIN"] #"http://clsi-lb:3014"
  471. # By default turn on feature flag, can be overridden per request.
  472. enablePdfCaching: process.env["ENABLE_PDF_CACHING"] == "true"
  473. # Maximum size of text documents in the real-time editing system.
  474. max_doc_length: 2 * 1024 * 1024 # 2mb
  475. # Maximum JSON size in HTTP requests
  476. # We should be able to process twice the max doc length, to allow for
  477. # - the doc content
  478. # - text ranges spanning the whole doc
  479. #
  480. # There's also overhead required for the JSON encoding and the UTF-8 encoding,
  481. # theoretically up to 3 times the max doc length. On the other hand, we don't
  482. # want to block the event loop with JSON parsing, so we try to find a
  483. # practical compromise.
  484. max_json_request_size: parseInt(process.env["MAX_JSON_REQUEST_SIZE"]) || 6 * 1024 * 1024 # 6 MB
  485. # Internal configs
  486. # ----------------
  487. path:
  488. # If we ever need to write something to disk (e.g. incoming requests
  489. # that need processing but may be too big for memory, then write
  490. # them to disk here).
  491. dumpFolder: "./data/dumpFolder"
  492. uploadFolder: "./data/uploads"
  493. # Automatic Snapshots
  494. # -------------------
  495. automaticSnapshots:
  496. # How long should we wait after the user last edited to
  497. # take a snapshot?
  498. waitTimeAfterLastEdit: 5 * minutes
  499. # Even if edits are still taking place, this is maximum
  500. # time to wait before taking another snapshot.
  501. maxTimeBetweenSnapshots: 30 * minutes
  502. # Smoke test
  503. # ----------
  504. # Provide log in credentials and a project to be able to run
  505. # some basic smoke tests to check the core functionality.
  506. #
  507. smokeTest:
  508. user: process.env['SMOKE_TEST_USER']
  509. userId: process.env['SMOKE_TEST_USER_ID']
  510. password: process.env['SMOKE_TEST_PASSWORD']
  511. projectId: process.env['SMOKE_TEST_PROJECT_ID']
  512. rateLimitSubject: process.env['SMOKE_TEST_RATE_LIMIT_SUBJECT'] or "127.0.0.1"
  513. stepTimeout: parseInt(process.env['SMOKE_TEST_STEP_TIMEOUT'] or "10000", 10)
  514. appName: process.env['APP_NAME'] or "ShareLaTeX (Community Edition)"
  515. adminEmail: process.env['ADMIN_EMAIL'] or "placeholder@example.com"
  516. adminDomains: JSON.parse(process.env['ADMIN_DOMAINS'] or 'null')
  517. salesEmail: process.env['SALES_EMAIL'] or "placeholder@example.com"
  518. statusPageUrl: process.env['OVERLEAF_STATUS_URL'] or "status.overleaf.com"
  519. nav:
  520. title: "ShareLaTeX Community Edition"
  521. left_footer: [{
  522. text: "Powered by <a href='https://www.sharelatex.com'>ShareLaTeX</a> © 2016"
  523. }]
  524. right_footer: [{
  525. text: "<i class='fa fa-github-square'></i> Fork on Github!"
  526. url: "https://github.com/sharelatex/sharelatex"
  527. }]
  528. showSubscriptionLink: false
  529. header_extras: []
  530. # Example:
  531. # header_extras: [{text: "Some Page", url: "http://example.com/some/page", class: "subdued"}]
  532. recaptcha:
  533. disabled:
  534. invite: true
  535. register: true
  536. customisation: {}
  537. # templates: [{
  538. # name : "cv_or_resume",
  539. # url : "/templates/cv"
  540. # }, {
  541. # name : "cover_letter",
  542. # url : "/templates/cover-letters"
  543. # }, {
  544. # name : "journal_article",
  545. # url : "/templates/journals"
  546. # }, {
  547. # name : "presentation",
  548. # url : "/templates/presentations"
  549. # }, {
  550. # name : "thesis",
  551. # url : "/templates/thesis"
  552. # }, {
  553. # name : "bibliographies",
  554. # url : "/templates/bibliographies"
  555. # }, {
  556. # name : "view_all",
  557. # url : "/templates"
  558. # }]
  559. redirects:
  560. "/templates/index": "/templates/"
  561. reloadModuleViewsOnEachRequest: process.env['NODE_ENV'] == 'development'
  562. disableModule:
  563. 'user-activate': process.env['DISABLE_MODULE_USER_ACTIVATE'] == 'true'
  564. 'launchpad': process.env['DISABLE_MODULE_LAUNCHPAD'] == 'true'
  565. domainLicences: [
  566. ]
  567. sixpack:
  568. domain:""
  569. # ShareLaTeX Server Pro options (https://www.sharelatex.com/university/onsite.html)
  570. # ----------
  571. # LDAP
  572. # ----------
  573. # Settings below use a working LDAP test server kindly provided by forumsys.com
  574. # When testing with forumsys.com use username = einstein and password = password
  575. # ldap :
  576. # host: 'ldap://ldap.forumsys.com'
  577. # dn: 'uid=:userKey,dc=example,dc=com'
  578. # baseSearch: 'dc=example,dc=com'
  579. # filter: "(uid=:userKey)"
  580. # failMessage: 'LDAP User Fail'
  581. # fieldName: 'LDAP User'
  582. # placeholder: 'email@example.com'
  583. # emailAtt: 'mail'
  584. # anonymous: false
  585. # adminDN: 'cn=read-only-admin,dc=example,dc=com'
  586. # adminPW: 'password'
  587. # starttls: true
  588. # tlsOptions:
  589. # rejectUnauthorized: false
  590. # ca: ['/etc/ldap/ca_certs.pem']
  591. #templateLinks: [{
  592. # name : "CV projects",
  593. # url : "/templates/cv"
  594. #},{
  595. # name : "all projects",
  596. # url: "/templates/all"
  597. #}]
  598. rateLimit:
  599. autoCompile:
  600. everyone: process.env['RATE_LIMIT_AUTO_COMPILE_EVERYONE'] or 100
  601. standard: process.env['RATE_LIMIT_AUTO_COMPILE_STANDARD'] or 25
  602. analytics:
  603. enabled: process.env['ANALYTICS_ENABLED'] == 'true'
  604. # currentImage: "texlive-full:2017.1"
  605. # imageRoot: "<DOCKER REPOSITORY ROOT>" # without any trailing slash
  606. compileBodySizeLimitMb: process.env['COMPILE_BODY_SIZE_LIMIT_MB'] or 5
  607. textExtensions: defaultTextExtensions.concat(parseTextExtensions(process.env["ADDITIONAL_TEXT_EXTENSIONS"]))
  608. validRootDocExtensions: ['tex', 'Rtex', 'ltx']
  609. emailConfirmationDisabled: (process.env['EMAIL_CONFIRMATION_DISABLED'] == "true") or false
  610. # allowedImageNames: [
  611. # {imageName: 'texlive-full:2017.1', imageDesc: 'TeXLive 2017'}
  612. # {imageName: 'wl_texlive:2018.1', imageDesc: 'Legacy OL TeXLive 2015'}
  613. # {imageName: 'texlive-full:2016.1', imageDesc: 'Legacy SL TeXLive 2016'}
  614. # {imageName: 'texlive-full:2015.1', imageDesc: 'Legacy SL TeXLive 2015'}
  615. # {imageName: 'texlive-full:2014.2', imageDesc: 'Legacy SL TeXLive 2014.2'}
  616. # ]
  617. enabledServices: (process.env['ENABLED_SERVICES'] || 'web,api').split(',').map((s) => s.trim())
  618. # module options
  619. # ----------
  620. modules:
  621. sanitize:
  622. options:
  623. 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' ]
  624. allowedAttributes:
  625. 'a': [ 'href', 'name', 'target', 'class', 'event-tracking', 'event-tracking-ga', 'event-tracking-label', 'event-tracking-trigger' ]
  626. 'div': [ 'class', 'id', 'style' ]
  627. 'h1': [ 'class', 'id' ]
  628. 'h2': [ 'class', 'id' ]
  629. 'h3': [ 'class', 'id' ]
  630. 'h4': [ 'class', 'id' ]
  631. 'h5': [ 'class', 'id' ]
  632. 'h6': [ 'class', 'id' ]
  633. 'col': [ 'width' ]
  634. 'figure': [ 'class', 'id', 'style']
  635. 'figcaption': [ 'class', 'id', 'style']
  636. 'i': [ 'aria-hidden', 'aria-label', 'class', 'id' ]
  637. 'iframe': [ 'allowfullscreen', 'frameborder', 'height', 'src', 'style', 'width' ]
  638. 'img': [ 'alt', 'class', 'src', 'style' ]
  639. 'source': [ 'src', 'type' ]
  640. 'span': [ 'class', 'id', 'style' ]
  641. 'strong': [ 'style' ]
  642. 'table': [ 'border', 'class', 'id', 'style' ]
  643. 'td': [ 'colspan', 'rowspan', 'headers', 'style' ]
  644. 'th': [ 'abbr', 'headers', 'colspan', 'rowspan', 'scope', 'sorted', 'style' ]
  645. 'tr': [ 'class' ]
  646. 'video': [ 'alt', 'class', 'controls', 'height', 'width' ]
  647. overleafModuleImports: {
  648. # modules to import (an empty array for each set of modules)
  649. createFileModes: []
  650. gitBridge: []
  651. publishModal: []
  652. tprLinkedFileInfo: []
  653. tprLinkedFileRefreshError: []
  654. }
  655. csp: {
  656. percentage: parseFloat(process.env.CSP_PERCENTAGE) || 0
  657. enabled: process.env.CSP_ENABLED == 'true'
  658. reportOnly: process.env.CSP_REPORT_ONLY == 'true'
  659. reportPercentage: parseFloat(process.env.CSP_REPORT_PERCENTAGE) || 0
  660. reportUri: process.env.CSP_REPORT_URI
  661. exclude: [
  662. 'app/views/project/editor',
  663. 'app/views/project/list',
  664. ]
  665. }
  666. unsupportedBrowsers: {
  667. ie: '<=11'
  668. }