Skip to content

Commit bdddc94

Browse files
committed
fix: update env problem
1 parent bf08321 commit bdddc94

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/config/env.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export const env = {
3434
MAIL_DRIVER: process.env.MAIL_DRIVER || 'smtp',
3535
MAIL_HOST: process.env.MAIL_HOST || 'smtp.mailtrap.io',
3636
MAIL_PORT: validate.number(process.env.MAIL_PORT) || 587,
37-
MAIL_FROM: process.env.MAIL_FROM || ' ',
38-
MAIL_USERNAME: process.env.MAIL_USERNAME || ' ',
39-
MAIL_PASSWORD: process.env.MAIL_PASSWORD || ' ',
40-
MAIL_ENCRYPTION: process.env.MAIL_ENCRYPTION || ' ',
37+
MAIL_FROM: process.env.MAIL_FROM,
38+
MAIL_USERNAME: process.env.MAIL_USERNAME,
39+
MAIL_PASSWORD: process.env.MAIL_PASSWORD,
40+
MAIL_ENCRYPTION: process.env.MAIL_ENCRYPTION,
4141
}

src/lib/storage/gcs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { addDays } from 'date-fns'
44
import fs from 'fs'
55
import path from 'path'
66
import { logger } from '~/config/logger'
7+
import { storageExists } from '../boolean'
78
import { ms } from '../date'
89
import { currentDir } from '../string'
910
import { GoogleCloudStorageParams, UploadFileParams } from './types'
@@ -22,9 +23,10 @@ export default class GoogleCloudStorage {
2223
this._expires = params.expires
2324
this._filepath = path.resolve(`${currentDir}/${params.filepath}`)
2425

26+
const isStorageEnabled = storageExists()
2527
const msgType = `${green('storage - google cloud storage')}`
2628

27-
if (!this._access_key && !fs.existsSync(this._filepath)) {
29+
if (isStorageEnabled && !this._access_key && !fs.existsSync(this._filepath)) {
2830
const message = `${msgType} serviceAccount is missing on root directory`
2931
logger.error(message)
3032

0 commit comments

Comments
 (0)