Skip to content

Commit

Permalink
only apply ExternalController in Override settings (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
karin0 authored and wwqgtxx committed Sep 11, 2024
1 parent a04c188 commit bb2c528
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
15 changes: 13 additions & 2 deletions core/src/main/golang/native/config/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

var processors = []processor{
patchExternalController, // must before patchOverride, so we only apply ExternalController in Override settings
patchOverride,
patchGeneral,
patchProfile,
Expand All @@ -39,9 +40,19 @@ func patchOverride(cfg *config.RawConfig, _ string) error {
return nil
}

func patchGeneral(cfg *config.RawConfig, _ string) error {
func patchExternalController(cfg *config.RawConfig, _ string) error {
cfg.ExternalController = ""
cfg.ExternalControllerTLS = ""

return nil
}

func patchGeneral(cfg *config.RawConfig, profileDir string) error {
cfg.Interface = ""
cfg.ExternalUI = ""
cfg.RoutingMark = 0
if cfg.ExternalController != "" || cfg.ExternalControllerTLS != "" {
cfg.ExternalUI = profileDir + "/ui"
}

return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ data class ConfigurationOverride(
var ipv6: Boolean? = null,

@SerialName("external-controller")
var externalController: String? = "127.0.0.1:0",
var externalController: String? = null,

@SerialName("external-controller-tls")
var externalControllerTLS: String? = null,

@SerialName("secret")
var secret: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ class OverrideSettingsDesign(
empty = R.string.default_
)

editableText(
value = configuration::externalControllerTLS,
adapter = NullableTextAdapter.String,
title = R.string.external_controller_tls,
placeholder = R.string.dont_modify,
empty = R.string.default_
)

editableText(
value = configuration::secret,
adapter = NullableTextAdapter.String,
Expand Down
1 change: 1 addition & 0 deletions design/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
<string name="log_level">Log Level</string>
<string name="ipv6">IPv6</string>
<string name="external_controller">External Controller</string>
<string name="external_controller_tls">External Controller TLS</string>
<string name="secret">Secret</string>
<string name="hosts">Hosts</string>
<string name="_new">New</string>
Expand Down

0 comments on commit bb2c528

Please sign in to comment.