From 27d9f2c1df726e72fea23001cbf0db95995e3702 Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Wed, 15 Jun 2022 10:11:29 +0000 Subject: [PATCH 1/4] make proxy an option --- .../Settings/TeamSettings/RegistryForm.tsx | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx index c47031a1ff9..1b94d3959c9 100644 --- a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx +++ b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx @@ -10,6 +10,7 @@ import { Icon, Link, Tooltip, + Switch, } from '@codesandbox/components'; import { AuthType, @@ -94,6 +95,9 @@ export const RegistryForm = ({ const [scopes, setScopes] = React.useState( registry?.enabledScopes || [] ); + const [proxyEnabled, setProxyEnabled] = React.useState( + registry?.proxyEnabled + ); const addScope = () => { setScopes(oldScopes => [...oldScopes, '']); @@ -118,7 +122,7 @@ export const RegistryForm = ({ enabledScopes: scopes.filter(s => s !== ''), registryAuthType: authenticationType, registryUrl, - proxyEnabled: true, + proxyEnabled, }); // We make sure to always show one input field @@ -242,6 +246,25 @@ export const RegistryForm = ({ */} +
+ + { + setProxyEnabled(s => !s); + }} + on={isLimitedToScopes} + disabled={disabled} + /> + + + Disabling the proxy will allow you to use the registry behind + a VPN, but will expose the auth token to the browser. + +
+ {isLimitedToScopes && ( Date: Wed, 15 Jun 2022 10:25:14 +0000 Subject: [PATCH 2/4] Update RegistryForm.tsx --- .../Settings/TeamSettings/RegistryForm.tsx | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx index 1b94d3959c9..7df0bc5e047 100644 --- a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx +++ b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx @@ -193,6 +193,25 @@ export const RegistryForm = ({ +
+ + { + setProxyEnabled(s => !s); + }} + on={isLimitedToScopes} + disabled={disabled} + /> + + + Disabling the proxy will allow you to use the registry behind + a VPN, but will expose the auth token to the browser. + +
+ */} -
- - { - setProxyEnabled(s => !s); - }} - on={isLimitedToScopes} - disabled={disabled} - /> - - - Disabling the proxy will allow you to use the registry behind - a VPN, but will expose the auth token to the browser. - -
- {isLimitedToScopes && ( Date: Wed, 15 Jun 2022 10:52:51 +0000 Subject: [PATCH 3/4] . --- .../Settings/TeamSettings/RegistryForm.tsx | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx index 7df0bc5e047..a0b58928cf2 100644 --- a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx +++ b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx @@ -193,10 +193,22 @@ export const RegistryForm = ({ + +
{ @@ -208,21 +220,10 @@ export const RegistryForm = ({ Disabling the proxy will allow you to use the registry behind - a VPN, but will expose the auth token to the browser. + a VPN, but will expose the auth token to the browser and + require a CORS setup.
- - Date: Wed, 15 Jun 2022 11:05:20 +0000 Subject: [PATCH 4/4] update --- .../Content/routes/Settings/TeamSettings/RegistryForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx index a0b58928cf2..a64ed472942 100644 --- a/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx +++ b/packages/app/src/app/pages/Dashboard/Content/routes/Settings/TeamSettings/RegistryForm.tsx @@ -214,7 +214,7 @@ export const RegistryForm = ({ onChange={() => { setProxyEnabled(s => !s); }} - on={isLimitedToScopes} + on={proxyEnabled} disabled={disabled} />