Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: email configuration using SSL #3732

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apiserver/plane/bgtasks/analytic_plot_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def send_export_email(email, slug, csv_buffer, rows):
EMAIL_HOST_PASSWORD,
EMAIL_PORT,
EMAIL_USE_TLS,
EMAIL_USE_SSL,
EMAIL_FROM,
) = get_email_configuration()

Expand All @@ -66,6 +67,7 @@ def send_export_email(email, slug, csv_buffer, rows):
username=EMAIL_HOST_USER,
password=EMAIL_HOST_PASSWORD,
use_tls=EMAIL_USE_TLS == "1",
use_ssl=EMAIL_USE_SSL == "1",
)

msg = EmailMultiAlternatives(
Expand Down
2 changes: 2 additions & 0 deletions apiserver/plane/bgtasks/email_notification_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def send_email_notification(
EMAIL_HOST_PASSWORD,
EMAIL_PORT,
EMAIL_USE_TLS,
EMAIL_USE_SSL,
EMAIL_FROM,
) = get_email_configuration()

Expand Down Expand Up @@ -273,6 +274,7 @@ def send_email_notification(
username=EMAIL_HOST_USER,
password=EMAIL_HOST_PASSWORD,
use_tls=EMAIL_USE_TLS == "1",
use_ssl=EMAIL_USE_SSL == "1",
)

msg = EmailMultiAlternatives(
Expand Down
2 changes: 2 additions & 0 deletions apiserver/plane/bgtasks/forgot_password_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def forgot_password(first_name, email, uidb64, token, current_site):
EMAIL_HOST_PASSWORD,
EMAIL_PORT,
EMAIL_USE_TLS,
EMAIL_USE_SSL,
EMAIL_FROM,
) = get_email_configuration()

Expand All @@ -54,6 +55,7 @@ def forgot_password(first_name, email, uidb64, token, current_site):
username=EMAIL_HOST_USER,
password=EMAIL_HOST_PASSWORD,
use_tls=EMAIL_USE_TLS == "1",
use_ssl=EMAIL_USE_SSL == "1",
)

msg = EmailMultiAlternatives(
Expand Down
2 changes: 2 additions & 0 deletions apiserver/plane/bgtasks/magic_link_code_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def magic_link(email, key, token, current_site):
EMAIL_HOST_PASSWORD,
EMAIL_PORT,
EMAIL_USE_TLS,
EMAIL_USE_SSL,
EMAIL_FROM,
) = get_email_configuration()

Expand All @@ -44,6 +45,7 @@ def magic_link(email, key, token, current_site):
username=EMAIL_HOST_USER,
password=EMAIL_HOST_PASSWORD,
use_tls=EMAIL_USE_TLS == "1",
use_ssl=EMAIL_USE_SSL == "1",
)

msg = EmailMultiAlternatives(
Expand Down
2 changes: 2 additions & 0 deletions apiserver/plane/bgtasks/project_invitation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def project_invitation(email, project_id, token, current_site, invitor):
EMAIL_HOST_PASSWORD,
EMAIL_PORT,
EMAIL_USE_TLS,
EMAIL_USE_SSL,
EMAIL_FROM,
) = get_email_configuration()

Expand All @@ -62,6 +63,7 @@ def project_invitation(email, project_id, token, current_site, invitor):
username=EMAIL_HOST_USER,
password=EMAIL_HOST_PASSWORD,
use_tls=EMAIL_USE_TLS == "1",
use_ssl=EMAIL_USE_SSL == "1",
)

msg = EmailMultiAlternatives(
Expand Down
2 changes: 2 additions & 0 deletions apiserver/plane/bgtasks/webhook_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def send_webhook_deactivation_email(webhook_id, receiver_id, current_site, reaso
EMAIL_HOST_PASSWORD,
EMAIL_PORT,
EMAIL_USE_TLS,
EMAIL_USE_SSL,
EMAIL_FROM,
) = get_email_configuration()

Expand All @@ -278,6 +279,7 @@ def send_webhook_deactivation_email(webhook_id, receiver_id, current_site, reaso
username=EMAIL_HOST_USER,
password=EMAIL_HOST_PASSWORD,
use_tls=EMAIL_USE_TLS == "1",
use_ssl=EMAIL_USE_SSL == "1",
)

msg = EmailMultiAlternatives(
Expand Down
2 changes: 2 additions & 0 deletions apiserver/plane/bgtasks/workspace_invitation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def workspace_invitation(email, workspace_id, token, current_site, invitor):
EMAIL_HOST_PASSWORD,
EMAIL_PORT,
EMAIL_USE_TLS,
EMAIL_USE_SSL,
EMAIL_FROM,
) = get_email_configuration()

Expand Down Expand Up @@ -70,6 +71,7 @@ def workspace_invitation(email, workspace_id, token, current_site, invitor):
username=EMAIL_HOST_USER,
password=EMAIL_HOST_PASSWORD,
use_tls=EMAIL_USE_TLS == "1",
use_ssl=EMAIL_USE_SSL == "1",
)

msg = EmailMultiAlternatives(
Expand Down
4 changes: 4 additions & 0 deletions apiserver/plane/license/utils/instance_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def get_email_configuration():
"key": "EMAIL_USE_TLS",
"default": os.environ.get("EMAIL_USE_TLS", "1"),
},
{
"key": "EMAIL_USE_SSL",
"default": os.environ.get("EMAIL_USE_SSL", "0"),
},
{
"key": "EMAIL_FROM",
"default": os.environ.get(
Expand Down
8 changes: 4 additions & 4 deletions web/components/instance/email-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface EmailFormValues {
EMAIL_HOST_USER: string;
EMAIL_HOST_PASSWORD: string;
EMAIL_USE_TLS: string;
// EMAIL_USE_SSL: string;
EMAIL_USE_SSL: string;
EMAIL_FROM: string;
}

Expand All @@ -44,7 +44,7 @@ export const InstanceEmailForm: FC<IInstanceEmailForm> = (props) => {
EMAIL_HOST_USER: config["EMAIL_HOST_USER"],
EMAIL_HOST_PASSWORD: config["EMAIL_HOST_PASSWORD"],
EMAIL_USE_TLS: config["EMAIL_USE_TLS"],
// EMAIL_USE_SSL: config["EMAIL_USE_SSL"],
EMAIL_USE_SSL: config["EMAIL_USE_SSL"],
EMAIL_FROM: config["EMAIL_FROM"],
},
});
Expand Down Expand Up @@ -221,7 +221,7 @@ export const InstanceEmailForm: FC<IInstanceEmailForm> = (props) => {
</div>
</div>

{/* <div className="flex items-center gap-10 pt-4 mr-8">
<div className="flex items-center gap-10 pt-4 mr-8">
<div className="grow">
<div className="text-custom-text-100 font-medium text-sm">
Turn SSL {Boolean(parseInt(watch("EMAIL_USE_SSL"))) ? "off" : "on"}
Expand All @@ -245,7 +245,7 @@ export const InstanceEmailForm: FC<IInstanceEmailForm> = (props) => {
)}
/>
</div>
</div> */}
</div>
</div>

<div className="flex max-w-4xl items-center py-1">
Expand Down
11 changes: 5 additions & 6 deletions web/pages/god-mode/authorization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ const InstanceAdminAuthorizationPage: NextPageWithLayout = observer(() => {
<div className={`shrink-0 ${isSubmitting && "opacity-70"}`}>
<ToggleSwitch
value={Boolean(parseInt(enableMagicLogin))}
// onChange={() => {
// Boolean(parseInt(enableMagicLogin)) === true
// ? updateConfig("ENABLE_MAGIC_LINK_LOGIN", "0")
// : updateConfig("ENABLE_MAGIC_LINK_LOGIN", "1");
// }}
onChange={() => {}}
onChange={() => {
Boolean(parseInt(enableMagicLogin)) === true
? updateConfig("ENABLE_MAGIC_LINK_LOGIN", "0")
: updateConfig("ENABLE_MAGIC_LINK_LOGIN", "1");
}}
size="sm"
disabled={isSubmitting}
/>
Expand Down
Loading