mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
allow no tls for instance settings smtp (#4656)
* allow no tls for instance settings smtp * update ee ref
This commit is contained in:
@@ -1 +1 @@
|
||||
01f384348341c87c5a0b32c4be7c699975ee7d6d
|
||||
aedaf655693cb9bab59fcf79a48c60aad6822668
|
||||
@@ -724,6 +724,8 @@ paths:
|
||||
type: string
|
||||
tls_implicit:
|
||||
type: boolean
|
||||
disable_tls:
|
||||
type: boolean
|
||||
required:
|
||||
- host
|
||||
- username
|
||||
@@ -731,6 +733,7 @@ paths:
|
||||
- port
|
||||
- from
|
||||
- tls_implicit
|
||||
- disable_tls
|
||||
required:
|
||||
- to
|
||||
- smtp
|
||||
|
||||
@@ -10,6 +10,7 @@ pub struct Smtp {
|
||||
pub port: u16,
|
||||
pub from: String,
|
||||
pub tls_implicit: Option<bool>,
|
||||
pub disable_tls: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq)]
|
||||
@@ -20,6 +21,7 @@ pub struct SmtpConfigOpt {
|
||||
pub smtp_port: Option<u16>,
|
||||
pub smtp_from: Option<String>,
|
||||
pub smtp_tls_implicit: Option<bool>,
|
||||
pub smtp_disable_tls: Option<bool>,
|
||||
}
|
||||
|
||||
pub async fn load_smtp_config(db: &DB) -> error::Result<Option<Smtp>> {
|
||||
@@ -39,6 +41,7 @@ pub async fn load_smtp_config(db: &DB) -> error::Result<Option<Smtp>> {
|
||||
username,
|
||||
password,
|
||||
tls_implicit: config.smtp_tls_implicit,
|
||||
disable_tls: config.smtp_disable_tls,
|
||||
port: config.smtp_port.unwrap_or(587),
|
||||
from: config
|
||||
.smtp_from
|
||||
@@ -60,6 +63,9 @@ pub async fn load_smtp_config(db: &DB) -> error::Result<Option<Smtp>> {
|
||||
tls_implicit: std::env::var("SMTP_TLS_IMPLICIT")
|
||||
.ok()
|
||||
.and_then(|p| p.parse().ok()),
|
||||
disable_tls: std::env::var("SMTP_DISABLE_TLS")
|
||||
.ok()
|
||||
.and_then(|p| p.parse().ok()),
|
||||
port: std::env::var("SMTP_PORT")
|
||||
.ok()
|
||||
.and_then(|p| p.parse().ok())
|
||||
@@ -87,6 +93,7 @@ impl Default for SmtpConfigOpt {
|
||||
smtp_port: None,
|
||||
smtp_tls_implicit: None,
|
||||
smtp_username: None,
|
||||
smtp_disable_tls: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1014,12 +1014,26 @@
|
||||
</div>
|
||||
<div>
|
||||
<Toggle
|
||||
disabled={values[setting.key].smtp_disable_tls}
|
||||
id="smtp_tls_implicit"
|
||||
bind:checked={values[setting.key].smtp_tls_implicit}
|
||||
options={{ right: 'Implicit TLS' }}
|
||||
label="Implicit TLS"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Toggle
|
||||
id="smtp_disable_tls"
|
||||
bind:checked={values[setting.key].smtp_disable_tls}
|
||||
on:change={() => {
|
||||
if (values[setting.key].smtp_disable_tls) {
|
||||
values[setting.key].smtp_tls_implicit = false
|
||||
}
|
||||
}}
|
||||
options={{ right: 'Disable TLS' }}
|
||||
label="Disable TLS"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{:else if setting.fieldType == 'object_store_config'}
|
||||
@@ -1082,7 +1096,8 @@
|
||||
password: smtp['smtp_password'],
|
||||
port: smtp['smtp_port'],
|
||||
from: smtp['smtp_from'],
|
||||
tls_implicit: smtp['smtp_tls_implicit']
|
||||
tls_implicit: smtp['smtp_tls_implicit'],
|
||||
disable_tls: smtp['smtp_disable_tls']
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user