Skip to content

Add header command setting #303

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 22, 2023
Next Next commit
Add header command setting
  • Loading branch information
code-asher committed Sep 18, 2023
commit 673a7454cd1b706ffe79bd5ebe82f732ea63ed7a
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ class CoderSettingsConfigurable : BoundConfigurable("Coder") {
CoderGatewayBundle.message("gateway.connector.settings.enable-binary-directory-fallback.comment")
)
}.layout(RowLayout.PARENT_GRID)
row(CoderGatewayBundle.message("gateway.connector.settings.header-command.title")) {
textField().resizableColumn().align(AlignX.FILL)
.bindText(state::headerCommand)
.comment(
CoderGatewayBundle.message("gateway.connector.settings.header-command.comment")
)
}.layout(RowLayout.PARENT_GRID)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CoderSettingsState : PersistentStateComponent<CoderSettingsState> {
var dataDirectory: String = ""
var enableDownloads: Boolean = true
var enableBinaryDirectoryFallback: Boolean = false
var headerCommand: String = ""
override fun getState(): CoderSettingsState {
return this
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/messages/CoderGatewayBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,8 @@ gateway.connector.settings.enable-binary-directory-fallback.title=Fall back to d
gateway.connector.settings.enable-binary-directory-fallback.comment=Checking this \
box will allow the plugin to fall back to the data directory when the CLI \
directory is not writable.
gateway.connector.settings.header-command.title=Header command:
gateway.connector.settings.header-command.comment=An external command that \
outputs additional HTTP headers added to all requests. The command must \
output each header as `key=value` on its own line. The following \
environment variables will be available to the process: CODER_URL.