From 869c11ff14495c7d9dcad17cd495edaa7a6381b2 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Thu, 4 May 2023 11:13:19 -0500 Subject: [PATCH 1/4] chore: Remove extra opt and fix 'proxy' alias --- codersdk/deployment.go | 2 +- enterprise/cli/workspaceproxy.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codersdk/deployment.go b/codersdk/deployment.go index aaee164d5a2b3..f328e46a00021 100644 --- a/codersdk/deployment.go +++ b/codersdk/deployment.go @@ -1352,7 +1352,7 @@ when required by your organization's security policy.`, Description: "Whether Coder only allows connections to workspaces via the browser.", Flag: "browser-only", Env: "CODER_BROWSER_ONLY", - Annotations: clibase.Annotations{}.Mark(annotationEnterpriseKey, "true").Mark(annotationExternalProxies, "true"), + Annotations: clibase.Annotations{}.Mark(annotationEnterpriseKey, "true"), Value: &c.BrowserOnly, Group: &deploymentGroupNetworking, YAML: "browserOnly", diff --git a/enterprise/cli/workspaceproxy.go b/enterprise/cli/workspaceproxy.go index 54ecc21928595..ef4f57ab3c436 100644 --- a/enterprise/cli/workspaceproxy.go +++ b/enterprise/cli/workspaceproxy.go @@ -16,7 +16,7 @@ func (r *RootCmd) workspaceProxy() *clibase.Cmd { cmd := &clibase.Cmd{ Use: "workspace-proxy", Short: "Manage workspace proxies", - Aliases: []string{"proxy"}, + Aliases: []string{"wsproxy"}, Hidden: true, Handler: func(inv *clibase.Invocation) error { return inv.Command.HelpHandler(inv) From 1c6185639ae39f05c5a179dfb60e9303b87dbd0e Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Thu, 4 May 2023 11:17:02 -0500 Subject: [PATCH 2/4] Update service script --- scripts/linux-pkg/coder-workspace-proxy.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux-pkg/coder-workspace-proxy.service b/scripts/linux-pkg/coder-workspace-proxy.service index 988f7a4d80d4a..d15f24ae22223 100644 --- a/scripts/linux-pkg/coder-workspace-proxy.service +++ b/scripts/linux-pkg/coder-workspace-proxy.service @@ -22,7 +22,7 @@ CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK CAP_NET_BIND_SERVICE KillSignal=SIGINT KillMode=mixed NoNewPrivileges=yes -ExecStart=/usr/bin/coder proxy server +ExecStart=/usr/bin/coder workspace-proxy server Restart=on-failure RestartSec=5 TimeoutStopSec=90 From f6bdcd6fa2e2ec8bcdf10bc1d303f70e98583804 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Fri, 5 May 2023 09:39:34 -0500 Subject: [PATCH 3/4] proxy -> wsproxy --- enterprise/cli/workspaceproxy_test.go | 6 +++--- scripts/develop.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/enterprise/cli/workspaceproxy_test.go b/enterprise/cli/workspaceproxy_test.go index 31989b047dd54..de2316f9ab7a9 100644 --- a/enterprise/cli/workspaceproxy_test.go +++ b/enterprise/cli/workspaceproxy_test.go @@ -45,7 +45,7 @@ func Test_ProxyCRUD(t *testing.T) { ctx := testutil.Context(t, testutil.WaitLong) inv, conf := newCLI( t, - "proxy", "create", + "wsproxy", "create", "--name", expectedName, "--display-name", "Test Proxy", "--icon", "/emojis/1f4bb.png", @@ -68,7 +68,7 @@ func Test_ProxyCRUD(t *testing.T) { // Fetch proxies and check output inv, conf = newCLI( t, - "proxy", "ls", + "wsproxy", "ls", ) pty = ptytest.New(t) @@ -118,7 +118,7 @@ func Test_ProxyCRUD(t *testing.T) { inv, conf := newCLI( t, - "proxy", "delete", expectedName, + "wsproxy", "delete", expectedName, ) pty := ptytest.New(t) diff --git a/scripts/develop.sh b/scripts/develop.sh index e5a194bc26168..db25e1a138327 100755 --- a/scripts/develop.sh +++ b/scripts/develop.sh @@ -183,9 +183,9 @@ fatal() { # Attempt to delete the proxy first, in case it already exists. "${CODER_DEV_SHIM}" proxy delete local-proxy || true # Create the proxy - proxy_session_token=$("${CODER_DEV_SHIM}" proxy create --name=local-proxy --display-name="Local Proxy" --icon="/emojis/1f4bb.png" --only-token) + proxy_session_token=$("${CODER_DEV_SHIM}" wsproxy create --name=local-proxy --display-name="Local Proxy" --icon="/emojis/1f4bb.png" --only-token) # Start the proxy - start_cmd PROXY "" "${CODER_DEV_SHIM}" proxy server --http-address=localhost:3010 --proxy-session-token="${proxy_session_token}" --primary-access-url=http://localhost:3000 + start_cmd PROXY "" "${CODER_DEV_SHIM}" wsproxy server --http-address=localhost:3010 --proxy-session-token="${proxy_session_token}" --primary-access-url=http://localhost:3000 ) || echo "Failed to create workspace proxy. No workspace proxy created." fi From 8839ee092ceecf0bc82945a1c90470b3506b9aba Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Fri, 5 May 2023 09:46:22 -0500 Subject: [PATCH 4/4] Fix wsproxy delete --- scripts/develop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/develop.sh b/scripts/develop.sh index db25e1a138327..6179676c2654c 100755 --- a/scripts/develop.sh +++ b/scripts/develop.sh @@ -181,7 +181,7 @@ fatal() { log "Using external workspace proxy" ( # Attempt to delete the proxy first, in case it already exists. - "${CODER_DEV_SHIM}" proxy delete local-proxy || true + "${CODER_DEV_SHIM}" wsproxy delete local-proxy || true # Create the proxy proxy_session_token=$("${CODER_DEV_SHIM}" wsproxy create --name=local-proxy --display-name="Local Proxy" --icon="/emojis/1f4bb.png" --only-token) # Start the proxy