HdroguettA 2 months ago committed by GitHub
commit 0c5ff0b693
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -857,7 +857,7 @@ class Monitor extends BeanModel {
} else if (this.type === "redis") { } else if (this.type === "redis") {
let startTime = dayjs().valueOf(); let startTime = dayjs().valueOf();
bean.msg = await redisPingAsync(this.databaseConnectionString); bean.msg = await redisPingAsync(this.databaseConnectionString, !this.ignoreTls);
bean.status = UP; bean.status = UP;
bean.ping = dayjs().valueOf() - startTime; bean.ping = dayjs().valueOf() - startTime;

@ -505,12 +505,16 @@ exports.radius = function (
/** /**
* Redis server ping * Redis server ping
* @param {string} dsn The redis connection string * @param {string} dsn The redis connection string
* @returns {Promise<any>} Response from redis server * @param {boolean} rejectUnauthorized If false, allows unverified server certificates.
* @returns {Promise<any>} Response from server
*/ */
exports.redisPingAsync = function (dsn) { exports.redisPingAsync = function (dsn, rejectUnauthorized) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const client = redis.createClient({ const client = redis.createClient({
url: dsn url: dsn,
socket: {
rejectUnauthorized
}
}); });
client.on("error", (err) => { client.on("error", (err) => {
if (client.isOpen) { if (client.isOpen) {

@ -77,6 +77,7 @@
"resendDisabled": "Resend disabled", "resendDisabled": "Resend disabled",
"retriesDescription": "Maximum retries before the service is marked as down and a notification is sent", "retriesDescription": "Maximum retries before the service is marked as down and a notification is sent",
"ignoreTLSError": "Ignore TLS/SSL errors for HTTPS websites", "ignoreTLSError": "Ignore TLS/SSL errors for HTTPS websites",
"ignoreTLSErrorGeneral": "Ignore TLS/SSL error for connection",
"upsideDownModeDescription": "Flip the status upside down. If the service is reachable, it is DOWN.", "upsideDownModeDescription": "Flip the status upside down. If the service is reachable, it is DOWN.",
"maxRedirectDescription": "Maximum number of redirects to follow. Set to 0 to disable redirects.", "maxRedirectDescription": "Maximum number of redirects to follow. Set to 0 to disable redirects.",
"Upside Down Mode": "Upside Down Mode", "Upside Down Mode": "Upside Down Mode",

@ -482,10 +482,10 @@
</div> </div>
</div> </div>
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' " class="my-3 form-check"> <div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' || monitor.type === 'redis' " class="my-3 form-check">
<input id="ignore-tls" v-model="monitor.ignoreTls" class="form-check-input" type="checkbox" value=""> <input id="ignore-tls" v-model="monitor.ignoreTls" class="form-check-input" type="checkbox" value="">
<label class="form-check-label" for="ignore-tls"> <label class="form-check-label" for="ignore-tls">
{{ $t("ignoreTLSError") }} {{ monitor.type === "redis" ? $t("ignoreTLSErrorGeneral") : $t("ignoreTLSError") }}
</label> </label>
</div> </div>

Loading…
Cancel
Save