**Breaking Change**: fix(email): from address must be provided by operator if email is enabled (#1743) (#1745)

This reverts commit 0a795c51f2.
This commit is contained in:
Iain Sproat
2023-08-01 11:49:08 +01:00
committed by GitHub
parent 0a795c51f2
commit f568f54266
7 changed files with 18 additions and 7 deletions
+2 -2
View File
@@ -117,9 +117,9 @@ Essentially, ensure you have **Volar** enabled, and the built in **TypeScript an
We have a [Maildev](https://github.com/maildev/maildev) container available that you can use to see all e-mails sent out from the app. Make sure your `server` .env file is configured properly to use it:
```
```bash
EMAIL=true
EMAIL_FROM="speckle@speckle.local"
EMAIL_FROM="no-reply@example.org"
EMAIL_HOST="localhost"
EMAIL_PORT="1025"
```
+1
View File
@@ -51,6 +51,7 @@ services:
S3_CREATE_BUCKET: 'true'
S3_REGION: '' # optional, defaults to 'us-east-1'
FILE_SIZE_LIMIT_MB: 100
EMAIL_FROM: 'no-reply@example.org'
preview-service:
build:
+1 -1
View File
@@ -64,7 +64,7 @@ S3_CREATE_BUCKET="true"
# Emails
############################################################
EMAIL=true
EMAIL_FROM="speckle@speckle.local"
EMAIL_FROM="no-reply@example.org"
EMAIL_HOST="localhost"
EMAIL_PORT="1025"
@@ -1,5 +1,6 @@
import { logger } from '@/logging/logging'
import { getTransporter } from '@/modules/emails/utils/transporter'
import { getEmailFromAddress } from '@/modules/shared/helpers/envHelper'
export type SendEmailParams = {
from?: string
@@ -25,7 +26,7 @@ export async function sendEmail({
return false
}
try {
const emailFrom = process.env.EMAIL_FROM || 'no-reply@speckle.systems'
const emailFrom = getEmailFromAddress()
await transporter.sendMail({
from: from || `"Speckle" <${emailFrom}>`,
to,
@@ -144,7 +144,7 @@ export function getFrontendOrigin(forceFe2?: boolean) {
export function getServerOrigin() {
if (!process.env.CANONICAL_URL) {
throw new MisconfiguredEnvironmentError(
'Server origin env var (CANONICAL_URL) not configured'
'Server origin environment variable (CANONICAL_URL) not configured'
)
}
@@ -204,3 +204,12 @@ export function getOnboardingStreamCacheBustNumber() {
const val = process.env.ONBOARDING_STREAM_CACHE_BUST_NUMBER || '1'
return parseInt(val) || 1
}
export function getEmailFromAddress() {
if (!process.env.EMAIL_FROM) {
throw new MisconfiguredEnvironmentError(
'Email From environment variable (EMAIL_FROM) is not configured'
)
}
return process.env.EMAIL_FROM
}
+1 -1
View File
@@ -80,7 +80,7 @@
"docker_image_tag": {
"type": "string",
"description": "Speckle is published as a Docker Image. The version of the image which will be deployed is specified by this tag.",
"default": "2.13.3"
"default": "2"
},
"imagePullPolicy": {
"type": "string",
+1 -1
View File
@@ -65,7 +65,7 @@ ingress:
##
## @param docker_image_tag Speckle is published as a Docker Image. The version of the image which will be deployed is specified by this tag.
##
docker_image_tag: 2.13.3
docker_image_tag: '2'
## @param imagePullPolicy Determines the conditions when the Docker Images for Speckle should be pulled from the Image registry.
## ref: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy