mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-02 19:46:26 -04:00
Autofix on save
This commit is contained in:
parent
8331e795e7
commit
9648d700d7
29 changed files with 1182 additions and 1089 deletions
|
@ -1,6 +1,6 @@
|
|||
const tcpp = require('tcp-ping');
|
||||
const tcpp = require("tcp-ping");
|
||||
const Ping = require("./ping-lite");
|
||||
const {R} = require("redbean-node");
|
||||
const { R } = require("redbean-node");
|
||||
|
||||
exports.tcping = function (hostname, port) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -41,13 +41,13 @@ exports.ping = function (hostname) {
|
|||
|
||||
exports.setting = async function (key) {
|
||||
return await R.getCell("SELECT `value` FROM setting WHERE `key` = ? ", [
|
||||
key
|
||||
key,
|
||||
])
|
||||
}
|
||||
|
||||
exports.setSetting = async function (key, value) {
|
||||
let bean = await R.findOne("setting", " `key` = ? ", [
|
||||
key
|
||||
key,
|
||||
])
|
||||
if (! bean) {
|
||||
bean = R.dispense("setting")
|
||||
|
@ -59,7 +59,7 @@ exports.setSetting = async function (key, value) {
|
|||
|
||||
exports.getSettings = async function (type) {
|
||||
let list = await R.getAll("SELECT * FROM setting WHERE `type` = ? ", [
|
||||
type
|
||||
type,
|
||||
])
|
||||
|
||||
let result = {};
|
||||
|
@ -71,7 +71,6 @@ exports.getSettings = async function (type) {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
// ssl-checker by @dyaa
|
||||
// param: res - response object from axios
|
||||
// return an object containing the certificate information
|
||||
|
@ -97,7 +96,9 @@ exports.checkCertificate = function (res) {
|
|||
} = res.request.res.socket.getPeerCertificate(false);
|
||||
|
||||
if (!valid_from || !valid_to || !subjectaltname) {
|
||||
throw { message: 'No TLS certificate in response' };
|
||||
throw {
|
||||
message: "No TLS certificate in response",
|
||||
};
|
||||
}
|
||||
|
||||
const valid = res.request.res.socket.authorized || false;
|
||||
|
@ -118,4 +119,4 @@ exports.checkCertificate = function (res) {
|
|||
issuer,
|
||||
fingerprint,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue