fix: default proxy/DNS to GreyProxy ports (43052/43053)
Switch from internal GreyHaven ports (42052/42053) to GreyProxy defaults so users no longer need to pass --proxy and --dns flags manually.
This commit is contained in:
@@ -127,7 +127,7 @@ Greywall reads from `~/.config/greywall/greywall.json` by default (or `~/Library
|
|||||||
|
|
||||||
Use `greywall --settings ./custom.json` to specify a different config file.
|
Use `greywall --settings ./custom.json` to specify a different config file.
|
||||||
|
|
||||||
By default (when connected to GreyHaven), traffic routes through the GreyHaven SOCKS5 proxy at `localhost:42052` with DNS via `localhost:42053`.
|
By default, traffic routes through the GreyProxy SOCKS5 proxy at `localhost:43052` with DNS via `localhost:43053`.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ func main() {
|
|||||||
Long: `greywall is a command-line tool that runs commands in a sandboxed environment
|
Long: `greywall is a command-line tool that runs commands in a sandboxed environment
|
||||||
with network and filesystem restrictions.
|
with network and filesystem restrictions.
|
||||||
|
|
||||||
By default, traffic is routed through the GreyHaven SOCKS5 proxy at localhost:42051
|
By default, traffic is routed through the GreyProxy SOCKS5 proxy at localhost:43052
|
||||||
with DNS via localhost:42053. Use --proxy and --dns to override, or configure in
|
with DNS via localhost:43053. Use --proxy and --dns to override, or configure in
|
||||||
your settings file at ~/.config/greywall/greywall.json (or ~/Library/Application Support/greywall/greywall.json on macOS).
|
your settings file at ~/.config/greywall/greywall.json (or ~/Library/Application Support/greywall/greywall.json on macOS).
|
||||||
|
|
||||||
On Linux, greywall uses tun2socks for truly transparent proxying: all TCP/UDP traffic
|
On Linux, greywall uses tun2socks for truly transparent proxying: all TCP/UDP traffic
|
||||||
@@ -98,8 +98,8 @@ Configuration file format:
|
|||||||
rootCmd.Flags().BoolVarP(&debug, "debug", "d", false, "Enable debug logging")
|
rootCmd.Flags().BoolVarP(&debug, "debug", "d", false, "Enable debug logging")
|
||||||
rootCmd.Flags().BoolVarP(&monitor, "monitor", "m", false, "Monitor and log sandbox violations")
|
rootCmd.Flags().BoolVarP(&monitor, "monitor", "m", false, "Monitor and log sandbox violations")
|
||||||
rootCmd.Flags().StringVarP(&settingsPath, "settings", "s", "", "Path to settings file (default: OS config directory)")
|
rootCmd.Flags().StringVarP(&settingsPath, "settings", "s", "", "Path to settings file (default: OS config directory)")
|
||||||
rootCmd.Flags().StringVar(&proxyURL, "proxy", "", "External SOCKS5 proxy URL (default: socks5://localhost:42052)")
|
rootCmd.Flags().StringVar(&proxyURL, "proxy", "", "External SOCKS5 proxy URL (default: socks5://localhost:43052)")
|
||||||
rootCmd.Flags().StringVar(&dnsAddr, "dns", "", "DNS server address on host (default: localhost:42053)")
|
rootCmd.Flags().StringVar(&dnsAddr, "dns", "", "DNS server address on host (default: localhost:43053)")
|
||||||
rootCmd.Flags().StringVarP(&cmdString, "c", "c", "", "Run command string directly (like sh -c)")
|
rootCmd.Flags().StringVarP(&cmdString, "c", "c", "", "Run command string directly (like sh -c)")
|
||||||
rootCmd.Flags().StringArrayVarP(&exposePorts, "port", "p", nil, "Expose port for inbound connections (can be used multiple times)")
|
rootCmd.Flags().StringArrayVarP(&exposePorts, "port", "p", nil, "Expose port for inbound connections (can be used multiple times)")
|
||||||
rootCmd.Flags().BoolVarP(&showVersion, "version", "v", false, "Show version information")
|
rootCmd.Flags().BoolVarP(&showVersion, "version", "v", false, "Show version information")
|
||||||
@@ -231,18 +231,18 @@ func runCommand(cmd *cobra.Command, args []string) error {
|
|||||||
cfg.Network.DnsAddr = dnsAddr
|
cfg.Network.DnsAddr = dnsAddr
|
||||||
}
|
}
|
||||||
|
|
||||||
// GreyHaven defaults: when no proxy or DNS is configured (neither via CLI
|
// GreyProxy defaults: when no proxy or DNS is configured (neither via CLI
|
||||||
// nor config file), use the standard GreyHaven infrastructure ports.
|
// nor config file), use the standard GreyProxy ports.
|
||||||
if cfg.Network.ProxyURL == "" {
|
if cfg.Network.ProxyURL == "" {
|
||||||
cfg.Network.ProxyURL = "socks5://localhost:42052"
|
cfg.Network.ProxyURL = "socks5://localhost:43052"
|
||||||
if debug {
|
if debug {
|
||||||
fmt.Fprintf(os.Stderr, "[greywall] Defaulting proxy to socks5://localhost:42052\n")
|
fmt.Fprintf(os.Stderr, "[greywall] Defaulting proxy to socks5://localhost:43052\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if cfg.Network.DnsAddr == "" {
|
if cfg.Network.DnsAddr == "" {
|
||||||
cfg.Network.DnsAddr = "localhost:42053"
|
cfg.Network.DnsAddr = "localhost:43053"
|
||||||
if debug {
|
if debug {
|
||||||
fmt.Fprintf(os.Stderr, "[greywall] Defaulting DNS to localhost:42053\n")
|
fmt.Fprintf(os.Stderr, "[greywall] Defaulting DNS to localhost:43053\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user