mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-10-04 14:39:19 +08:00
feature: Add an option to enable Telegram to work behind a proxy. (#6125)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
469
package-lock.json
generated
469
package-lock.json
generated
@@ -73,6 +73,7 @@
|
||||
"prometheus-api-metrics": "~3.2.1",
|
||||
"promisify-child-process": "~4.1.2",
|
||||
"protobufjs": "~7.2.4",
|
||||
"proxy-agent": "^5.0.0",
|
||||
"qs": "~6.10.4",
|
||||
"redbean-node": "~0.3.0",
|
||||
"redis": "~4.5.1",
|
||||
@@ -4346,7 +4347,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
|
||||
"integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
@@ -5294,7 +5294,6 @@
|
||||
"version": "8.15.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
|
||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
@@ -5313,6 +5312,18 @@
|
||||
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.3.4",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",
|
||||
"integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"acorn": "^8.11.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/aedes": {
|
||||
"version": "0.46.3",
|
||||
"resolved": "https://registry.npmjs.org/aedes/-/aedes-0.46.3.tgz",
|
||||
@@ -5778,6 +5789,18 @@
|
||||
"integrity": "sha512-CbNem/7hxrjSiOAOOTX4iZxu+0m3jiLqlsERQwwPM1IDR/22M8IPpA1VVndCLw5KtjRYyRODbvAEIfuTogNDng==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ast-types": {
|
||||
"version": "0.13.4",
|
||||
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz",
|
||||
"integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/astral-regex": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
|
||||
@@ -7454,6 +7477,15 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/data-uri-to-buffer": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz",
|
||||
"integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/data-view-buffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
|
||||
@@ -7629,7 +7661,6 @@
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
||||
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/default-browser": {
|
||||
@@ -7715,6 +7746,21 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/degenerator": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/degenerator/-/degenerator-3.0.4.tgz",
|
||||
"integrity": "sha512-Z66uPeBfHZAHVmue3HPfyKu2Q0rC2cRxbTOsvmU/po5fvvcx27W4mIu9n0PUlQih4oUYvcG1BsbtVv8x7KDOSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ast-types": "^0.13.2",
|
||||
"escodegen": "^1.8.1",
|
||||
"esprima": "^4.0.0",
|
||||
"vm2": "^3.9.17"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/delay": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
|
||||
@@ -8521,6 +8567,97 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen": {
|
||||
"version": "1.14.3",
|
||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
|
||||
"integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"esprima": "^4.0.1",
|
||||
"estraverse": "^4.2.0",
|
||||
"esutils": "^2.0.2",
|
||||
"optionator": "^0.8.1"
|
||||
},
|
||||
"bin": {
|
||||
"escodegen": "bin/escodegen.js",
|
||||
"esgenerate": "bin/esgenerate.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"source-map": "~0.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen/node_modules/estraverse": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
||||
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen/node_modules/levn": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
|
||||
"integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"prelude-ls": "~1.1.2",
|
||||
"type-check": "~0.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen/node_modules/optionator": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
||||
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"deep-is": "~0.1.3",
|
||||
"fast-levenshtein": "~2.0.6",
|
||||
"levn": "~0.3.0",
|
||||
"prelude-ls": "~1.1.2",
|
||||
"type-check": "~0.3.2",
|
||||
"word-wrap": "~1.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen/node_modules/prelude-ls": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
|
||||
"integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen/node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"license": "BSD-3-Clause",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen/node_modules/type-check": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
|
||||
"integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"prelude-ls": "~1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.14.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.14.0.tgz",
|
||||
@@ -8730,6 +8867,19 @@
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/esprima": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
|
||||
"license": "BSD-2-Clause",
|
||||
"bin": {
|
||||
"esparse": "bin/esparse.js",
|
||||
"esvalidate": "bin/esvalidate.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/esquery": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz",
|
||||
@@ -8777,7 +8927,6 @@
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
@@ -9049,7 +9198,6 @@
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
|
||||
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-uri": {
|
||||
@@ -9187,6 +9335,15 @@
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/file-uri-to-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz",
|
||||
"integrity": "sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
@@ -9492,6 +9649,42 @@
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ftp": {
|
||||
"version": "0.3.10",
|
||||
"resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz",
|
||||
"integrity": "sha512-faFVML1aBx2UoDStmLwv2Wptt4vw5x03xxX172nhA5Y5HBshW5JweqQ2W4xL4dezQTG8inJsuYcpPHHU3X5OTQ==",
|
||||
"dependencies": {
|
||||
"readable-stream": "1.1.x",
|
||||
"xregexp": "2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ftp/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ftp/node_modules/readable-stream": {
|
||||
"version": "1.1.14",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
||||
"integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.1",
|
||||
"isarray": "0.0.1",
|
||||
"string_decoder": "~0.10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/ftp/node_modules/string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
||||
"integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
@@ -9876,6 +10069,55 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-uri": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz",
|
||||
"integrity": "sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "1",
|
||||
"data-uri-to-buffer": "3",
|
||||
"debug": "4",
|
||||
"file-uri-to-path": "2",
|
||||
"fs-extra": "^8.1.0",
|
||||
"ftp": "^0.3.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/get-uri/node_modules/fs-extra": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
|
||||
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^4.0.0",
|
||||
"universalify": "^0.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6 <7 || >=8"
|
||||
}
|
||||
},
|
||||
"node_modules/get-uri/node_modules/jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
"integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
|
||||
"license": "MIT",
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/get-uri/node_modules/universalify": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
|
||||
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/getopts": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/getopts/-/getopts-2.3.0.tgz",
|
||||
@@ -10083,7 +10325,6 @@
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"devOptional": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/graphemer": {
|
||||
@@ -10552,6 +10793,12 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/ip": {
|
||||
"version": "1.1.9",
|
||||
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz",
|
||||
"integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ip-address": {
|
||||
"version": "10.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz",
|
||||
@@ -12560,6 +12807,15 @@
|
||||
"smart-buffer": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/netmask": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",
|
||||
"integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz",
|
||||
@@ -13138,6 +13394,93 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/pac-proxy-agent": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz",
|
||||
"integrity": "sha512-CcFG3ZtnxO8McDigozwE3AqAw15zDvGH+OjXO4kzf7IkEKkQ4gxQ+3sdF50WmhQ4P/bVusXcqNE2S3XrNURwzQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "1",
|
||||
"agent-base": "6",
|
||||
"debug": "4",
|
||||
"get-uri": "3",
|
||||
"http-proxy-agent": "^4.0.1",
|
||||
"https-proxy-agent": "5",
|
||||
"pac-resolver": "^5.0.0",
|
||||
"raw-body": "^2.2.0",
|
||||
"socks-proxy-agent": "5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/pac-proxy-agent/node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pac-proxy-agent/node_modules/http-proxy-agent": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
|
||||
"integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "1",
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/pac-proxy-agent/node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/pac-proxy-agent/node_modules/socks-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^6.0.2",
|
||||
"debug": "4",
|
||||
"socks": "^2.3.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/pac-resolver": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-5.0.1.tgz",
|
||||
"integrity": "sha512-cy7u00ko2KVgBAjuhevqpPeHIkCIqPe1v24cydhWjmeuzaBfmUWFCZJ1iAh5TuVzVZoUzXIW7K8sMYOZ84uZ9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"degenerator": "^3.0.2",
|
||||
"ip": "^1.1.5",
|
||||
"netmask": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/package-json-from-dist": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
|
||||
@@ -13909,6 +14252,93 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-agent": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-5.0.0.tgz",
|
||||
"integrity": "sha512-gkH7BkvLVkSfX9Dk27W6TyNOWWZWRilRfk1XxGNWOYJ2TuedAv1yFpCaU9QSBmBe716XOTNpYNOzhysyw8xn7g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^6.0.0",
|
||||
"debug": "4",
|
||||
"http-proxy-agent": "^4.0.0",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"lru-cache": "^5.1.1",
|
||||
"pac-proxy-agent": "^5.0.0",
|
||||
"proxy-from-env": "^1.0.0",
|
||||
"socks-proxy-agent": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-agent/node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-agent/node_modules/http-proxy-agent": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
|
||||
"integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tootallnate/once": "1",
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-agent/node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-agent/node_modules/lru-cache": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
|
||||
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-agent/node_modules/socks-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^6.0.2",
|
||||
"debug": "4",
|
||||
"socks": "^2.3.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-agent/node_modules/yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
@@ -17305,6 +17735,23 @@
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vm2": {
|
||||
"version": "3.9.19",
|
||||
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz",
|
||||
"integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==",
|
||||
"deprecated": "The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"acorn": "^8.7.0",
|
||||
"acorn-walk": "^8.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"vm2": "bin/vm2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue": {
|
||||
"version": "3.4.38",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.4.38.tgz",
|
||||
@@ -17749,7 +18196,6 @@
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
||||
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
@@ -17923,6 +18369,15 @@
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/xregexp": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz",
|
||||
"integrity": "sha512-xl/50/Cf32VsGq/1R8jJE5ajH1yMCQkpmoS10QbFZWl2Oor4H0Me64Pu2yxvsRWK3m6soJbmGfzSR7BYmDcWAA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/xtend": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||
|
@@ -132,6 +132,7 @@
|
||||
"prometheus-api-metrics": "~3.2.1",
|
||||
"promisify-child-process": "~4.1.2",
|
||||
"protobufjs": "~7.2.4",
|
||||
"proxy-agent": "^5.0.0",
|
||||
"qs": "~6.10.4",
|
||||
"redbean-node": "~0.3.0",
|
||||
"redis": "~4.5.1",
|
||||
|
@@ -17,12 +17,14 @@ class Elks extends NotificationProvider {
|
||||
data.append("to", notification.elksToNumber );
|
||||
data.append("message", msg);
|
||||
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Authorization": "Basic " + Buffer.from(`${notification.elksUsername}:${notification.elksAuthToken}`).toString("base64")
|
||||
}
|
||||
};
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
await axios.post(url, data, config);
|
||||
|
||||
return okMsg;
|
||||
|
@@ -30,6 +30,8 @@ class Alerta extends NotificationProvider {
|
||||
type: "exceptionAlert",
|
||||
};
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
if (heartbeatJSON == null) {
|
||||
let postData = Object.assign({
|
||||
event: "msg",
|
||||
|
@@ -41,7 +41,9 @@ class AlertNow extends NotificationProvider {
|
||||
"event_id": eventId,
|
||||
};
|
||||
|
||||
await axios.post(notification.alertNowWebhookURL, data);
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
|
||||
await axios.post(notification.alertNowWebhookURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -72,6 +72,8 @@ class AliyunSMS extends NotificationProvider {
|
||||
data: qs.stringify(params),
|
||||
};
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let result = await axios(config);
|
||||
if (result.data.Message === "OK") {
|
||||
return true;
|
||||
|
@@ -96,12 +96,13 @@ class Bark extends NotificationProvider {
|
||||
*/
|
||||
async postNotification(notification, title, subtitle, endpoint) {
|
||||
let result;
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (notification.apiVersion === "v1" || notification.apiVersion == null) {
|
||||
// url encode title and subtitle
|
||||
title = encodeURIComponent(title);
|
||||
subtitle = encodeURIComponent(subtitle);
|
||||
const params = this.additionalParameters(notification);
|
||||
result = await axios.get(`${endpoint}/${title}/${subtitle}${params}`);
|
||||
result = await axios.get(`${endpoint}/${title}/${subtitle}${params}`, config);
|
||||
} else {
|
||||
result = await axios.post(`${endpoint}/push`, {
|
||||
title,
|
||||
@@ -109,7 +110,7 @@ class Bark extends NotificationProvider {
|
||||
icon: barkNotificationAvatar,
|
||||
sound: notification.barkSound || "telegraph", // default sound is telegraph
|
||||
group: notification.barkGroup || "UptimeKuma", // default group is UptimeKuma
|
||||
});
|
||||
}, config);
|
||||
}
|
||||
this.checkResult(result);
|
||||
if (result.statusText != null) {
|
||||
|
@@ -19,7 +19,8 @@ class Bitrix24 extends NotificationProvider {
|
||||
"ATTACH[BLOCKS][0][MESSAGE]": msg
|
||||
};
|
||||
|
||||
await axios.get(`${notification.bitrix24WebhookURL}/im.notify.system.add.json`, { params });
|
||||
let config = this.getAxiosConfigWithProxy({ params });
|
||||
await axios.get(`${notification.bitrix24WebhookURL}/im.notify.system.add.json`, config);
|
||||
return okMsg;
|
||||
|
||||
} catch (error) {
|
||||
|
@@ -18,6 +18,7 @@ class Brevo extends NotificationProvider {
|
||||
"api-key": notification.brevoApiKey,
|
||||
},
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let to = [{ email: notification.brevoToEmail }];
|
||||
|
||||
|
@@ -12,7 +12,8 @@ class CallMeBot extends NotificationProvider {
|
||||
try {
|
||||
const url = new URL(notification.callMeBotEndpoint);
|
||||
url.searchParams.set("text", msg);
|
||||
await axios.get(url.toString());
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.get(url.toString(), config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -22,7 +22,8 @@ class Cellsynt extends NotificationProvider {
|
||||
}
|
||||
};
|
||||
try {
|
||||
const resp = await axios.post("https://se-1.cellsynt.net/sms.php", null, data);
|
||||
let config = this.getAxiosConfigWithProxy(data);
|
||||
const resp = await axios.post("https://se-1.cellsynt.net/sms.php", null, config);
|
||||
if (resp.data == null ) {
|
||||
throw new Error("Could not connect to Cellsynt, please try again.");
|
||||
} else if (resp.data.includes("Error:")) {
|
||||
|
@@ -29,6 +29,7 @@ class ClickSendSMS extends NotificationProvider {
|
||||
}
|
||||
]
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
let resp = await axios.post(url, data, config);
|
||||
if (resp.data.data.messages[0].status !== "SUCCESS") {
|
||||
let error = "Something gone wrong. Api returned " + resp.data.data.messages[0].status + ".";
|
||||
|
@@ -60,6 +60,7 @@ class DingDing extends NotificationProvider {
|
||||
url: `${notification.webHookUrl}×tamp=${timestamp}&sign=${encodeURIComponent(this.sign(timestamp, notification.secretKey))}`,
|
||||
data: JSON.stringify(params),
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let result = await axios(config);
|
||||
if (result.data.errmsg === "ok") {
|
||||
|
@@ -12,6 +12,7 @@ class Discord extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
const discordDisplayName = notification.discordUsername || "Uptime Kuma";
|
||||
const webhookUrl = new URL(notification.discordWebhookUrl);
|
||||
if (notification.discordChannelType === "postToThread") {
|
||||
@@ -21,7 +22,7 @@ class Discord extends NotificationProvider {
|
||||
// Check if the webhook has an avatar
|
||||
let webhookHasAvatar = true;
|
||||
try {
|
||||
const webhookInfo = await axios.get(webhookUrl.toString());
|
||||
const webhookInfo = await axios.get(webhookUrl.toString(), config);
|
||||
webhookHasAvatar = !!webhookInfo.data.avatar;
|
||||
} catch (e) {
|
||||
// If we can't verify, we assume he has an avatar to avoid forcing the default avatar
|
||||
@@ -40,7 +41,7 @@ class Discord extends NotificationProvider {
|
||||
if (notification.discordChannelType === "createNewForumPost") {
|
||||
discordtestdata.thread_name = notification.postName;
|
||||
}
|
||||
await axios.post(webhookUrl.toString(), discordtestdata);
|
||||
await axios.post(webhookUrl.toString(), discordtestdata, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ class Discord extends NotificationProvider {
|
||||
discorddowndata.content = notification.discordPrefixMessage;
|
||||
}
|
||||
|
||||
await axios.post(webhookUrl.toString(), discorddowndata);
|
||||
await axios.post(webhookUrl.toString(), discorddowndata, config);
|
||||
return okMsg;
|
||||
|
||||
} else if (heartbeatJSON["status"] === UP) {
|
||||
@@ -124,7 +125,7 @@ class Discord extends NotificationProvider {
|
||||
discordupdata.content = notification.discordPrefixMessage;
|
||||
}
|
||||
|
||||
await axios.post(webhookUrl.toString(), discordupdata);
|
||||
await axios.post(webhookUrl.toString(), discordupdata, config);
|
||||
return okMsg;
|
||||
}
|
||||
} catch (error) {
|
||||
|
@@ -11,13 +11,14 @@ class Evolution extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json",
|
||||
"apikey": notification.evolutionAuthToken,
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let data = {
|
||||
"number": notification.evolutionRecipient,
|
||||
|
@@ -12,6 +12,7 @@ class Feishu extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (heartbeatJSON == null) {
|
||||
let testdata = {
|
||||
msg_type: "text",
|
||||
@@ -19,7 +20,7 @@ class Feishu extends NotificationProvider {
|
||||
text: msg,
|
||||
},
|
||||
};
|
||||
await axios.post(notification.feishuWebHookUrl, testdata);
|
||||
await axios.post(notification.feishuWebHookUrl, testdata, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -49,7 +50,7 @@ class Feishu extends NotificationProvider {
|
||||
]
|
||||
}
|
||||
};
|
||||
await axios.post(notification.feishuWebHookUrl, downdata);
|
||||
await axios.post(notification.feishuWebHookUrl, downdata, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -79,7 +80,7 @@ class Feishu extends NotificationProvider {
|
||||
]
|
||||
}
|
||||
};
|
||||
await axios.post(notification.feishuWebHookUrl, updata);
|
||||
await axios.post(notification.feishuWebHookUrl, updata, config);
|
||||
return okMsg;
|
||||
}
|
||||
} catch (error) {
|
||||
|
@@ -11,10 +11,11 @@ class FreeMobile extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(`https://smsapi.free-mobile.fr/sendmsg?msg=${encodeURIComponent(msg.replace("🔴", "⛔️"))}`, {
|
||||
"user": notification.freemobileUser,
|
||||
"pass": notification.freemobilePass,
|
||||
});
|
||||
}, config);
|
||||
|
||||
return okMsg;
|
||||
|
||||
|
@@ -24,6 +24,7 @@ class GoAlert extends NotificationProvider {
|
||||
let config = {
|
||||
headers: headers
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
await axios.post(`${notification.goAlertBaseURL}/api/v2/generic/incoming?token=${notification.goAlertToken}`, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
@@ -13,6 +13,7 @@ class GoogleChat extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
// Google Chat message formatting: https://developers.google.com/chat/api/guides/message-formats/basic
|
||||
if (notification.googleChatUseTemplate && notification.googleChatTemplate) {
|
||||
// Send message using template
|
||||
@@ -23,7 +24,7 @@ class GoogleChat extends NotificationProvider {
|
||||
heartbeatJSON
|
||||
);
|
||||
const data = { "text": renderedText };
|
||||
await axios.post(notification.googleChatWebhookURL, data);
|
||||
await axios.post(notification.googleChatWebhookURL, data, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ class GoogleChat extends NotificationProvider {
|
||||
],
|
||||
};
|
||||
|
||||
await axios.post(notification.googleChatWebhookURL, data);
|
||||
await axios.post(notification.googleChatWebhookURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -31,8 +31,7 @@ class Gorush extends NotificationProvider {
|
||||
}
|
||||
]
|
||||
};
|
||||
let config = {};
|
||||
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(`${notification.gorushServerURL}/api/push`, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
@@ -11,6 +11,7 @@ class Gotify extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (notification.gotifyserverurl && notification.gotifyserverurl.endsWith("/")) {
|
||||
notification.gotifyserverurl = notification.gotifyserverurl.slice(0, -1);
|
||||
}
|
||||
@@ -18,7 +19,7 @@ class Gotify extends NotificationProvider {
|
||||
"message": msg,
|
||||
"priority": notification.gotifyPriority || 8,
|
||||
"title": "Uptime-Kuma",
|
||||
});
|
||||
}, config);
|
||||
|
||||
return okMsg;
|
||||
|
||||
|
@@ -16,13 +16,14 @@ class GrafanaOncall extends NotificationProvider {
|
||||
}
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (heartbeatJSON === null) {
|
||||
let grafanaupdata = {
|
||||
title: "General notification",
|
||||
message: msg,
|
||||
state: "alerting",
|
||||
};
|
||||
await axios.post(notification.GrafanaOncallURL, grafanaupdata);
|
||||
await axios.post(notification.GrafanaOncallURL, grafanaupdata, config);
|
||||
return okMsg;
|
||||
} else if (heartbeatJSON["status"] === DOWN) {
|
||||
let grafanadowndata = {
|
||||
@@ -30,7 +31,7 @@ class GrafanaOncall extends NotificationProvider {
|
||||
message: heartbeatJSON["msg"],
|
||||
state: "alerting",
|
||||
};
|
||||
await axios.post(notification.GrafanaOncallURL, grafanadowndata);
|
||||
await axios.post(notification.GrafanaOncallURL, grafanadowndata, config);
|
||||
return okMsg;
|
||||
} else if (heartbeatJSON["status"] === UP) {
|
||||
let grafanaupdata = {
|
||||
@@ -38,7 +39,7 @@ class GrafanaOncall extends NotificationProvider {
|
||||
message: heartbeatJSON["msg"],
|
||||
state: "ok",
|
||||
};
|
||||
await axios.post(notification.GrafanaOncallURL, grafanaupdata);
|
||||
await axios.post(notification.GrafanaOncallURL, grafanaupdata, config);
|
||||
return okMsg;
|
||||
}
|
||||
} catch (error) {
|
||||
|
@@ -14,6 +14,7 @@ class GtxMessaging extends NotificationProvider {
|
||||
const text = msg.replaceAll("🔴 ", "").replaceAll("✅ ", "");
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
const data = new URLSearchParams();
|
||||
data.append("from", notification.gtxMessagingFrom.trim());
|
||||
data.append("to", notification.gtxMessagingTo.trim());
|
||||
@@ -21,7 +22,7 @@ class GtxMessaging extends NotificationProvider {
|
||||
|
||||
const url = `https://rest.gtx-messaging.net/smsc/sendsms/${notification.gtxMessagingApiKey}/json`;
|
||||
|
||||
await axios.post(url, data);
|
||||
await axios.post(url, data, config);
|
||||
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
@@ -18,7 +18,7 @@ class HeiiOnCall extends NotificationProvider {
|
||||
payload["url"] = baseURL + getMonitorRelativeURL(monitorJSON.id);
|
||||
}
|
||||
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
@@ -28,6 +28,7 @@ class HeiiOnCall extends NotificationProvider {
|
||||
const heiiUrl = `https://heiioncall.com/triggers/${notification.heiiOnCallTriggerId}/`;
|
||||
// docs https://heiioncall.com/docs#manual-triggers
|
||||
try {
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
if (!heartbeatJSON) {
|
||||
// Testing or general notification like certificate expiry
|
||||
payload["msg"] = msg;
|
||||
|
@@ -15,6 +15,13 @@ class HomeAssistant extends NotificationProvider {
|
||||
const notificationService = notification?.notificationService || defaultNotificationService;
|
||||
|
||||
try {
|
||||
let config = {
|
||||
headers: {
|
||||
Authorization: `Bearer ${notification.longLivedAccessToken}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
await axios.post(
|
||||
`${notification.homeAssistantUrl.trim().replace(/\/*$/, "")}/api/services/notify/${notificationService}`,
|
||||
{
|
||||
@@ -26,14 +33,7 @@ class HomeAssistant extends NotificationProvider {
|
||||
channel: "Uptime Kuma",
|
||||
icon_url: "https://github.com/louislam/uptime-kuma/blob/master/public/icon.png?raw=true",
|
||||
} }),
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${notification.longLivedAccessToken}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
}, config);
|
||||
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
@@ -31,6 +31,8 @@ class Keep extends NotificationProvider {
|
||||
|
||||
let webhookURL = url + "/alerts/event/uptimekuma";
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
await axios.post(webhookURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
@@ -22,6 +22,7 @@ class Kook extends NotificationProvider {
|
||||
},
|
||||
};
|
||||
try {
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
await axios.post(url, data, config);
|
||||
return okMsg;
|
||||
|
||||
|
@@ -19,6 +19,7 @@ class Line extends NotificationProvider {
|
||||
"Authorization": "Bearer " + notification.lineChannelAccessToken
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
if (heartbeatJSON == null) {
|
||||
let testMessage = {
|
||||
"to": notification.lineUserID,
|
||||
|
@@ -20,6 +20,7 @@ class LineNotify extends NotificationProvider {
|
||||
"Authorization": "Bearer " + notification.lineNotifyAccessToken
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
if (heartbeatJSON == null) {
|
||||
let testMessage = {
|
||||
"message": msg,
|
||||
|
@@ -13,13 +13,14 @@ class LunaSea extends NotificationProvider {
|
||||
const url = "https://notify.lunasea.app/v1";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
const target = this.getTarget(notification);
|
||||
if (heartbeatJSON == null) {
|
||||
let testdata = {
|
||||
"title": "Uptime Kuma Alert",
|
||||
"body": msg,
|
||||
};
|
||||
await axios.post(`${url}/custom/${target}`, testdata);
|
||||
await axios.post(`${url}/custom/${target}`, testdata, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -30,7 +31,7 @@ class LunaSea extends NotificationProvider {
|
||||
heartbeatJSON["msg"] +
|
||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||
};
|
||||
await axios.post(`${url}/custom/${target}`, downdata);
|
||||
await axios.post(`${url}/custom/${target}`, downdata, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ class LunaSea extends NotificationProvider {
|
||||
heartbeatJSON["msg"] +
|
||||
`\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
|
||||
};
|
||||
await axios.post(`${url}/custom/${target}`, updata);
|
||||
await axios.post(`${url}/custom/${target}`, updata, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,7 @@ class Matrix extends NotificationProvider {
|
||||
"body": msg
|
||||
};
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
await axios.put(`${notification.homeserverUrl}/_matrix/client/r0/rooms/${roomId}/send/m.room.message/${randomString}`, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
@@ -12,6 +12,7 @@ class Mattermost extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
const mattermostUserName = notification.mattermostusername || "Uptime Kuma";
|
||||
// If heartbeatJSON is null, assume non monitoring notification (Certificate warning) or testing.
|
||||
if (heartbeatJSON == null) {
|
||||
@@ -19,7 +20,7 @@ class Mattermost extends NotificationProvider {
|
||||
username: mattermostUserName,
|
||||
text: msg,
|
||||
};
|
||||
await axios.post(notification.mattermostWebhookUrl, mattermostTestData);
|
||||
await axios.post(notification.mattermostWebhookUrl, mattermostTestData, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -98,7 +99,7 @@ class Mattermost extends NotificationProvider {
|
||||
},
|
||||
],
|
||||
};
|
||||
await axios.post(notification.mattermostWebhookUrl, mattermostdata);
|
||||
await axios.post(notification.mattermostWebhookUrl, mattermostdata, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -42,7 +42,8 @@ class Notifery extends NotificationProvider {
|
||||
"x-api-key": notification.notiferyApiKey,
|
||||
};
|
||||
|
||||
await axios.post(url, data, { headers });
|
||||
let config = this.getAxiosConfigWithProxy({ headers });
|
||||
await axios.post(url, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
const { Liquid } = require("liquidjs");
|
||||
const { DOWN } = require("../../src/util");
|
||||
const ProxyAgent = require("proxy-agent");
|
||||
|
||||
class NotificationProvider {
|
||||
|
||||
@@ -115,6 +116,22 @@ class NotificationProvider {
|
||||
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns axios config with proxy agent if proxy env is set.
|
||||
* @param {object} axiosConfig - Axios config containing params
|
||||
* @returns {object} Axios config
|
||||
*/
|
||||
getAxiosConfigWithProxy(axiosConfig = {}) {
|
||||
const proxyEnv = process.env.notification_proxy || process.env.NOTIFICATION_PROXY;
|
||||
if (proxyEnv) {
|
||||
const agent = new ProxyAgent(proxyEnv);
|
||||
axiosConfig.httpsAgent = agent;
|
||||
axiosConfig.httpAgent = agent;
|
||||
axiosConfig.proxy = false;
|
||||
}
|
||||
return axiosConfig;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NotificationProvider;
|
||||
|
@@ -22,6 +22,8 @@ class Ntfy extends NotificationProvider {
|
||||
"Authorization": "Bearer " + notification.ntfyaccesstoken,
|
||||
};
|
||||
}
|
||||
let config = { headers };
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
// If heartbeatJSON is null, assume non monitoring notification (Certificate warning) or testing.
|
||||
if (heartbeatJSON == null) {
|
||||
let ntfyTestData = {
|
||||
@@ -31,7 +33,7 @@ class Ntfy extends NotificationProvider {
|
||||
"priority": notification.ntfyPriority,
|
||||
"tags": [ "test_tube" ],
|
||||
};
|
||||
await axios.post(notification.ntfyserverurl, ntfyTestData, { headers: headers });
|
||||
await axios.post(notification.ntfyserverurl, ntfyTestData, config);
|
||||
return okMsg;
|
||||
}
|
||||
let tags = [];
|
||||
@@ -70,7 +72,7 @@ class Ntfy extends NotificationProvider {
|
||||
data.icon = notification.ntfyIcon;
|
||||
}
|
||||
|
||||
await axios.post(notification.ntfyserverurl, data, { headers: headers });
|
||||
await axios.post(notification.ntfyserverurl, data, config);
|
||||
|
||||
return okMsg;
|
||||
|
||||
|
@@ -22,6 +22,7 @@ class Octopush extends NotificationProvider {
|
||||
"cache-control": "no-cache"
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
let data = {
|
||||
"recipients": [
|
||||
{
|
||||
@@ -53,6 +54,7 @@ class Octopush extends NotificationProvider {
|
||||
},
|
||||
params: data
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
// V1 API returns 200 even on error so we must check
|
||||
// response data
|
||||
|
@@ -25,6 +25,7 @@ class OneBot extends NotificationProvider {
|
||||
"Authorization": "Bearer " + notification.accessToken,
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
let pushText = "UptimeKuma Alert: " + msg;
|
||||
let data = {
|
||||
"auto_escape": true,
|
||||
|
@@ -13,12 +13,13 @@ class OneChat extends NotificationProvider {
|
||||
const url = "https://chat-api.one.th/message/api/v1/push_message";
|
||||
|
||||
try {
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: "Bearer " + notification.accessToken,
|
||||
},
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
if (heartbeatJSON == null) {
|
||||
const testMessage = {
|
||||
to: notification.recieverId,
|
||||
|
@@ -33,6 +33,7 @@ class Onesender extends NotificationProvider {
|
||||
"Authorization": "Bearer " + notification.onesenderToken,
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
await axios.post(notification.onesenderURL, data, config);
|
||||
return okMsg;
|
||||
|
||||
|
@@ -80,6 +80,7 @@ class Opsgenie extends NotificationProvider {
|
||||
"Authorization": `GenieKey ${notification.opsgenieApiKey}`,
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let res = await axios.post(url, data, config);
|
||||
if (res.status == null) {
|
||||
|
@@ -27,6 +27,7 @@ class PromoSMS extends NotificationProvider {
|
||||
"Accept": "text/json",
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
let data = {
|
||||
"recipients": [ notification.promosmsPhoneNumber ],
|
||||
//Trim message to maximum length of 1 SMS or 4 if we allowed long messages
|
||||
|
@@ -12,6 +12,7 @@ class Pumble extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (heartbeatJSON === null && monitorJSON === null) {
|
||||
let data = {
|
||||
"attachments": [
|
||||
@@ -23,7 +24,7 @@ class Pumble extends NotificationProvider {
|
||||
]
|
||||
};
|
||||
|
||||
await axios.post(notification.webhookURL, data);
|
||||
await axios.post(notification.webhookURL, data, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -37,7 +38,7 @@ class Pumble extends NotificationProvider {
|
||||
]
|
||||
};
|
||||
|
||||
await axios.post(notification.webhookURL, data);
|
||||
await axios.post(notification.webhookURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -20,6 +20,7 @@ class Pushbullet extends NotificationProvider {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
if (heartbeatJSON == null) {
|
||||
let data = {
|
||||
"type": "note",
|
||||
|
@@ -33,7 +33,8 @@ class PushDeer extends NotificationProvider {
|
||||
};
|
||||
|
||||
try {
|
||||
let res = await axios.post(url, data);
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
let res = await axios.post(url, data, config);
|
||||
|
||||
if ("error" in res.data) {
|
||||
let error = res.data.error;
|
||||
|
@@ -41,8 +41,9 @@ class Pushover extends NotificationProvider {
|
||||
}
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (heartbeatJSON == null) {
|
||||
await axios.post(url, data);
|
||||
await axios.post(url, data, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -52,7 +53,7 @@ class Pushover extends NotificationProvider {
|
||||
}
|
||||
|
||||
data.message += `\n<b>Time (${heartbeatJSON["timezone"]})</b>: ${heartbeatJSON["localDateTime"]}`;
|
||||
await axios.post(url, data);
|
||||
await axios.post(url, data, config);
|
||||
return okMsg;
|
||||
|
||||
} catch (error) {
|
||||
|
@@ -17,11 +17,12 @@ class PushPlus extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
const url = "https://www.pushplus.plus/send";
|
||||
try {
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
const params = {
|
||||
"token": notification.pushPlusSendKey,
|
||||
"title": this.checkStatus(heartbeatJSON, monitorJSON),
|
||||
|
@@ -11,6 +11,7 @@ class Pushy extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(`https://api.pushy.me/push?api_key=${notification.pushyAPIKey}`, {
|
||||
"to": notification.pushyToken,
|
||||
"data": {
|
||||
@@ -21,7 +22,7 @@ class Pushy extends NotificationProvider {
|
||||
"badge": 1,
|
||||
"sound": "ping.aiff"
|
||||
}
|
||||
});
|
||||
}, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -14,6 +14,7 @@ class RocketChat extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (heartbeatJSON == null) {
|
||||
let data = {
|
||||
"text": msg,
|
||||
@@ -21,7 +22,7 @@ class RocketChat extends NotificationProvider {
|
||||
"username": notification.rocketusername,
|
||||
"icon_emoji": notification.rocketiconemo,
|
||||
};
|
||||
await axios.post(notification.rocketwebhookURL, data);
|
||||
await axios.post(notification.rocketwebhookURL, data, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -55,7 +56,7 @@ class RocketChat extends NotificationProvider {
|
||||
data.attachments[0].title_link = baseURL + getMonitorRelativeURL(monitorJSON.id);
|
||||
}
|
||||
|
||||
await axios.post(notification.rocketwebhookURL, data);
|
||||
await axios.post(notification.rocketwebhookURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -17,7 +17,7 @@ class SendGrid extends NotificationProvider {
|
||||
Authorization: `Bearer ${notification.sendgridApiKey}`,
|
||||
},
|
||||
};
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
let personalizations = {
|
||||
to: [{ email: notification.sendgridToEmail }],
|
||||
};
|
||||
|
@@ -18,10 +18,11 @@ class ServerChan extends NotificationProvider {
|
||||
: `https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`;
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(url, {
|
||||
"title": this.checkStatus(heartbeatJSON, monitorJSON),
|
||||
"desp": msg,
|
||||
});
|
||||
}, config);
|
||||
|
||||
return okMsg;
|
||||
|
||||
|
@@ -17,6 +17,7 @@ class SerwerSMS extends NotificationProvider {
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
let data = {
|
||||
"username": notification.serwersmsUsername,
|
||||
"password": notification.serwersmsPassword,
|
||||
|
@@ -17,7 +17,7 @@ class SevenIO extends NotificationProvider {
|
||||
text: msg,
|
||||
};
|
||||
|
||||
const config = {
|
||||
let config = {
|
||||
baseURL: "https://gateway.seven.io/api/",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -26,6 +26,7 @@ class SevenIO extends NotificationProvider {
|
||||
};
|
||||
|
||||
try {
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
// testing or certificate expiry notification
|
||||
if (heartbeatJSON == null) {
|
||||
await axios.post("sms", data, config);
|
||||
|
@@ -17,7 +17,7 @@ class Signal extends NotificationProvider {
|
||||
"recipients": notification.signalRecipients.replace(/\s/g, "").split(","),
|
||||
};
|
||||
let config = {};
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
await axios.post(notification.signalURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
@@ -21,11 +21,12 @@ class SIGNL4 extends NotificationProvider {
|
||||
monitorUrl: this.extractAddress(monitorJSON),
|
||||
};
|
||||
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
if (heartbeatJSON == null) {
|
||||
// Test alert
|
||||
|
@@ -131,6 +131,7 @@ class Slack extends NotificationProvider {
|
||||
}
|
||||
|
||||
try {
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
if (heartbeatJSON == null) {
|
||||
let data = {
|
||||
"text": msg,
|
||||
@@ -138,7 +139,7 @@ class Slack extends NotificationProvider {
|
||||
"username": notification.slackusername,
|
||||
"icon_emoji": notification.slackiconemo,
|
||||
};
|
||||
await axios.post(notification.slackwebhookURL, data);
|
||||
await axios.post(notification.slackwebhookURL, data, config);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
@@ -168,7 +169,7 @@ class Slack extends NotificationProvider {
|
||||
await Slack.deprecateURL(notification.slackbutton);
|
||||
}
|
||||
|
||||
await axios.post(notification.slackwebhookURL, data);
|
||||
await axios.post(notification.slackwebhookURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -18,6 +18,7 @@ class SMSPlanet extends NotificationProvider {
|
||||
"content-type": "multipart/form-data"
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let data = {
|
||||
"from": notification.smsplanetSenderName,
|
||||
|
@@ -18,6 +18,7 @@ class SMSC extends NotificationProvider {
|
||||
"Accept": "text/json",
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let getArray = [
|
||||
"fmt=3",
|
||||
|
@@ -17,6 +17,7 @@ class SMSEagle extends NotificationProvider {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let sendMethod;
|
||||
let recipientType;
|
||||
@@ -78,6 +79,7 @@ class SMSEagle extends NotificationProvider {
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let encoding = (notification.smseagleEncoding) ? "unicode" : "standard";
|
||||
let priority = (notification.smseaglePriority) ?? 0;
|
||||
|
@@ -18,7 +18,8 @@ class SMSManager extends NotificationProvider {
|
||||
number: notification.numbers,
|
||||
gateway: notification.messageType,
|
||||
};
|
||||
await axios.get(`${url}?apikey=${data.apikey}&message=${data.message}&number=${data.number}&gateway=${data.messageType}`);
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.get(`${url}?apikey=${data.apikey}&message=${data.message}&number=${data.number}&gateway=${data.messageType}`, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -29,6 +29,7 @@ class SMSPartner extends NotificationProvider {
|
||||
"Accept": "application/json",
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let resp = await axios.post(url, data, config);
|
||||
|
||||
|
@@ -26,7 +26,8 @@ class SpugPush extends NotificationProvider {
|
||||
}
|
||||
}
|
||||
const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`;
|
||||
await axios.post(apiUrl, formData);
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(apiUrl, formData, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -45,6 +45,7 @@ class Squadcast extends NotificationProvider {
|
||||
}
|
||||
});
|
||||
}
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
await axios.post(notification.squadcastWebhookURL, data, config);
|
||||
return okMsg;
|
||||
|
@@ -31,8 +31,9 @@ class Stackfield extends NotificationProvider {
|
||||
const data = {
|
||||
"Title": textMsg,
|
||||
};
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
|
||||
await axios.post(notification.stackfieldwebhookURL, data);
|
||||
await axios.post(notification.stackfieldwebhookURL, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -185,7 +185,8 @@ class Teams extends NotificationProvider {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
_sendNotification = async (webhookUrl, payload) => {
|
||||
await axios.post(webhookUrl, payload);
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(webhookUrl, payload, config);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -25,7 +25,8 @@ class TechulusPush extends NotificationProvider {
|
||||
}
|
||||
|
||||
try {
|
||||
await axios.post(`https://push.techulus.com/api/v1/notify/${notification.pushAPIKey}`, data);
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(`https://push.techulus.com/api/v1/notify/${notification.pushAPIKey}`, data, config);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
|
@@ -30,9 +30,9 @@ class Telegram extends NotificationProvider {
|
||||
}
|
||||
}
|
||||
|
||||
await axios.get(`${url}/bot${notification.telegramBotToken}/sendMessage`, {
|
||||
params: params,
|
||||
});
|
||||
let config = this.getAxiosConfigWithProxy({ params });
|
||||
|
||||
await axios.get(`${url}/bot${notification.telegramBotToken}/sendMessage`, config);
|
||||
return okMsg;
|
||||
|
||||
} catch (error) {
|
||||
|
@@ -10,12 +10,13 @@ class Threema extends NotificationProvider {
|
||||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||
const url = "https://msgapi.threema.ch/send_simple";
|
||||
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Accept": "*/*",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
const data = {
|
||||
from: notification.threemaSenderIdentity,
|
||||
|
@@ -19,6 +19,7 @@ class Twilio extends NotificationProvider {
|
||||
"Authorization": "Basic " + Buffer.from(apiKey + ":" + notification.twilioAuthToken).toString("base64"),
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let data = new URLSearchParams();
|
||||
data.append("To", notification.twilioToNumber);
|
||||
|
@@ -11,13 +11,14 @@ class WAHA extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json",
|
||||
"X-Api-Key": notification.wahaApiKey,
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let data = {
|
||||
"session": notification.wahaSession,
|
||||
|
@@ -41,6 +41,7 @@ class Webhook extends NotificationProvider {
|
||||
}
|
||||
}
|
||||
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
await axios.post(notification.webhookURL, data, config);
|
||||
return okMsg;
|
||||
|
||||
|
@@ -17,6 +17,7 @@ class WeCom extends NotificationProvider {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
let body = this.composeMessage(heartbeatJSON, msg);
|
||||
await axios.post(`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${notification.weComBotKey}`, body, config);
|
||||
return okMsg;
|
||||
|
@@ -11,13 +11,14 @@ class Whapi extends NotificationProvider {
|
||||
const okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer " + notification.whapiAuthToken,
|
||||
}
|
||||
};
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
let data = {
|
||||
"to": notification.whapiRecipient,
|
||||
|
@@ -18,7 +18,8 @@ class WPush extends NotificationProvider {
|
||||
"apikey": notification.wpushAPIkey,
|
||||
"channel": notification.wpushChannel
|
||||
};
|
||||
const result = await axios.post("https://api.wpush.cn/api/v1/send", context);
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
const result = await axios.post("https://api.wpush.cn/api/v1/send", context, config);
|
||||
if (result.data.code !== 0) {
|
||||
throw result.data.message;
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ class YZJ extends NotificationProvider {
|
||||
msg = `${this.statusToString(heartbeatJSON["status"])} ${monitorJSON["name"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`;
|
||||
}
|
||||
|
||||
const config = {
|
||||
let config = {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
@@ -26,6 +26,7 @@ class YZJ extends NotificationProvider {
|
||||
};
|
||||
// yzjtype=0 => general robot
|
||||
const url = `${notification.yzjWebHookUrl}?yzjtype=0&yzjtoken=${notification.yzjToken}`;
|
||||
config = this.getAxiosConfigWithProxy(config);
|
||||
|
||||
const result = await axios.post(url, params, config);
|
||||
if (!result.data?.success) {
|
||||
|
@@ -27,7 +27,8 @@ class ZohoCliq extends NotificationProvider {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
_sendNotification = async (webhookUrl, payload) => {
|
||||
await axios.post(webhookUrl, { text: payload.join("\n") });
|
||||
let config = this.getAxiosConfigWithProxy({});
|
||||
await axios.post(webhookUrl, { text: payload.join("\n") }, config);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user