Skip to content

Commit 0b5f870

Browse files
authored
feat(RDODCP-312): Upstream sync v1.11.3 and dependabots updates (#38)
1 parent 8f39b91 commit 0b5f870

File tree

6 files changed

+87
-19
lines changed

6 files changed

+87
-19
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
FROM alpine
2+
RUN apk update && apk upgrade
23
COPY chisel /app/
34
ENTRYPOINT ["/app/chisel"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ Since WebSockets support is required:
424424
- `1.8` - Move to a `scratch`Docker image
425425
- `1.9` - Bump to Go 1.21. Switch from `--key` seed to P256 key strings with `--key{gen,file}` (by @cmenginnz)
426426
- `1.10` - Bump to Go 1.22. Add `.rpm` `.deb` and `.akp` to releases. Fix bad version comparison.
427+
- `1.11` - Bump to Go 1.25.1. Update all dependencies.
427428
428429
## License
429430

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/jpillora/chisel
22

3-
go 1.24.6
3+
go 1.25.1
44

55
require (
66
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
@@ -9,17 +9,17 @@ require (
99
github.com/jpillora/backoff v1.0.0
1010
github.com/jpillora/requestlog v1.0.0
1111
github.com/jpillora/sizestr v1.0.0
12-
golang.org/x/crypto v0.41.0
13-
golang.org/x/net v0.43.0
14-
golang.org/x/sync v0.16.0
12+
golang.org/x/crypto v0.42.0
13+
golang.org/x/net v0.44.0
14+
golang.org/x/sync v0.17.0
1515
)
1616

1717
require (
1818
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 // indirect
1919
github.com/jpillora/ansi v1.0.3 // indirect
2020
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
21-
golang.org/x/sys v0.35.0 // indirect
22-
golang.org/x/text v0.28.0 // indirect
21+
golang.org/x/sys v0.36.0 // indirect
22+
golang.org/x/text v0.29.0 // indirect
2323
)
2424

2525
replace github.com/jpillora/chisel => ../chisel

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ github.com/jpillora/sizestr v1.0.0 h1:4tr0FLxs1Mtq3TnsLDV+GYUWG7Q26a6s+tV5Zfw2yg
1616
github.com/jpillora/sizestr v1.0.0/go.mod h1:bUhLv4ctkknatr6gR42qPxirmd5+ds1u7mzD+MZ33f0=
1717
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce h1:fb190+cK2Xz/dvi9Hv8eCYJYvIGUTN2/KLq1pT6CjEc=
1818
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4=
19-
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
20-
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
21-
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
22-
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
23-
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
24-
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
25-
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
26-
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
27-
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
28-
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
29-
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
30-
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
19+
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
20+
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
21+
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
22+
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
23+
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
24+
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
25+
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
26+
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
27+
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
28+
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
29+
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
30+
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ func server(args []string) {
237237
}
238238
if config.KeyFile == "" {
239239
config.KeyFile = settings.Env("KEY_FILE")
240-
} else if config.KeySeed == "" {
240+
}
241+
if config.KeySeed == "" {
241242
config.KeySeed = settings.Env("KEY")
242243
}
243244
if config.Auth == "" {

test/e2e/env_key_test.go

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package e2e_test
2+
3+
import (
4+
"os"
5+
"testing"
6+
7+
chclient "github.com/jpillora/chisel/client"
8+
chserver "github.com/jpillora/chisel/server"
9+
)
10+
11+
func TestChiselKeyEnvironmentVariable(t *testing.T) {
12+
// Set the CHISEL_KEY environment variable
13+
os.Setenv("CHISEL_KEY", "test-key-value")
14+
defer os.Unsetenv("CHISEL_KEY")
15+
16+
tmpPort := availablePort()
17+
18+
// Create server with empty config - should pick up CHISEL_KEY env var
19+
serverConfig := &chserver.Config{}
20+
21+
// Setup server and client
22+
teardown := simpleSetup(t,
23+
serverConfig,
24+
&chclient.Config{
25+
Remotes: []string{tmpPort + ":$FILEPORT"},
26+
})
27+
defer teardown()
28+
29+
// Test that the connection works - if the key is properly set,
30+
// the server should start successfully and connections should work
31+
result, err := post("http://localhost:"+tmpPort, "env-key-test")
32+
if err != nil {
33+
t.Fatal(err)
34+
}
35+
if result != "env-key-test!" {
36+
t.Fatalf("expected exclamation mark added, got: %s", result)
37+
}
38+
}
39+
40+
func TestChiselKeyEnvironmentVariableConsistency(t *testing.T) {
41+
// This test verifies that the same CHISEL_KEY value produces
42+
// consistent behavior (same fingerprint) by manually setting KeySeed
43+
keyValue := "consistency-test-key"
44+
45+
// Create two server instances with the same KeySeed (simulating what main.go does)
46+
server1, err := chserver.NewServer(&chserver.Config{
47+
KeySeed: keyValue,
48+
})
49+
if err != nil {
50+
t.Fatalf("Failed to create first server: %v", err)
51+
}
52+
53+
server2, err := chserver.NewServer(&chserver.Config{
54+
KeySeed: keyValue,
55+
})
56+
if err != nil {
57+
t.Fatalf("Failed to create second server: %v", err)
58+
}
59+
60+
// Both servers should have the same fingerprint since they use the same key
61+
if server1.GetFingerprint() != server2.GetFingerprint() {
62+
t.Fatalf("Expected same fingerprint for same key, got %s and %s",
63+
server1.GetFingerprint(), server2.GetFingerprint())
64+
}
65+
}

0 commit comments

Comments
 (0)