config.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var config = {
  2. avatars: {
  3. // for avatars
  4. min_size: parseInt(process.env.AVATAR_MIN) || 1,
  5. // for avatars; large values might lead to slow response time or DoS
  6. max_size: parseInt(process.env.AVATAR_MAX) || 512,
  7. // for avatars; size to be used when no size given
  8. default_size: parseInt(process.env.AVATAR_DEFAULT) || 160
  9. },
  10. renders: {
  11. // for 3D rendered skins
  12. min_scale: parseInt(process.env.RENDER_MIN) || 1,
  13. // for 3D rendered skins; large values might lead to slow response time or DoS
  14. max_scale: parseInt(process.env.RENDER_MAX) || 10,
  15. // for 3D rendered skins; scale to be used when no scale given
  16. default_scale: parseInt(process.env.RENDER_DEFAULT) || 6
  17. },
  18. directories: {
  19. // directory where faces are kept. must have trailing "/"
  20. faces: process.env.FACE_DIR || "./images/faces/",
  21. // directory where helms are kept. must have trailing "/"
  22. helms: process.env.HELM_DIR || "./images/helms/",
  23. // directory where skins are kept. must have trailing "/"
  24. skins: process.env.SKIN_DIR || "./images/skins/",
  25. // directory where rendered skins are kept. must have trailing "/"
  26. renders: process.env.RENDER_DIR || "./images/renders/",
  27. // directory where capes are kept. must have trailing "/"
  28. capes: process.env.CAPE_DIR || "./images/capes/"
  29. },
  30. caching: {
  31. // seconds until we will check if user's skin changed.
  32. // Should be > 60 to comply with Mojang's rate limit
  33. local: parseInt(process.env.CACHE_LOCAL) || 1200,
  34. // seconds until browser will request image again
  35. browser: parseInt(process.env.CACHE_BROWSER) || 3600,
  36. // If true, redis is flushed on start.
  37. // Use this to avoid issues when you have a persistent redis database but an ephemeral storage
  38. ephemeral: process.env.EPHEMERAL_STORAGE === "true",
  39. // Used for information on the front page
  40. cloudflare: process.env.CLOUDFLARE === "true"
  41. },
  42. // URL of your redis server
  43. redis: process.env.REDIS_URL || 'redis://localhost:6379',
  44. server: {
  45. // port to listen on
  46. port: parseInt(process.env.PORT) || 3000,
  47. // IP address to listen on
  48. bind: process.env.BIND || "0.0.0.0",
  49. // ms until connection to Mojang is dropped
  50. http_timeout: parseInt(process.env.EXTERNAL_HTTP_TIMEOUT) || 2000,
  51. // enables logging.debug & editing index page
  52. debug_enabled: process.env.DEBUG === "true",
  53. // set to false if you use an external logger that provides timestamps,
  54. log_time: process.env.LOG_TIME === "true",
  55. // rate limit per second for outgoing requests to the Mojang session server
  56. // requests exceeding this limit are skipped and considered failed
  57. sessions_rate_limit: parseInt(process.env.SESSIONS_RATE_LIMIT)
  58. },
  59. sponsor: {
  60. sidebar: process.env.SPONSOR_SIDE,
  61. top_right: process.env.SPONSOR_TOP_RIGHT
  62. },
  63. };
  64. module.exports = config;