Skip to content

Commit 22010e1

Browse files
committed
impl: configurable network info location
Adds support for a configurable path where ssh network info stats are going to be saved.
1 parent 6a96e98 commit 22010e1

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/main/kotlin/com/coder/toolbox/settings/ReadOnlyCoderSettings.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ interface ReadOnlyCoderSettings {
110110
*/
111111
val sshConfigOptions: String?
112112

113+
114+
/**
115+
* The path where network information for SSH hosts are stored
116+
*/
117+
val networkInfoDir: String
118+
113119
/**
114120
* The default URL to show in the connection window.
115121
*/

src/main/kotlin/com/coder/toolbox/store/CoderSettingsStore.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ class CoderSettingsStore(
6565
override val sshLogDirectory: String? get() = store[SSH_LOG_DIR]
6666
override val sshConfigOptions: String?
6767
get() = store[SSH_CONFIG_OPTIONS].takeUnless { it.isNullOrEmpty() } ?: env.get(CODER_SSH_CONFIG_OPTIONS)
68+
override val networkInfoDir: String
69+
get() = store[NETWORK_INFO_DIR].takeUnless { it.isNullOrEmpty() } ?: getDefaultGlobalDataDir()
70+
.resolve("network-info")
71+
.normalize()
72+
.toString()
6873

6974
/**
7075
* The default URL to show in the connection window.

src/main/kotlin/com/coder/toolbox/store/StoreKeys.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ internal const val SSH_LOG_DIR = "sshLogDir"
3838

3939
internal const val SSH_CONFIG_OPTIONS = "sshConfigOptions"
4040

41+
internal const val NETWORK_INFO_DIR = "networkInfoDir"
42+

0 commit comments

Comments
 (0)