Compare commits

..

No commits in common. "3dacf72471904d01d4b342faed2b75f8a9e1cba0" and "712e34572b695d0c80842fb55371aaa29dd71b67" have entirely different histories.

6 changed files with 32 additions and 9 deletions

View file

@ -32,6 +32,7 @@ tsconfig.json
/extra/healthcheck.exe
/extra/healthcheck
/extra/exe-builder
/extra/push-examples
/extra/uptime-kuma-push
# Comment the following line if you want to rebuild the healthcheck binary

View file

@ -485,7 +485,7 @@ function ApiCache() {
}
if (typeof duration === "string") {
let split = duration.match(/^([\d\.,]+)\s?([a-zA-Z]+)$/);
let split = duration.match(/^([\d\.,]+)\s?(\w+)$/);
if (split.length === 3) {
let len = parseFloat(split[1]);

View file

@ -5,6 +5,30 @@ const nodemailer = require("nodemailer");
class SMTPMonitorType extends MonitorType {
name = "smtp";
/**
* @param {*} smtpSecurity the user's SMTP security setting
* @returns {boolean} True if this should test SMTPS
*/
isSMTPS(smtpSecurity) {
return smtpSecurity === "secure";
}
/**
* @param {*} smtpSecurity the user's SMTP security setting
* @returns {boolean} True if this should not attempt STARTTLS, even if it is available
*/
isIgnoreTLS(smtpSecurity) {
return smtpSecurity === "nostarttls";
}
/**
* @param {*} smtpSecurity the user's SMTP security setting
* @returns {boolean} True if this should always test STARTTLS
*/
isRequireTLS(smtpSecurity) {
return smtpSecurity === "starttls";
}
/**
* @inheritdoc
*/
@ -12,9 +36,9 @@ class SMTPMonitorType extends MonitorType {
let options = {
port: monitor.port || 25,
host: monitor.hostname,
secure: monitor.smtpSecurity === "secure", // use SMTPS (not STARTTLS)
ignoreTLS: monitor.smtpSecurity === "nostarttls", // don't use STARTTLS even if it's available
requireTLS: monitor.smtpSecurity === "starttls", // use STARTTLS or fail
secure: this.isSMTPS(monitor.smtpSecurity), // use SMTPS (not STARTTLS)
ignoreTLS: this.isIgnoreTLS(monitor.smtpSecurity), // don't use STARTTLS even if it's available
requireTLS: this.isRequireTLS(monitor.smtpSecurity), // use STARTTLS or fail
};
let transporter = nodemailer.createTransport(options);
try {

View file

@ -72,7 +72,6 @@ class GoogleChat extends NotificationProvider {
// construct json data
let data = {
fallbackText: chatHeader["title"],
cardsV2: [
{
card: {

View file

@ -1051,6 +1051,5 @@
"RabbitMQ Password": "RabbitMQ Password",
"rabbitmqHelpText": "To use the monitor, you will need to enable the Management Plugin in your RabbitMQ setup. For more information, please consult the {rabitmq_documentation}.",
"SendGrid API Key": "SendGrid API Key",
"Separate multiple email addresses with commas": "Separate multiple email addresses with commas",
"smtpHelpText": "Specify the TLS settings of the SMTP server you wish to monitor: SMTPS, STARTTLS, or ignore TLS"
"Separate multiple email addresses with commas": "Separate multiple email addresses with commas"
}

View file

@ -332,14 +332,14 @@
</select>
</div>
<i18n-t v-if="monitor.type === 'smtp'" keypath="smtpHelpText" tag="div" class="my-3">
<div v-if="monitor.type === 'smtp'" class="my-3">
<label for="smtp_security" class="form-label">{{ $t("SMTP Security") }}</label>
<select id="smtp_security" v-model="monitor.smtpSecurity" class="form-select">
<option value="secure">SMTPS</option>
<option value="nostarttls">Ignore STARTTLS</option>
<option value="starttls">Use STARTTLS</option>
</select>
</i18n-t>
</div>
<!-- Json Query -->
<!-- For Json Query / SNMP -->