settings.defaults.coffee 22 KB

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