From f3488b1af349fb79064f397153560e73e38dcddd Mon Sep 17 00:00:00 2001 From: alexn707 Date: Fri, 28 Feb 2025 08:55:48 +0300 Subject: [PATCH] Update config.js --- src/config.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/config.js b/src/config.js index 72314ae1..f811266a 100644 --- a/src/config.js +++ b/src/config.js @@ -45,3 +45,17 @@ module.exports.UI_ENABLE_SORT_CLIENTS = process.env.UI_ENABLE_SORT_CLIENTS || 'f module.exports.WG_ENABLE_EXPIRES_TIME = process.env.WG_ENABLE_EXPIRES_TIME || 'false'; module.exports.ENABLE_PROMETHEUS_METRICS = process.env.ENABLE_PROMETHEUS_METRICS || 'false'; module.exports.PROMETHEUS_METRICS_PASSWORD = process.env.PROMETHEUS_METRICS_PASSWORD; + +const getRandomInt = (min, max) => min + Math.floor(Math.random() * (max - min)); +const getRandomJunkSize = () => getRandomInt(15, 150); +const getRandomHeader = () => getRandomInt(1, 2_147_483_647); + +module.exports.JC = process.env.JC || getRandomInt(3, 10); +module.exports.JMIN = process.env.JMIN || 10; +module.exports.JMAX = process.env.JMAX || 50; +module.exports.S1 = process.env.S1 || getRandomJunkSize(); +module.exports.S2 = process.env.S2 || getRandomJunkSize(); +module.exports.H1 = process.env.H1 || getRandomHeader(); +module.exports.H2 = process.env.H2 || getRandomHeader(); +module.exports.H3 = process.env.H3 || getRandomHeader(); +module.exports.H4 = process.env.H4 || getRandomHeader();