- 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 from1 commit
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
NextNext commit
chore: use background hostname for admin tasks
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commitddc22bf9cfcd0f316d40b197b5c8f908fc74f04c
There are no files selected for viewing
8 changes: 7 additions & 1 deletionsrc/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -141,7 +141,13 @@ class CoderRemoteConnectionHandle { | ||
port = 22 | ||
authType = AuthType.OPEN_SSH | ||
} | ||
val backgroundCredentials = RemoteCredentialsHolder().apply { | ||
setHost(workspace.hostname) | ||
f0ssel marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
userName = "coder" | ||
port = 22 | ||
authType = AuthType.OPEN_SSH | ||
} | ||
val accessor = HighLevelHostAccessor.create(backgroundCredentials, true) | ||
// Deploy if we need to. | ||
val ideDir = this.deploy(workspace, accessor, indicator, timeout) | ||
18 changes: 17 additions & 1 deletionsrc/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 |
---|---|---|
@@ -281,7 +281,15 @@ class CoderCLIManager( | ||
transform = { | ||
""" | ||
Host ${getHostName(deploymentURL, it)} | ||
ProxyCommand CODER_SSH_USAGE_APP=jetbrains ${proxyArgs.joinToString(" ")} $it | ||
f0ssel marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
ConnectTimeout 0 | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
LogLevel ERROR | ||
SetEnv CODER_SSH_SESSION_TYPE=JetBrains | ||
Host ${getBackgroundHostName(deploymentURL, it)} | ||
ProxyCommand CODER_SSH_USAGE_APP=disable ${proxyArgs.joinToString(" ")} $it | ||
ConnectTimeout 0 | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
@@ -465,5 +473,13 @@ class CoderCLIManager( | ||
): String { | ||
return "coder-jetbrains--$workspaceName--${url.safeHost()}" | ||
} | ||
@JvmStatic | ||
fun getBackgroundHostName( | ||
url: URL, | ||
workspaceName: String, | ||
): String { | ||
return getHostName(url, workspaceName) + "--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
7 changes: 7 additions & 0 deletionssrc/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 |
---|---|---|
@@ -10,4 +10,11 @@ Host coder-jetbrains--foo-bar--test.coder.invalid | ||
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 CODER_SSH_USAGE_APP=disable /tmp/coder-gateway/test.coder.invalid/coder-linux-amd64 --global-config /tmp/coder-gateway/test.coder.invalid/config ssh --stdio foo-bar | ||
ConnectTimeout 0 | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
LogLevel ERROR | ||
SetEnv CODER_SSH_SESSION_TYPE=JetBrains | ||
# --- END CODER JETBRAINS test.coder.invalid |
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
9 changes: 9 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
14 changes: 14 additions & 0 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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/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
7 changes: 7 additions & 0 deletionssrc/test/fixtures/outputs/replace-middle.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
7 changes: 7 additions & 0 deletionssrc/test/fixtures/outputs/replace-only.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
7 changes: 7 additions & 0 deletionssrc/test/fixtures/outputs/replace-start.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
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.