From 573541e21a0e8dba68b1487e623659118f34ffe4 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:42:06 +0530 Subject: [PATCH 01/19] feat: encryption --- server/src/utils/auth.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/src/utils/auth.ts b/server/src/utils/auth.ts index 96e121f9..2468fe53 100644 --- a/server/src/utils/auth.ts +++ b/server/src/utils/auth.ts @@ -1,4 +1,5 @@ import bcrypt from "bcrypt"; +import crypto from 'crypto'; export const hashPassword = (password: string): Promise => { return new Promise((resolve, reject) => { @@ -19,4 +20,12 @@ export const hashPassword = (password: string): Promise => { // password from frontend and hash from database export const comparePassword = (password: string, hash: string): Promise => { return bcrypt.compare(password, hash) -} \ No newline at end of file +} + +const encrypt = (text: string): string => { + const iv = crypto.randomBytes(IV_LENGTH); + const cipher = crypto.createCipheriv(ALGORITHM, Buffer.from(ENCRYPTION_KEY), iv); + let encrypted = cipher.update(text, 'utf8', 'hex'); + encrypted += cipher.final('hex'); + return `${iv.toString('hex')}:${encrypted}`; +}; \ No newline at end of file From f61063cee83c8b18043530669ea7808a4baf7359 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:42:32 +0530 Subject: [PATCH 02/19] feat: decryption --- server/src/utils/auth.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/utils/auth.ts b/server/src/utils/auth.ts index 2468fe53..9b6a37f1 100644 --- a/server/src/utils/auth.ts +++ b/server/src/utils/auth.ts @@ -28,4 +28,12 @@ const encrypt = (text: string): string => { let encrypted = cipher.update(text, 'utf8', 'hex'); encrypted += cipher.final('hex'); return `${iv.toString('hex')}:${encrypted}`; +}; + +const decrypt = (encryptedText: string): string => { + const [iv, encrypted] = encryptedText.split(':'); + const decipher = crypto.createDecipheriv(ALGORITHM, Buffer.from(ENCRYPTION_KEY), Buffer.from(iv, 'hex')); + let decrypted = decipher.update(encrypted, 'hex', 'utf8'); + decrypted += decipher.final('utf8'); + return decrypted; }; \ No newline at end of file From b45b6e069293f7a001d57a4d1c73f6eb5530c2d5 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:48:11 +0530 Subject: [PATCH 03/19] feat: use process.env --- server/src/utils/auth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/utils/auth.ts b/server/src/utils/auth.ts index 9b6a37f1..9f43759d 100644 --- a/server/src/utils/auth.ts +++ b/server/src/utils/auth.ts @@ -23,8 +23,8 @@ export const comparePassword = (password: string, hash: string): Promise { - const iv = crypto.randomBytes(IV_LENGTH); - const cipher = crypto.createCipheriv(ALGORITHM, Buffer.from(ENCRYPTION_KEY), iv); + const iv = crypto.randomBytes(process.env.IV_LENGTH); + const cipher = crypto.createCipheriv(process.env.ALGORITHM, Buffer.from(process.env.ENCRYPTION_KEY), iv); let encrypted = cipher.update(text, 'utf8', 'hex'); encrypted += cipher.final('hex'); return `${iv.toString('hex')}:${encrypted}`; @@ -32,7 +32,7 @@ const encrypt = (text: string): string => { const decrypt = (encryptedText: string): string => { const [iv, encrypted] = encryptedText.split(':'); - const decipher = crypto.createDecipheriv(ALGORITHM, Buffer.from(ENCRYPTION_KEY), Buffer.from(iv, 'hex')); + const decipher = crypto.createDecipheriv(process.env.ALGORITHM, Buffer.from(process.env.ENCRYPTION_KEY), Buffer.from(iv, 'hex')); let decrypted = decipher.update(encrypted, 'hex', 'utf8'); decrypted += decipher.final('utf8'); return decrypted; From 09b6c9c2654641a83e8a6a27c5fd62c640b25295 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:53:10 +0530 Subject: [PATCH 04/19] feat: get env variables safely --- server/src/utils/env.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 server/src/utils/env.ts diff --git a/server/src/utils/env.ts b/server/src/utils/env.ts new file mode 100644 index 00000000..b4808b0c --- /dev/null +++ b/server/src/utils/env.ts @@ -0,0 +1,8 @@ +// Helper function to get environment variables and throw an error if they are not set +export const getEnvVariable = (key: string, defaultValue?: string): string => { + const value = process.env[key] || defaultValue; + if (!value) { + throw new Error(`Environment variable ${key} is not defined`); + } + return value; +}; \ No newline at end of file From 09647510c562bcf9aab5c786d7a9f2311ef033b2 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:55:20 +0530 Subject: [PATCH 05/19] feat: use getEnvVariable to encrypt & decrypt --- server/src/utils/auth.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/src/utils/auth.ts b/server/src/utils/auth.ts index 9f43759d..d428d414 100644 --- a/server/src/utils/auth.ts +++ b/server/src/utils/auth.ts @@ -1,5 +1,6 @@ import bcrypt from "bcrypt"; import crypto from 'crypto'; +import { getEnvVariable } from './env'; export const hashPassword = (password: string): Promise => { return new Promise((resolve, reject) => { @@ -23,8 +24,11 @@ export const comparePassword = (password: string, hash: string): Promise { - const iv = crypto.randomBytes(process.env.IV_LENGTH); - const cipher = crypto.createCipheriv(process.env.ALGORITHM, Buffer.from(process.env.ENCRYPTION_KEY), iv); + const ivLength = parseInt(getEnvVariable('IV_LENGTH'), 10); + const iv = crypto.randomBytes(ivLength); + const algorithm = getEnvVariable('ALGORITHM'); + const key = Buffer.from(getEnvVariable('ENCRYPTION_KEY'), 'hex'); + const cipher = crypto.createCipheriv(algorithm, key, iv); let encrypted = cipher.update(text, 'utf8', 'hex'); encrypted += cipher.final('hex'); return `${iv.toString('hex')}:${encrypted}`; @@ -32,7 +36,9 @@ const encrypt = (text: string): string => { const decrypt = (encryptedText: string): string => { const [iv, encrypted] = encryptedText.split(':'); - const decipher = crypto.createDecipheriv(process.env.ALGORITHM, Buffer.from(process.env.ENCRYPTION_KEY), Buffer.from(iv, 'hex')); + const algorithm = getEnvVariable('ALGORITHM'); + const key = Buffer.from(getEnvVariable('ENCRYPTION_KEY'), 'hex'); + const decipher = crypto.createDecipheriv(algorithm, key, Buffer.from(iv, 'hex')); let decrypted = decipher.update(encrypted, 'hex', 'utf8'); decrypted += decipher.final('utf8'); return decrypted; From 235d8ffdd184072f05b36d32c23c13b7bcc4ee85 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:58:32 +0530 Subject: [PATCH 06/19] feat: missing exports --- server/src/utils/auth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/utils/auth.ts b/server/src/utils/auth.ts index d428d414..b1f6850f 100644 --- a/server/src/utils/auth.ts +++ b/server/src/utils/auth.ts @@ -23,7 +23,7 @@ export const comparePassword = (password: string, hash: string): Promise { +export const encrypt = (text: string): string => { const ivLength = parseInt(getEnvVariable('IV_LENGTH'), 10); const iv = crypto.randomBytes(ivLength); const algorithm = getEnvVariable('ALGORITHM'); @@ -34,7 +34,7 @@ const encrypt = (text: string): string => { return `${iv.toString('hex')}:${encrypted}`; }; -const decrypt = (encryptedText: string): string => { +export const decrypt = (encryptedText: string): string => { const [iv, encrypted] = encryptedText.split(':'); const algorithm = getEnvVariable('ALGORITHM'); const key = Buffer.from(getEnvVariable('ENCRYPTION_KEY'), 'hex'); From 3c9f801ab39d4257fda1af0afbfb15fd7be05d6c Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:59:31 +0530 Subject: [PATCH 07/19] feat: encrypt proxy config --- server/src/routes/proxy.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/server/src/routes/proxy.ts b/server/src/routes/proxy.ts index ff20d31e..5c694ed8 100644 --- a/server/src/routes/proxy.ts +++ b/server/src/routes/proxy.ts @@ -1,6 +1,6 @@ import { Router, Request, Response } from 'express'; import User from '../models/User'; -import { hashPassword } from '../utils/auth'; +import { hashPassword, encrypt, decrypt } from '../utils/auth'; import { requireSignIn } from '../middlewares/auth'; export const router = Router(); @@ -30,19 +30,20 @@ router.post('/config', requireSignIn, async (req: AuthenticatedRequest, res: Res return res.status(400).send('Proxy URL is required'); } - let hashedProxyUsername: string | null = null; - let hashedProxyPassword: string | null = null; + const encryptedProxyUrl = encrypt(server_url); + let encryptedProxyUsername: string | null = null; + let encryptedProxyPassword: string | null = null; if (username && password) { - hashedProxyUsername = await hashPassword(username); - hashedProxyPassword = await hashPassword(password); + encryptedProxyUsername = encrypt(username); + encryptedProxyPassword = encrypt(password); } else if (username && !password) { return res.status(400).send('Proxy password is required when proxy username is provided'); } - user.proxy_url = server_url; - user.proxy_username = hashedProxyUsername; - user.proxy_password = hashedProxyPassword; + user.proxy_url = encryptedProxyUrl; + user.proxy_username = encryptedProxyUsername; + user.proxy_password = encryptedProxyPassword; await user.save(); From de4a7a2fa2cfd5cf236dfe457ea2f50987efdc4b Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 16:01:07 +0530 Subject: [PATCH 08/19] feat: decrypt proxy config --- server/src/routes/proxy.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/server/src/routes/proxy.ts b/server/src/routes/proxy.ts index 5c694ed8..9eaf5501 100644 --- a/server/src/routes/proxy.ts +++ b/server/src/routes/proxy.ts @@ -52,3 +52,23 @@ router.post('/config', requireSignIn, async (req: AuthenticatedRequest, res: Res res.status(500).send(`Could not save proxy configuration - ${error.message}`); } }); + +const getDecryptedProxyConfig = async (userId: string) => { + const user = await User.findByPk(userId, { + attributes: ['proxy_url', 'proxy_username', 'proxy_password'], + }); + + if (!user) { + throw new Error('User not found'); + } + + const decryptedProxyUrl = user.proxy_url ? decrypt(user.proxy_url) : null; + const decryptedProxyUsername = user.proxy_username ? decrypt(user.proxy_username) : null; + const decryptedProxyPassword = user.proxy_password ? decrypt(user.proxy_password) : null; + + return { + proxy_url: decryptedProxyUrl, + proxy_username: decryptedProxyUsername, + proxy_password: decryptedProxyPassword, + }; +}; From 133fb958c66dec29cbb3c27068a4e9e4d25d62a6 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 16:01:27 +0530 Subject: [PATCH 09/19] feat: exports --- server/src/routes/proxy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/routes/proxy.ts b/server/src/routes/proxy.ts index 9eaf5501..1446effc 100644 --- a/server/src/routes/proxy.ts +++ b/server/src/routes/proxy.ts @@ -53,7 +53,7 @@ router.post('/config', requireSignIn, async (req: AuthenticatedRequest, res: Res } }); -const getDecryptedProxyConfig = async (userId: string) => { +export const getDecryptedProxyConfig = async (userId: string) => { const user = await User.findByPk(userId, { attributes: ['proxy_url', 'proxy_username', 'proxy_password'], }); From 855f7fa2888b95010799e06ee6f30f455a3c6a51 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 16:01:49 +0530 Subject: [PATCH 10/19] chore: todo --- server/src/routes/proxy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/routes/proxy.ts b/server/src/routes/proxy.ts index 1446effc..28975478 100644 --- a/server/src/routes/proxy.ts +++ b/server/src/routes/proxy.ts @@ -53,6 +53,7 @@ router.post('/config', requireSignIn, async (req: AuthenticatedRequest, res: Res } }); +// TODO: Move this from here export const getDecryptedProxyConfig = async (userId: string) => { const user = await User.findByPk(userId, { attributes: ['proxy_url', 'proxy_username', 'proxy_password'], From 70694ae21d893eca81a4086985916d3cfc5cb207 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 16:02:06 +0530 Subject: [PATCH 11/19] chore: -rm unused import --- server/src/routes/proxy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/routes/proxy.ts b/server/src/routes/proxy.ts index 28975478..5e3383ee 100644 --- a/server/src/routes/proxy.ts +++ b/server/src/routes/proxy.ts @@ -1,6 +1,6 @@ import { Router, Request, Response } from 'express'; import User from '../models/User'; -import { hashPassword, encrypt, decrypt } from '../utils/auth'; +import { encrypt, decrypt } from '../utils/auth'; import { requireSignIn } from '../middlewares/auth'; export const router = Router(); From 310711e4c733471a740d8d0e2dfbe44807e78054 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 01:07:47 +0530 Subject: [PATCH 12/19] feat: init proxy setup for recording --- server/src/routes/record.ts | 5 +++++ server/src/routes/storage.ts | 31 +++++++++++++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/server/src/routes/record.ts b/server/src/routes/record.ts index 0f12f5c9..376a6912 100644 --- a/server/src/routes/record.ts +++ b/server/src/routes/record.ts @@ -35,6 +35,11 @@ router.get('/start', (req, res) => { browser: chromium, launchOptions: { headless: true, + proxy: { + server: '', + username: '', + password: '', + } } }); return res.send(id); diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index 3d427169..b167dff3 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -10,7 +10,7 @@ import { chromium } from "playwright"; import { browserPool } from "../server"; import fs from "fs"; import { uuid } from "uuidv4"; -import { workflowQueue } from '../workflow-management/scheduler'; +// import { workflowQueue } from '../workflow-management/scheduler'; import moment from 'moment-timezone'; import cron from 'node-cron'; import { googleSheetUpdateTasks, processGoogleSheetUpdates } from '../workflow-management/integrations/gsheet'; @@ -87,7 +87,14 @@ router.put('/runs/:fileName', async (req, res) => { try { const id = createRemoteBrowserForRun({ browser: chromium, - launchOptions: { headless: true } + launchOptions: { + headless: true, + proxy: { + server: '', + username: '', + password: '', + } + } }); const runId = uuid(); @@ -262,16 +269,16 @@ router.put('/schedule/:fileName/', async (req, res) => { const runId = uuid(); - await workflowQueue.add( - 'run workflow', - { fileName, runId }, - { - repeat: { - pattern: cronExpression, - tz: timezone - } - } - ); + // await workflowQueue.add( + // 'run workflow', + // { fileName, runId }, + // { + // repeat: { + // pattern: cronExpression, + // tz: timezone + // } + // } + // ); res.status(200).json({ message: 'success', From 1595f420fc6fc864d952e72bc76f7a8f5343c637 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 01:08:21 +0530 Subject: [PATCH 13/19] chore: prettier --- server/src/routes/storage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index b167dff3..02e8001c 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -87,14 +87,14 @@ router.put('/runs/:fileName', async (req, res) => { try { const id = createRemoteBrowserForRun({ browser: chromium, - launchOptions: { + launchOptions: { headless: true, proxy: { server: '', username: '', password: '', - } } + } }); const runId = uuid(); From dca330ddfc9aab15ad053a25cf7ef6d22bc7e510 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 01:15:21 +0530 Subject: [PATCH 14/19] feat: proxy helper text --- src/components/organisms/ProxyForm.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/ProxyForm.tsx b/src/components/organisms/ProxyForm.tsx index 62869fc9..4f5fdeef 100644 --- a/src/components/organisms/ProxyForm.tsx +++ b/src/components/organisms/ProxyForm.tsx @@ -98,7 +98,8 @@ const ProxyForm: React.FC = () => { fullWidth required error={!!errors.server_url} - helperText={errors.server_url || 'e.g., http://proxy-server.com:8080'} + helperText={errors.server_url || `Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example http://myproxy.com:3128 or + socks5://myproxy.com:3128. Short form myproxy.com:3128 is considered an HTTP proxy.`} /> From d35ea52eaee31954c1280f3502b273cb91f41e5c Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 01:16:03 +0530 Subject: [PATCH 15/19] chore: format text --- src/components/organisms/ProxyForm.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/organisms/ProxyForm.tsx b/src/components/organisms/ProxyForm.tsx index 4f5fdeef..3c6b9a80 100644 --- a/src/components/organisms/ProxyForm.tsx +++ b/src/components/organisms/ProxyForm.tsx @@ -98,8 +98,9 @@ const ProxyForm: React.FC = () => { fullWidth required error={!!errors.server_url} - helperText={errors.server_url || `Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example http://myproxy.com:3128 or - socks5://myproxy.com:3128. Short form myproxy.com:3128 is considered an HTTP proxy.`} + helperText={errors.server_url || `Proxy to be used for all requests. + HTTP and SOCKS proxies are supported, for example http://myproxy.com:3128 or + socks5://myproxy.com:3128. Short form myproxy.com:3128 is considered an HTTP proxy.`} /> From 78dc4b344c9bf83a0ea7bb3cdc85e3864be85ece Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 03:04:05 +0530 Subject: [PATCH 16/19] feat: set proxy from DB --- server/src/routes/record.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/server/src/routes/record.ts b/server/src/routes/record.ts index 376a6912..9892b23e 100644 --- a/server/src/routes/record.ts +++ b/server/src/routes/record.ts @@ -14,6 +14,7 @@ import { import { chromium } from 'playwright-extra'; import stealthPlugin from 'puppeteer-extra-plugin-stealth'; import logger from "../logger"; +import { getDecryptedProxyConfig } from './proxy'; export const router = Router(); chromium.use(stealthPlugin()); @@ -30,16 +31,27 @@ router.all('/', (req, res, next) => { * GET endpoint for starting the remote browser recording session. * returns session's id */ -router.get('/start', (req, res) => { +router.get('/start', async (req, res) => { + const proxyConfig = await getDecryptedProxyConfig(req.user.id); + // Prepare the proxy options dynamically based on the user's proxy configuration + let proxyOptions: any = {}; // Default to no proxy + + if (proxyConfig.proxy_url) { + // Set the server, and if username & password exist, set those as well + proxyOptions = { + server: proxyConfig.proxy_url, + ...(proxyConfig.proxy_username && proxyConfig.proxy_password && { + username: proxyConfig.proxy_username, + password: proxyConfig.proxy_password, + }), + }; + } + const id = initializeRemoteBrowserForRecording({ browser: chromium, launchOptions: { headless: true, - proxy: { - server: '', - username: '', - password: '', - } + proxy: proxyOptions.server ? proxyOptions : undefined, } }); return res.send(id); From 640d4179962f4e4851005af77bb3abdd15d356e1 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 03:06:22 +0530 Subject: [PATCH 17/19] chore: prettier --- server/src/routes/record.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/routes/record.ts b/server/src/routes/record.ts index 9892b23e..adbd1afd 100644 --- a/server/src/routes/record.ts +++ b/server/src/routes/record.ts @@ -46,7 +46,7 @@ router.get('/start', async (req, res) => { }), }; } - + const id = initializeRemoteBrowserForRecording({ browser: chromium, launchOptions: { From be838c6c8968f164a3890538594acfd02c45e22d Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 03:15:45 +0530 Subject: [PATCH 18/19] feat: set proxy config as per user --- server/src/routes/storage.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index 02e8001c..045ee481 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -14,6 +14,7 @@ import { uuid } from "uuidv4"; import moment from 'moment-timezone'; import cron from 'node-cron'; import { googleSheetUpdateTasks, processGoogleSheetUpdates } from '../workflow-management/integrations/gsheet'; +import { getDecryptedProxyConfig } from './proxy'; export const router = Router(); @@ -85,15 +86,24 @@ router.delete('/runs/:fileName', async (req, res) => { */ router.put('/runs/:fileName', async (req, res) => { try { + const proxyConfig = await getDecryptedProxyConfig(req.user.id); + let proxyOptions: any = {}; + + if (proxyConfig.proxy_url) { + proxyOptions = { + server: proxyConfig.proxy_url, + ...(proxyConfig.proxy_username && proxyConfig.proxy_password && { + username: proxyConfig.proxy_username, + password: proxyConfig.proxy_password, + }), + }; + } + const id = createRemoteBrowserForRun({ browser: chromium, launchOptions: { headless: true, - proxy: { - server: '', - username: '', - password: '', - } + proxy: proxyOptions.server ? proxyOptions : undefined, } }); From 061fdae1adc623197d78db8f6361bc0cd10ee861 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 6 Oct 2024 03:15:54 +0530 Subject: [PATCH 19/19] chore: prettier --- server/src/routes/storage.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index 045ee481..46ca5d85 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -90,13 +90,13 @@ router.put('/runs/:fileName', async (req, res) => { let proxyOptions: any = {}; if (proxyConfig.proxy_url) { - proxyOptions = { - server: proxyConfig.proxy_url, - ...(proxyConfig.proxy_username && proxyConfig.proxy_password && { - username: proxyConfig.proxy_username, - password: proxyConfig.proxy_password, - }), - }; + proxyOptions = { + server: proxyConfig.proxy_url, + ...(proxyConfig.proxy_username && proxyConfig.proxy_password && { + username: proxyConfig.proxy_username, + password: proxyConfig.proxy_password, + }), + }; } const id = createRemoteBrowserForRun({