Skip to content

Commit c686f4f

Browse files
add boolean flag for stub resolved
1 parent 4e74d59 commit c686f4f

3 files changed

Lines changed: 25 additions & 17 deletions

File tree

app/app.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ import (
1515

1616
// Config holds all configuration for the CLI
1717
type Config struct {
18-
Config serpent.YAMLConfigPath `yaml:"-"`
19-
AllowListStrings serpent.StringArray `yaml:"allowlist"` // From config file
20-
AllowStrings serpent.StringArray `yaml:"-"` // From CLI flags only
21-
LogLevel serpent.String `yaml:"log_level"`
22-
LogDir serpent.String `yaml:"log_dir"`
23-
ProxyPort serpent.Int64 `yaml:"proxy_port"`
24-
PprofEnabled serpent.Bool `yaml:"pprof_enabled"`
25-
PprofPort serpent.Int64 `yaml:"pprof_port"`
18+
Config serpent.YAMLConfigPath `yaml:"-"`
19+
AllowListStrings serpent.StringArray `yaml:"allowlist"` // From config file
20+
AllowStrings serpent.StringArray `yaml:"-"` // From CLI flags only
21+
LogLevel serpent.String `yaml:"log_level"`
22+
LogDir serpent.String `yaml:"log_dir"`
23+
ProxyPort serpent.Int64 `yaml:"proxy_port"`
24+
PprofEnabled serpent.Bool `yaml:"pprof_enabled"`
25+
PprofPort serpent.Int64 `yaml:"pprof_port"`
26+
EnableLocalStubResolverDNS serpent.Bool `yaml:"enable_local_stub_resolver_dns"`
2627
}
2728

2829
func isChild() bool {

app/parent.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ func RunParent(ctx context.Context, logger *slog.Logger, args []string, config C
7272

7373
// Create jailer with cert path from TLS setup
7474
jailer, err := jail.NewLinuxJail(jail.Config{
75-
Logger: logger,
76-
HttpProxyPort: int(config.ProxyPort.Value()),
77-
Username: username,
78-
Uid: uid,
79-
Gid: gid,
80-
HomeDir: homeDir,
81-
ConfigDir: configDir,
82-
CACertPath: caCertPath,
83-
EnableLocalStubResolverDNS: false, // Set to true if host uses systemd-resolved with localhost DNS
75+
Logger: logger,
76+
HttpProxyPort: int(config.ProxyPort.Value()),
77+
Username: username,
78+
Uid: uid,
79+
Gid: gid,
80+
HomeDir: homeDir,
81+
ConfigDir: configDir,
82+
CACertPath: caCertPath,
83+
EnableLocalStubResolverDNS: config.EnableLocalStubResolverDNS.Value(),
8484
})
8585
if err != nil {
8686
return fmt.Errorf("failed to create jailer: %v", err)

cli/cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ func BaseCommand() *serpent.Command {
108108
Value: &config.PprofPort,
109109
YAML: "pprof_port",
110110
},
111+
{
112+
Flag: "enable-local-stub-resolver-dns",
113+
Env: "BOUNDARY_ENABLE_LOCAL_STUB_RESOLVER_DNS",
114+
Description: "Enable DNS configuration for local stub resolver (e.g., systemd-resolved). Only needed when /etc/resolv.conf contains nameserver 127.0.0.53.",
115+
Value: &config.EnableLocalStubResolverDNS,
116+
YAML: "enable_local_stub_resolver_dns",
117+
},
111118
},
112119
Handler: func(inv *serpent.Invocation) error {
113120
args := inv.Args

0 commit comments

Comments
 (0)