diff --git a/src/lang/en.json b/src/lang/en.json index 01f963d25..6b74d383a 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -590,7 +590,12 @@ "notificationDescription": "Notifications must be assigned to a monitor to function.", "keywordDescription": "Search keyword in plain HTML or JSON response. The search is case-sensitive.", "invertKeywordDescription": "Look for the keyword to be absent rather than present.", - "requestDescription": "Request to send to the server after establishing the connection. Note that trailing newlines may be significant.", + "tcpRequestDescription": "Request sent to the server after establishing the connection. Trailing newlines may be required. JavaScript escape sequences are allowed.", + "tcpStartTlsDescription": "Start unencrypted and upgrade connection using STARTTLS.", + "tcpStartTlsPresetDescription": "Select a preset below to auto-fill commonly used values for request, keyword, and STARTTLS prompt/command/response.", + "tcpStartTlsPromptDescription": "Server prompt (prefix) indicating readiness for STARTTLS command. JavaScript escape sequences are allowed.", + "tcpStartTlsCommandDescription": "Command to initiate the TLS negotiation. Trailing newlines may be required. JavaScript escape sequences are allowed.", + "tcpStartTlsResponseDescription": "Server response (prefix) confirming readiness for TLS negotiation. JavaScript escape sequences are allowed.", "jsonQueryDescription": "Do a json Query against the response and check for expected value (Return value will get converted into string for comparison). Check out {0} for the documentation about the query language. A playground can be found {1}.", "backupDescription": "You can backup all monitors and notifications into a JSON file.", "backupDescription2": "Note: history and event data is not included.", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index b982f3bd8..62655d1d7 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -147,6 +147,17 @@ + +
+
+ + +
+
+ {{ $t("tcpRequestDescription") }} +
+
+
@@ -907,22 +918,69 @@
@@ -1040,6 +1098,32 @@ export default { }, draftGroupName: null, remoteBrowsersEnabled: false, + startTlsPresets: [ + { + name: "SMTP", + prompt: "220 ", + command: String.raw`STARTTLS\n`, + response: "220 ", + request: String.raw`QUIT\n`, + keyword: "221 ", + }, + { + name: "POP3", + prompt: "+OK", + command: String.raw`STLS\r\n`, + response: "+OK", + request: String.raw`QUIT\r\n`, + keyword: "+OK", + }, + { + name: "IMAP4", + prompt: "* OK", + command: String.raw`a001 STARTTLS\r\n`, + response: "a001 OK", + request: String.raw`a002 CAPABILITY\r\n`, + keyword: "* CAPABILITY", + }, + ], }; }, @@ -1677,6 +1761,23 @@ message HealthCheckResponse { } }, + applyStartTlsPreset(name) { + const preset = name + ? this.startTlsPresets.find(p => p.name === name) + : { + prompt: "", + command: "", + response: "", + request: "", + keyword: "", + }; + this.monitor.tcpStartTlsPrompt = preset.prompt; + this.monitor.tcpStartTlsCommand = preset.command; + this.monitor.tcpStartTlsResponse = preset.response; + this.monitor.tcpRequest = preset.request; + this.monitor.keyword = preset.keyword; + }, + }, };