mirror of https://github.com/coder/coder.git
chore: Remove extra opt and fix 'proxy' alias (#7413)
* chore: Remove extra opt and fix 'proxy' alias * proxy -> wsproxy
This commit is contained in:
parent
ec11405208
commit
2624ee8f12
|
@ -1350,7 +1350,7 @@ when required by your organization's security policy.`,
|
||||||
Description: "Whether Coder only allows connections to workspaces via the browser.",
|
Description: "Whether Coder only allows connections to workspaces via the browser.",
|
||||||
Flag: "browser-only",
|
Flag: "browser-only",
|
||||||
Env: "CODER_BROWSER_ONLY",
|
Env: "CODER_BROWSER_ONLY",
|
||||||
Annotations: clibase.Annotations{}.Mark(annotationEnterpriseKey, "true").Mark(annotationExternalProxies, "true"),
|
Annotations: clibase.Annotations{}.Mark(annotationEnterpriseKey, "true"),
|
||||||
Value: &c.BrowserOnly,
|
Value: &c.BrowserOnly,
|
||||||
Group: &deploymentGroupNetworking,
|
Group: &deploymentGroupNetworking,
|
||||||
YAML: "browserOnly",
|
YAML: "browserOnly",
|
||||||
|
|
|
@ -16,7 +16,7 @@ func (r *RootCmd) workspaceProxy() *clibase.Cmd {
|
||||||
cmd := &clibase.Cmd{
|
cmd := &clibase.Cmd{
|
||||||
Use: "workspace-proxy",
|
Use: "workspace-proxy",
|
||||||
Short: "Manage workspace proxies",
|
Short: "Manage workspace proxies",
|
||||||
Aliases: []string{"proxy"},
|
Aliases: []string{"wsproxy"},
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
Handler: func(inv *clibase.Invocation) error {
|
Handler: func(inv *clibase.Invocation) error {
|
||||||
return inv.Command.HelpHandler(inv)
|
return inv.Command.HelpHandler(inv)
|
||||||
|
|
|
@ -45,7 +45,7 @@ func Test_ProxyCRUD(t *testing.T) {
|
||||||
ctx := testutil.Context(t, testutil.WaitLong)
|
ctx := testutil.Context(t, testutil.WaitLong)
|
||||||
inv, conf := newCLI(
|
inv, conf := newCLI(
|
||||||
t,
|
t,
|
||||||
"proxy", "create",
|
"wsproxy", "create",
|
||||||
"--name", expectedName,
|
"--name", expectedName,
|
||||||
"--display-name", "Test Proxy",
|
"--display-name", "Test Proxy",
|
||||||
"--icon", "/emojis/1f4bb.png",
|
"--icon", "/emojis/1f4bb.png",
|
||||||
|
@ -68,7 +68,7 @@ func Test_ProxyCRUD(t *testing.T) {
|
||||||
// Fetch proxies and check output
|
// Fetch proxies and check output
|
||||||
inv, conf = newCLI(
|
inv, conf = newCLI(
|
||||||
t,
|
t,
|
||||||
"proxy", "ls",
|
"wsproxy", "ls",
|
||||||
)
|
)
|
||||||
|
|
||||||
pty = ptytest.New(t)
|
pty = ptytest.New(t)
|
||||||
|
@ -118,7 +118,7 @@ func Test_ProxyCRUD(t *testing.T) {
|
||||||
|
|
||||||
inv, conf := newCLI(
|
inv, conf := newCLI(
|
||||||
t,
|
t,
|
||||||
"proxy", "delete", expectedName,
|
"wsproxy", "delete", expectedName,
|
||||||
)
|
)
|
||||||
|
|
||||||
pty := ptytest.New(t)
|
pty := ptytest.New(t)
|
||||||
|
|
|
@ -181,11 +181,11 @@ fatal() {
|
||||||
log "Using external workspace proxy"
|
log "Using external workspace proxy"
|
||||||
(
|
(
|
||||||
# Attempt to delete the proxy first, in case it already exists.
|
# 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
|
# 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 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."
|
) || echo "Failed to create workspace proxy. No workspace proxy created."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK CAP_NET_BIND_SERVICE
|
||||||
KillSignal=SIGINT
|
KillSignal=SIGINT
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
ExecStart=/usr/bin/coder proxy server
|
ExecStart=/usr/bin/coder workspace-proxy server
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
TimeoutStopSec=90
|
TimeoutStopSec=90
|
||||||
|
|
Loading…
Reference in New Issue