Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC, DNM] Expose socks proxy (per user-v2 net, not per instance) #2782

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/limactl/usernet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func newUsernetCommand() *cobra.Command {
hostagentCommand.Flags().StringP("endpoint", "e", "", "exposes usernet api(s) on this endpoint")
hostagentCommand.Flags().String("listen-qemu", "", "listen for qemu connections")
hostagentCommand.Flags().String("listen", "", "listen on a Unix socket and receive Bess-compatible FDs as SCM_RIGHTS messages")
hostagentCommand.Flags().String("listen-socks", "", "listen for socks connectioss")
hostagentCommand.Flags().String("subnet", "192.168.5.0/24", "sets subnet value for the usernet network")
hostagentCommand.Flags().Int("mtu", 1500, "mtu")
hostagentCommand.Flags().StringToString("leases", nil, "pass default static leases for startup. Eg: '192.168.104.1=52:55:55:b3:bc:d9,192.168.104.2=5a:94:ef:e4:0c:df' ")
Expand Down Expand Up @@ -54,6 +55,10 @@ func usernetAction(cmd *cobra.Command, _ []string) error {
if err != nil {
return err
}
socksSocket, err := cmd.Flags().GetString("listen-socks")
if err != nil {
return err
}
subnet, err := cmd.Flags().GetString("subnet")
if err != nil {
return err
Expand All @@ -72,6 +77,7 @@ func usernetAction(cmd *cobra.Command, _ []string) error {
os.RemoveAll(endpoint)
os.RemoveAll(qemuSocket)
os.RemoveAll(fdSocket)
os.RemoveAll(socksSocket)

// Environment Variables
// LIMA_USERNET_RESOLVE_IP_ADDRESS_TIMEOUT: Specifies the timeout duration for resolving IP addresses in minutes. Default is 2 minutes.
Expand All @@ -81,6 +87,7 @@ func usernetAction(cmd *cobra.Command, _ []string) error {
Endpoint: endpoint,
QemuSocket: qemuSocket,
FdSocket: fdSocket,
SocksSocket: socksSocket,
Subnet: subnet,
DefaultLeases: leases,
})
Expand Down
25 changes: 25 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/containers/gvisor-tap-vsock v0.7.5
github.com/coreos/go-semver v0.3.1
github.com/cpuguy83/go-md2man/v2 v2.0.5
github.com/cybozu-go/usocksd v1.3.0
github.com/cyphar/filepath-securejoin v0.3.4
github.com/digitalocean/go-qemu v0.0.0-20221209210016-f035778c97f7
github.com/diskfs/go-diskfs v1.4.1
Expand Down Expand Up @@ -55,6 +56,30 @@ require (
k8s.io/client-go v0.31.1
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cybozu-go/log v1.6.1 // indirect
github.com/cybozu-go/netutil v1.4.2 // indirect
github.com/cybozu-go/well v1.11.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License check is failing

Not allowed license MPL-2.0 found for library github.com/hashicorp/hcl

Copy link
Member

@jandubois jandubois Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in the CNCF exception list (like all the other Hashicorp libraries used by Kubernetes), so using it would be fine:

  {
    "package": "github.com/hashicorp/hcl",
    "license": "MPL-2.0",
    "comment": "not auto-allowlist because: Non-allowlist license(s); approved by GB exception 2019-03-11"
  },

From https://github.com/cncf/foundation/blob/1e80c35a4b43868d5070366d9e4501babafd8a52/license-exceptions/cncf-exceptions-2022-04-12.json#L57-L61

I have not been able to figure out1 how this makes sense from a legal point of view, that some MPL libraries are acceptable and others aren't.

Footnotes

  1. Yes, including asking a former TOC member.

github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/onsi/gomega v1.34.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.12.0 // indirect
github.com/subosito/gotenv v1.4.0 // indirect
github.com/vishvananda/netlink v1.3.0 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
)

require (
github.com/Code-Hex/go-infinity-channel v1.0.0 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
Expand Down
Loading
Loading