Skip to content

Commit 2c5cabc

Browse files
committed
fix
1 parent 2b7fc41 commit 2c5cabc

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

cli/cli.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ func Run(config Config, args []string) error {
140140
HTTPSPort: 8043,
141141
}
142142

143-
// Create network namespace instance
144-
networkInstance, err := namespace.New(nsConfig, logger)
143+
// Create commander
144+
commander, err := namespace.New(nsConfig, logger)
145145
if err != nil {
146146
logger.Error("Failed to create network namespace", "error", err)
147147
return fmt.Errorf("failed to create network namespace: %v", err)
@@ -176,13 +176,13 @@ func Run(config Config, args []string) error {
176176

177177
// Set standard CA certificate environment variables for common tools
178178
// This makes tools like curl, git, etc. trust our dynamically generated CA
179-
networkInstance.SetEnv("SSL_CERT_FILE", caCertPath) // OpenSSL/LibreSSL-based tools
180-
networkInstance.SetEnv("SSL_CERT_DIR", configDir) // OpenSSL certificate directory
181-
networkInstance.SetEnv("CURL_CA_BUNDLE", caCertPath) // curl
182-
networkInstance.SetEnv("GIT_SSL_CAINFO", caCertPath) // Git
183-
networkInstance.SetEnv("REQUESTS_CA_BUNDLE", caCertPath) // Python requests
184-
networkInstance.SetEnv("NODE_EXTRA_CA_CERTS", caCertPath) // Node.js
185-
networkInstance.SetEnv("JAIL_CA_CERT", string(caCertPEM)) // Keep for backward compatibility
179+
commander.SetEnv("SSL_CERT_FILE", caCertPath) // OpenSSL/LibreSSL-based tools
180+
commander.SetEnv("SSL_CERT_DIR", configDir) // OpenSSL certificate directory
181+
commander.SetEnv("CURL_CA_BUNDLE", caCertPath) // curl
182+
commander.SetEnv("GIT_SSL_CAINFO", caCertPath) // Git
183+
commander.SetEnv("REQUESTS_CA_BUNDLE", caCertPath) // Python requests
184+
commander.SetEnv("NODE_EXTRA_CA_CERTS", caCertPath) // Node.js
185+
commander.SetEnv("JAIL_CA_CERT", string(caCertPEM)) // Keep for backward compatibility
186186
}
187187

188188
// Create proxy server
@@ -199,9 +199,9 @@ func Run(config Config, args []string) error {
199199

200200
// Create jail configuration with constructed dependencies
201201
jailConfig := jail.Config{
202-
CommandExecutor: networkInstance,
203-
ProxyServer: proxyServer,
204-
Logger: logger,
202+
Commander: commander,
203+
ProxyServer: proxyServer,
204+
Logger: logger,
205205
}
206206

207207
// Create jail instance

jail.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ type Commander interface {
1818
}
1919

2020
type Config struct {
21-
CommandExecutor Commander
22-
ProxyServer *proxy.ProxyServer
23-
Logger *slog.Logger
21+
Commander Commander
22+
ProxyServer *proxy.ProxyServer
23+
Logger *slog.Logger
2424
}
2525

2626
type Jail struct {
@@ -35,7 +35,7 @@ func New(config Config) *Jail {
3535
ctx, cancel := context.WithCancel(context.Background())
3636

3737
return &Jail{
38-
commandExecutor: config.CommandExecutor,
38+
commandExecutor: config.Commander,
3939
proxyServer: config.ProxyServer,
4040
logger: config.Logger,
4141
ctx: ctx,

0 commit comments

Comments
 (0)