schema.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. const convict = require('convict');
  2. module.exports = convict({
  3. logger: {
  4. level: {
  5. doc: 'The log level. See log4js',
  6. format: [
  7. 'ALL',
  8. 'MARK',
  9. 'TRACE',
  10. 'DEBUG',
  11. 'INFO',
  12. 'WARN',
  13. 'ERROR',
  14. 'FATAL',
  15. 'OFF'
  16. ],
  17. default: 'ERROR',
  18. env: 'LOG_LEVEL',
  19. arg: 'logLevel'
  20. }
  21. },
  22. env: {
  23. doc: 'The application environment.',
  24. format: ['prod', 'dev', 'test'],
  25. default: 'dev',
  26. env: 'NODE_ENV'
  27. },
  28. host: {
  29. doc: 'The host to bind.',
  30. format: '*',
  31. default: '0.0.0.0',
  32. env: 'HOST',
  33. arg: 'host'
  34. },
  35. port: {
  36. doc: 'The port to bind.',
  37. format: 'port',
  38. default: 9000,
  39. env: 'PORT',
  40. arg: 'port'
  41. },
  42. expire_timeout: {
  43. doc: 'The timeout before EXPIRE message send',
  44. format: 'duration',
  45. default: 5000,
  46. arg: 'expireTimeout'
  47. },
  48. key: {
  49. doc: 'The key to check incoming clients',
  50. format: String,
  51. default: 'peerjs',
  52. env: 'APP_KEY',
  53. arg: 'key'
  54. },
  55. path: {
  56. doc: '',
  57. format: String,
  58. default: '/myapp',
  59. env: 'APP_PATH',
  60. arg: 'path'
  61. },
  62. concurrent_limit: {
  63. doc: 'Max connections',
  64. format: 'duration',
  65. default: 5000,
  66. arg: 'concurrentLimit'
  67. },
  68. allow_discovery: {
  69. doc: 'Allow discovery of peers',
  70. format: Boolean,
  71. default: false,
  72. arg: 'allowDiscovery'
  73. },
  74. proxied: {
  75. doc: 'Set true if server running behind proxy',
  76. format: Boolean,
  77. default: false,
  78. env: 'APP_PROXIED',
  79. arg: 'proxied'
  80. },
  81. cleanup_out_msgs: {
  82. doc: 'The period in ms to check expired messages',
  83. format: 'duration',
  84. default: 1000
  85. },
  86. ssl: {
  87. key_path: {
  88. doc: 'The path to the private key file',
  89. format: String,
  90. default: '',
  91. arg: 'sslKeyPath'
  92. },
  93. cert_path: {
  94. doc: 'The path to the cert file',
  95. format: String,
  96. default: '',
  97. arg: 'sslCertPath'
  98. }
  99. }
  100. });