From 1e551ed7010c9c27d89c983b95f21907bad5ae57 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Sep 2025 22:17:06 +1000 Subject: [PATCH 1/6] Fix CHISEL_KEY environment variable ignored when --keyfile not set (#571) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jpillora <633843+jpillora@users.noreply.github.com> Signed-off-by: samartha.pm --- main.go | 3 +- test/e2e/env_key_test.go | 65 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 test/e2e/env_key_test.go diff --git a/main.go b/main.go index 01f9ca3b..7af1f45e 100644 --- a/main.go +++ b/main.go @@ -237,7 +237,8 @@ func server(args []string) { } if config.KeyFile == "" { config.KeyFile = settings.Env("KEY_FILE") - } else if config.KeySeed == "" { + } + if config.KeySeed == "" { config.KeySeed = settings.Env("KEY") } if config.Auth == "" { diff --git a/test/e2e/env_key_test.go b/test/e2e/env_key_test.go new file mode 100644 index 00000000..c193f748 --- /dev/null +++ b/test/e2e/env_key_test.go @@ -0,0 +1,65 @@ +package e2e_test + +import ( + "os" + "testing" + + chclient "github.com/jpillora/chisel/client" + chserver "github.com/jpillora/chisel/server" +) + +func TestChiselKeyEnvironmentVariable(t *testing.T) { + // Set the CHISEL_KEY environment variable + os.Setenv("CHISEL_KEY", "test-key-value") + defer os.Unsetenv("CHISEL_KEY") + + tmpPort := availablePort() + + // Create server with empty config - should pick up CHISEL_KEY env var + serverConfig := &chserver.Config{} + + // Setup server and client + teardown := simpleSetup(t, + serverConfig, + &chclient.Config{ + Remotes: []string{tmpPort + ":$FILEPORT"}, + }) + defer teardown() + + // Test that the connection works - if the key is properly set, + // the server should start successfully and connections should work + result, err := post("http://localhost:"+tmpPort, "env-key-test") + if err != nil { + t.Fatal(err) + } + if result != "env-key-test!" { + t.Fatalf("expected exclamation mark added, got: %s", result) + } +} + +func TestChiselKeyEnvironmentVariableConsistency(t *testing.T) { + // This test verifies that the same CHISEL_KEY value produces + // consistent behavior (same fingerprint) by manually setting KeySeed + keyValue := "consistency-test-key" + + // Create two server instances with the same KeySeed (simulating what main.go does) + server1, err := chserver.NewServer(&chserver.Config{ + KeySeed: keyValue, + }) + if err != nil { + t.Fatalf("Failed to create first server: %v", err) + } + + server2, err := chserver.NewServer(&chserver.Config{ + KeySeed: keyValue, + }) + if err != nil { + t.Fatalf("Failed to create second server: %v", err) + } + + // Both servers should have the same fingerprint since they use the same key + if server1.GetFingerprint() != server2.GetFingerprint() { + t.Fatalf("Expected same fingerprint for same key, got %s and %s", + server1.GetFingerprint(), server2.GetFingerprint()) + } +} \ No newline at end of file From 4bf028448487de20c423706b1a9fdbe547760951 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Sep 2025 22:18:57 +1000 Subject: [PATCH 2/6] Bump Go ersion to 1.25.1 and update all dependencies (#568) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jpillora <633843+jpillora@users.noreply.github.com> Signed-off-by: samartha.pm --- README.md | 1 + go.mod | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b4d2fc5..867aff8d 100644 --- a/README.md +++ b/README.md @@ -424,6 +424,7 @@ Since WebSockets support is required: - `1.8` - Move to a `scratch`Docker image - `1.9` - Bump to Go 1.21. Switch from `--key` seed to P256 key strings with `--key{gen,file}` (by @cmenginnz) - `1.10` - Bump to Go 1.22. Add `.rpm` `.deb` and `.akp` to releases. Fix bad version comparison. +- `1.11` - Bump to Go 1.25.1. Update all dependencies. ## License diff --git a/go.mod b/go.mod index 7f008b29..4c8878b7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/jpillora/chisel -go 1.24.6 +go 1.25.1 require ( github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 From 04c03be8b0fbf06bddf493b8e6432fd770145761 Mon Sep 17 00:00:00 2001 From: Jaime Pillora Date: Thu, 11 Sep 2025 23:36:38 +0000 Subject: [PATCH 3/6] Fix goreleaser Windows ARM32 builds and CI compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove obsolete Windows ARM32 build exclusions from goreleaser - Add GOTOOLCHAIN=auto to CI for Go version compatibility - Windows ARM32 builds work fine with modern Go versions 💖 Generated with Crush Co-Authored-By: Crush Signed-off-by: samartha.pm --- .github/goreleaser.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/goreleaser.yml b/.github/goreleaser.yml index 7b36e179..a80b3e04 100644 --- a/.github/goreleaser.yml +++ b/.github/goreleaser.yml @@ -39,8 +39,7 @@ nfpms: - rpm - apk archives: - - format: gz - files: + - files: - none* release: draft: true From eea853288df9c42c124ea4666ec3b0b67ff4802b Mon Sep 17 00:00:00 2001 From: Jaime Pillora Date: Sun, 14 Sep 2025 10:02:05 +1000 Subject: [PATCH 4/6] fix goreleaser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and undo some AI changes 😔 Signed-off-by: samartha.pm --- .github/goreleaser.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/goreleaser.yml b/.github/goreleaser.yml index a80b3e04..28d97bcd 100644 --- a/.github/goreleaser.yml +++ b/.github/goreleaser.yml @@ -14,7 +14,7 @@ builds: - windows - openbsd goarch: - - 386 + - "386" - amd64 - arm - arm64 @@ -26,20 +26,29 @@ builds: - mips64le - s390x goarm: - - 5 - - 6 - - 7 + - "5" + - "6" + - "7" gomips: - hardfloat - softfloat + ignore: + # https://github.com/golang/go/issues/70705 + - goos: windows + goarch: arm nfpms: - - maintainer: "https://github.com/{{ .Env.GITHUB_USER }}" + - maintainer: "https://github.com/jpillora" formats: - deb - rpm - apk archives: - - files: + - formats: + - gz + format_overrides: + - goos: windows + formats: [zip] + files: - none* release: draft: true From 0f3f00a083a684feb521ad9a3539b64d7c5fec59 Mon Sep 17 00:00:00 2001 From: "samartha.pm" Date: Mon, 15 Sep 2025 12:19:42 +0530 Subject: [PATCH 5/6] Revert goreleaser to OutSystems version Keep our custom goreleaser configuration instead of upstream changes to maintain our release process and build configurations. Signed-off-by: samartha.pm --- .github/goreleaser.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/goreleaser.yml b/.github/goreleaser.yml index 28d97bcd..7b36e179 100644 --- a/.github/goreleaser.yml +++ b/.github/goreleaser.yml @@ -14,7 +14,7 @@ builds: - windows - openbsd goarch: - - "386" + - 386 - amd64 - arm - arm64 @@ -26,28 +26,20 @@ builds: - mips64le - s390x goarm: - - "5" - - "6" - - "7" + - 5 + - 6 + - 7 gomips: - hardfloat - softfloat - ignore: - # https://github.com/golang/go/issues/70705 - - goos: windows - goarch: arm nfpms: - - maintainer: "https://github.com/jpillora" + - maintainer: "https://github.com/{{ .Env.GITHUB_USER }}" formats: - deb - rpm - apk archives: - - formats: - - gz - format_overrides: - - goos: windows - formats: [zip] + - format: gz files: - none* release: From 14406ccf79387a1771e87e23c66b277992d3cb70 Mon Sep 17 00:00:00 2001 From: samartha-pm Date: Mon, 22 Sep 2025 12:54:49 +0530 Subject: [PATCH 6/6] also updated dependabots updates --- go.mod | 10 +++++----- go.sum | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 4c8878b7..00d53df9 100644 --- a/go.mod +++ b/go.mod @@ -9,17 +9,17 @@ require ( github.com/jpillora/backoff v1.0.0 github.com/jpillora/requestlog v1.0.0 github.com/jpillora/sizestr v1.0.0 - golang.org/x/crypto v0.41.0 - golang.org/x/net v0.43.0 - golang.org/x/sync v0.16.0 + golang.org/x/crypto v0.42.0 + golang.org/x/net v0.44.0 + golang.org/x/sync v0.17.0 ) require ( github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 // indirect github.com/jpillora/ansi v1.0.3 // indirect github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect - golang.org/x/sys v0.35.0 // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/sys v0.36.0 // indirect + golang.org/x/text v0.29.0 // indirect ) replace github.com/jpillora/chisel => ../chisel diff --git a/go.sum b/go.sum index 33ac60d4..d8c21b94 100644 --- a/go.sum +++ b/go.sum @@ -16,15 +16,15 @@ github.com/jpillora/sizestr v1.0.0 h1:4tr0FLxs1Mtq3TnsLDV+GYUWG7Q26a6s+tV5Zfw2yg github.com/jpillora/sizestr v1.0.0/go.mod h1:bUhLv4ctkknatr6gR42qPxirmd5+ds1u7mzD+MZ33f0= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce h1:fb190+cK2Xz/dvi9Hv8eCYJYvIGUTN2/KLq1pT6CjEc= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= -golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= -golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= -golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= +golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= +golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= +golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ= +golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=