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.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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:
  12. process.env["WBO_HISTORY_DIR"] || path.join(app_root, "server-data"),
  13. /** Folder from which static files will be served */
  14. WEBROOT: process.env["WBO_WEBROOT"] || path.join(app_root, "client-data"),
  15. /** Number of milliseconds of inactivity after which the board should be saved to a file */
  16. SAVE_INTERVAL: parseInt(process.env["WBO_SAVE_INTERVAL"]) || 1000 * 2, // Save after 2 seconds of inactivity
  17. /** Periodicity at which the board should be saved when it is being actively used (milliseconds) */
  18. MAX_SAVE_DELAY: parseInt(process.env["WBO_MAX_SAVE_DELAY"]) || 1000 * 60, // Save after 60 seconds even if there is still activity
  19. /** Maximal number of items to keep in the board. When there are more items, the oldest ones are deleted */
  20. MAX_ITEM_COUNT: parseInt(process.env["WBO_MAX_ITEM_COUNT"]) || 32768,
  21. /** Max number of sub-items in an item. This prevents flooding */
  22. MAX_CHILDREN: parseInt(process.env["WBO_MAX_CHILDREN"]) || 192,
  23. /** Maximum value for any x or y on the board */
  24. MAX_BOARD_SIZE: parseInt(process.env["WBO_MAX_BOARD_SIZE"]) || 65536,
  25. /** Maximum messages per user over the given time period before banning them */
  26. MAX_EMIT_COUNT: parseInt(process.env["WBO_MAX_EMIT_COUNT"]) || 192,
  27. /** Duration after which the emit count is reset in miliseconds */
  28. MAX_EMIT_COUNT_PERIOD:
  29. parseInt(process.env["WBO_MAX_EMIT_COUNT_PERIOD"]) || 4096,
  30. /** Blocked Tools. A comma-separated list of tools that should not appear on boards. */
  31. BLOCKED_TOOLS: (process.env["WBO_BLOCKED_TOOLS"] || "").split(","),
  32. /** Selection Buttons. A comma-separated list of selection buttons that should not be available. */
  33. BLOCKED_SELECTION_BUTTONS: (process.env["WBO_BLOCKED_SELECTION_BUTTONS"] || "").split(","),
  34. /** Automatically switch to White-out on finger touch after drawing
  35. with Pencil using a stylus. Only supported on iPad with Apple Pencil. */
  36. AUTO_FINGER_WHITEOUT: process.env["AUTO_FINGER_WHITEOUT"] !== "disabled",
  37. /** If this variable is set, it should point to a statsd listener that will
  38. * receive WBO's monitoring information.
  39. * example: udp://127.0.0.1
  40. */
  41. STATSD_URL: process.env["STATSD_URL"],
  42. };