- Notifications
You must be signed in to change notification settings - Fork16
chore: use background hostname for admin tasks#446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
ddc22bf
chore: use background hostname for admin tasks
f0ssel3ee1a22
remove space
f0ssel4155b13
try test fix
f0ssel44856b4
try test fix
f0ssel405a485
try test fix
f0ssel75c825d
rebase
f0ssel6ff0681
use background on ssh command exec
f0ssele6e77c2
remove env
f0ssel54232b7
fix newline
f0sselcf673a1
disable on bg hostname
f0sselFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
11 changes: 9 additions & 2 deletionssrc/main/kotlin/com/coder/gateway/CoderRemoteConnectionHandle.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
34 changes: 31 additions & 3 deletionssrc/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -255,7 +255,7 @@ | ||
val startBlock = "# --- START CODER JETBRAINS $host" | ||
val endBlock = "# --- END CODER JETBRAINS $host" | ||
val isRemoving = workspaceNames.isEmpty() | ||
valbaseArgs = | ||
listOfNotNull( | ||
escape(localBinaryPath.toString()), | ||
"--global-config", | ||
@@ -265,8 +265,9 @@ | ||
"ssh", | ||
"--stdio", | ||
if (settings.disableAutostart && feats.disableAutostart) "--disable-autostart" else null, | ||
) | ||
val proxyArgs = baseArgs + listOfNotNull(if (feats.reportWorkspaceUsage) "--usage-app=jetbrains" else null) | ||
val backgroundProxyArgs = baseArgs + listOfNotNull(if (feats.reportWorkspaceUsage) "--usage-app=disable" else null) | ||
val extraConfig = | ||
if (settings.sshConfigOptions.isNotBlank()) { | ||
"\n" + settings.sshConfigOptions.prependIndent(" ") | ||
@@ -289,7 +290,19 @@ | ||
SetEnv CODER_SSH_SESSION_TYPE=JetBrains | ||
""".trimIndent() | ||
.plus(extraConfig) | ||
.plus("\n") | ||
code-asher marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
.plus( | ||
""" | ||
Host ${getBackgroundHostName(deploymentURL, it)} | ||
ProxyCommand ${backgroundProxyArgs.joinToString(" ")} $it | ||
ConnectTimeout 0 | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
LogLevel ERROR | ||
SetEnv CODER_SSH_SESSION_TYPE=JetBrains | ||
""".trimIndent() | ||
.plus(extraConfig) | ||
).replace("\n", System.lineSeparator()) | ||
}, | ||
) | ||
@@ -465,5 +478,20 @@ | ||
): String { | ||
return "coder-jetbrains--$workspaceName--${url.safeHost()}" | ||
} | ||
@JvmStatic | ||
fun getBackgroundHostName( | ||
url: URL, | ||
workspaceName: String, | ||
): String { | ||
return getHostName(url, workspaceName) + "--bg" | ||
} | ||
@JvmStatic | ||
fun getBackgroundHostName( | ||
hostname: String, | ||
): String { | ||
return hostname + "--bg" | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletionsrc/main/kotlin/com/coder/gateway/views/steps/CoderWorkspaceProjectIDEStepView.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/append-blank-newlines.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4,7 +4,14 @@ | ||
# --- START CODER JETBRAINS test.coder.invalid | ||
Host coder-jetbrains--foo-bar--test.coder.invalid | ||
ProxyCommand /tmp/coder-gateway/test.coder.invalid/coder-linux-amd64 --global-config /tmp/coder-gateway/test.coder.invalid/config ssh --stdio --usage-app=jetbrains foo-bar | ||
ConnectTimeout 0 | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
f0ssel marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
LogLevel ERROR | ||
SetEnv CODER_SSH_SESSION_TYPE=JetBrains | ||
Host coder-jetbrains--foo-bar--test.coder.invalid--bg | ||
ProxyCommand /tmp/coder-gateway/test.coder.invalid/coder-linux-amd64 --global-config /tmp/coder-gateway/test.coder.invalid/config ssh --stdio --usage-app=disable foo-bar | ||
ConnectTimeout 0 | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/append-blank.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/append-no-blocks.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/append-no-newline.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/append-no-related-blocks.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/disable-autostart.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletionsrc/test/fixtures/outputs/extra-config.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/header-command-windows.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/header-command.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletionssrc/test/fixtures/outputs/multiple-workspaces.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/no-disable-autostart.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/report-usage.conf → ...est/fixtures/outputs/no-report-usage.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/replace-end-no-newline.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/replace-end.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletionsrc/test/fixtures/outputs/replace-middle-ignore-unrelated.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.