You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configuration.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const path = require("path");
  2. const app_root = path.dirname(__dirname); // Parent of the directory where this file is
  3. module.exports = {
  4. /** Port on which the application will listen */
  5. PORT: parseInt(process.env['PORT']) || 8080,
  6. /** Host on which the application will listen (defaults to undefined,
  7. hence listen on all interfaces on all IP addresses, but could also be
  8. '127.0.0.1' **/
  9. HOST: process.env['HOST'] || undefined,
  10. /** Path to the directory where boards will be saved by default */
  11. HISTORY_DIR: process.env['WBO_HISTORY_DIR'] || path.join(app_root, "server-data"),
  12. /** Folder from which static files will be served */
  13. WEBROOT: process.env['WBO_WEBROOT'] || path.join(app_root, "client-data"),
  14. /** Number of milliseconds of inactivity after which the board should be saved to a file */
  15. SAVE_INTERVAL: parseInt(process.env['WBO_SAVE_INTERVAL']) || 1000 * 2, // Save after 2 seconds of inactivity
  16. /** Periodicity at which the board should be saved when it is being actively used (milliseconds) */
  17. MAX_SAVE_DELAY: parseInt(process.env['WBO_MAX_SAVE_DELAY']) || 1000 * 60, // Save after 60 seconds even if there is still activity
  18. /** Maximal number of items to keep in the board. When there are more items, the oldest ones are deleted */
  19. MAX_ITEM_COUNT: parseInt(process.env['WBO_MAX_ITEM_COUNT']) || 32768,
  20. /** Max number of sub-items in an item. This prevents flooding */
  21. MAX_CHILDREN: parseInt(process.env['WBO_MAX_CHILDREN']) || 192,
  22. /** Maximum value for any x or y on the board */
  23. MAX_BOARD_SIZE: parseInt(process.env['WBO_MAX_BOARD_SIZE']) || 65536,
  24. /** Maximum messages per user over the given time period before banning them */
  25. MAX_EMIT_COUNT: parseInt(process.env['WBO_MAX_EMIT_COUNT']) || 192,
  26. /** Duration after which the emit count is reset in miliseconds */
  27. MAX_EMIT_COUNT_PERIOD: parseInt(process.env['WBO_MAX_EMIT_COUNT_PERIOD']) || 4096,
  28. /** Blocked Tools. A comma-separated list of tools that should not appear on boards. */
  29. BLOCKED_TOOLS: (process.env['WBO_BLOCKED_TOOLS'] || "").split(','),
  30. };