Skip to content
Next Next commit
impl: configurable network info location
Adds support for a configurable path where ssh network info stats
are going to be saved.
  • Loading branch information
fioan89 committed May 7, 2025
commit 22010e157ae9f38483d03121edd2f20537bf6ec3
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ interface ReadOnlyCoderSettings {
*/
val sshConfigOptions: String?


/**
* The path where network information for SSH hosts are stored
*/
val networkInfoDir: String

/**
* The default URL to show in the connection window.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/com/coder/toolbox/store/CoderSettingsStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class CoderSettingsStore(
override val sshLogDirectory: String? get() = store[SSH_LOG_DIR]
override val sshConfigOptions: String?
get() = store[SSH_CONFIG_OPTIONS].takeUnless { it.isNullOrEmpty() } ?: env.get(CODER_SSH_CONFIG_OPTIONS)
override val networkInfoDir: String
get() = store[NETWORK_INFO_DIR].takeUnless { it.isNullOrEmpty() } ?: getDefaultGlobalDataDir()
.resolve("network-info")
.normalize()
.toString()

/**
* The default URL to show in the connection window.
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/coder/toolbox/store/StoreKeys.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ internal const val SSH_LOG_DIR = "sshLogDir"

internal const val SSH_CONFIG_OPTIONS = "sshConfigOptions"

internal const val NETWORK_INFO_DIR = "networkInfoDir"