remove tls for smtp and add method for getting primary URL

This commit is contained in:
Matt Hill
2023-05-22 08:34:35 -06:00
parent 790601ee47
commit 3d9a703ad6
3 changed files with 13 additions and 9 deletions

View File

@@ -41,12 +41,6 @@ export const customSmtp = Config.of<ConfigSpecOf<SmtpValue>, never, never>({
required: false, required: false,
masked: true, 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 <strong>if the SMTP server supports it</strong>. If enabled, email will refuse to connect unless the server supports STARTTLS.",
}),
}) })
/** /**

View File

@@ -143,7 +143,6 @@ export type SmtpValue = {
from: string from: string
login: string login: string
password: string | null | undefined password: string | null | undefined
tls: boolean
} }
export type CommandType<A extends string> = export type CommandType<A extends string> =
@@ -194,7 +193,7 @@ export type NetworkInterface = {
/** Defaults to false, but describes if this address can be opened in a browser as an /** Defaults to false, but describes if this address can be opened in a browser as an
* ui interface * ui interface
*/ */
ui?: boolean ui: boolean
} }
/** Used to reach out from the pure js runtime */ /** Used to reach out from the pure js runtime */

View File

@@ -22,6 +22,7 @@ export type Filled = {
ipv6Urls: UrlString[] ipv6Urls: UrlString[]
nonIpUrls: UrlString[] nonIpUrls: UrlString[]
allUrls: UrlString[] allUrls: UrlString[]
primaryUrl: UrlString
} }
export type FilledAddress = Address & Filled export type FilledAddress = Address & Filled
export type NetworkInterfaceFilled = { export type NetworkInterfaceFilled = {
@@ -30,12 +31,16 @@ export type NetworkInterfaceFilled = {
name: string name: string
/** Human readable description, used as tooltip usually */ /** Human readable description, used as tooltip usually */
description: string description: string
/** Whether or not the interface has a primary URL */
hasPrimary: boolean
/** Whether or not the interface disabled */
disabled: boolean
/** All URIs */ /** All URIs */
addresses: FilledAddress[] addresses: FilledAddress[]
/** Defaults to false, but describes if this address can be opened in a browser as an /** Defaults to false, but describes if this address can be opened in a browser as an
* ui interface * ui interface
*/ */
ui?: boolean ui: boolean
} & Filled } & Filled
const either = const either =
<A>(...args: ((a: A) => boolean)[]) => <A>(...args: ((a: A) => boolean)[]) =>
@@ -113,6 +118,9 @@ export const filledAddress = (
get allUrls() { get allUrls() {
return hostnames.map(toUrl) return hostnames.map(toUrl)
}, },
get primaryUrl() {
return this.allUrls[0] // @TODO this is a placeholder
},
} }
} }
@@ -171,6 +179,9 @@ export const networkInterfaceFilled = (
get allUrls() { get allUrls() {
return unique(addresses.flatMap((x) => x.allUrls)) return unique(addresses.flatMap((x) => x.allUrls))
}, },
get primaryUrl() {
return this.allUrls[0] // @TODO this is a placeholder
},
} }
} }
const makeInterfaceFilled = async ({ const makeInterfaceFilled = async ({