From 3d9a703ad6c2562e67df358e73a1ad729653a81b Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 22 May 2023 08:34:35 -0600 Subject: [PATCH] remove tls for smtp and add method for getting primary URL --- lib/config/configConstants.ts | 6 ------ lib/types.ts | 3 +-- lib/util/getNetworkInterface.ts | 13 ++++++++++++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/config/configConstants.ts b/lib/config/configConstants.ts index 0795dcb..34de5ad 100644 --- a/lib/config/configConstants.ts +++ b/lib/config/configConstants.ts @@ -41,12 +41,6 @@ export const customSmtp = Config.of, never, never>({ required: false, masked: true, }), - tls: Value.toggle({ - name: "Require Transport Security", - default: true, - description: - "Require TLS transport security. If disabled, email will use plaintext by default and TLS via STARTTLS if the SMTP server supports it. If enabled, email will refuse to connect unless the server supports STARTTLS.", - }), }) /** diff --git a/lib/types.ts b/lib/types.ts index e9280c5..e29e178 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -143,7 +143,6 @@ export type SmtpValue = { from: string login: string password: string | null | undefined - tls: boolean } export type CommandType = @@ -194,7 +193,7 @@ export type NetworkInterface = { /** Defaults to false, but describes if this address can be opened in a browser as an * ui interface */ - ui?: boolean + ui: boolean } /** Used to reach out from the pure js runtime */ diff --git a/lib/util/getNetworkInterface.ts b/lib/util/getNetworkInterface.ts index f3d3e7b..456bc67 100644 --- a/lib/util/getNetworkInterface.ts +++ b/lib/util/getNetworkInterface.ts @@ -22,6 +22,7 @@ export type Filled = { ipv6Urls: UrlString[] nonIpUrls: UrlString[] allUrls: UrlString[] + primaryUrl: UrlString } export type FilledAddress = Address & Filled export type NetworkInterfaceFilled = { @@ -30,12 +31,16 @@ export type NetworkInterfaceFilled = { name: string /** Human readable description, used as tooltip usually */ description: string + /** Whether or not the interface has a primary URL */ + hasPrimary: boolean + /** Whether or not the interface disabled */ + disabled: boolean /** All URIs */ addresses: FilledAddress[] /** Defaults to false, but describes if this address can be opened in a browser as an * ui interface */ - ui?: boolean + ui: boolean } & Filled const either = (...args: ((a: A) => boolean)[]) => @@ -113,6 +118,9 @@ export const filledAddress = ( get allUrls() { return hostnames.map(toUrl) }, + get primaryUrl() { + return this.allUrls[0] // @TODO this is a placeholder + }, } } @@ -171,6 +179,9 @@ export const networkInterfaceFilled = ( get allUrls() { return unique(addresses.flatMap((x) => x.allUrls)) }, + get primaryUrl() { + return this.allUrls[0] // @TODO this is a placeholder + }, } } const makeInterfaceFilled = async ({