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

feat(RDGRS-752): Chisel update #24

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a64df5e
Set ServerName (SNI) to *hostname. Useful for spoofing our way throug…
Aug 26, 2022
fdc1e10
Bump actions/checkout from 2 to 3.1.0
dependabot[bot] Oct 5, 2022
2b90de6
Added --sni switch to control the ServerName when connecting with TLS…
Oct 11, 2022
57ddad6
feat: dependabot workflow automation for updating dependency
Rajpratik71 Oct 27, 2022
d79bebe
Merge pull request #385 from Rajpratik71/Rajpratik71-patch-1
jpillora Oct 31, 2022
e814c44
Merge pull request #376 from ip-rw/master
jpillora Oct 31, 2022
4cd7b36
Merge pull request #381 from jpillora/dependabot/github_actions/actio…
jpillora Oct 31, 2022
dd19bc6
Bump github.com/fsnotify/fsnotify from 1.4.9 to 1.6.0 (#389)
dependabot[bot] Oct 31, 2022
230f714
UDP buffer size override with CHISEL_UDP_MAX_SIZE environment variabl…
fsiegmund Oct 31, 2022
3e703ae
Add locking around the connection count to fix a data race. (#342)
andres-portainer Oct 31, 2022
28a5018
fix: small typo error in main.go (#334)
0xflotus Oct 31, 2022
ed6adb9
Respond to /health and /version by request path rather than by the wh…
BigSully Oct 31, 2022
4f58a39
Update version.go (#288)
c-f Oct 31, 2022
200a8e2
Providing chisel's client with a logger level (#281)
zuzgon Oct 31, 2022
556db3e
add EnvBool
jpillora Oct 31, 2022
fbc8ad9
Fix #390: Use code to generate certificates for client & server (#400)
GuillaumeSmaha Jan 27, 2023
4246b64
docker alpine->google-distroless
jpillora Jan 27, 2023
e546a6d
docker to use scratch
jpillora Jan 27, 2023
e78ccc3
Fix missing NetDialContext: c.config.DialContext (#398)
GuillaumeSmaha Jan 27, 2023
feb571f
actions: setup go v3
jpillora Jan 27, 2023
5ad1141
switch to scratch image
jpillora Jan 27, 2023
3bdf6af
update dependabot
jpillora Jan 27, 2023
ce307e5
move chisel to flyio
jpillora Jan 28, 2023
69093be
Bump to Go 1.21 (#440)
jpillora Aug 19, 2023
4eb9e6a
add arm v5 builds (#395)
maurerr Aug 20, 2023
dca1156
chore: remove refs to deprecated io/ioutil (#459)
testwill Oct 19, 2023
b75390b
Bump golang.org/x/crypto from 0.12.0 to 0.16.0 (#473)
dependabot[bot] Dec 1, 2023
2efe855
Bump golang.org/x/sync from 0.3.0 to 0.5.0 (#472)
dependabot[bot] Dec 1, 2023
3de1774
Bump actions/setup-go from 3 to 5 (#484)
dependabot[bot] Jan 1, 2024
59e5362
Bump to Go 1.22. Add `.rpm` `.deb` and `.akp` to releases. Fix bad ve…
jpillora Aug 5, 2024
3208da3
fix chisel version in docker image (closes #228)
jpillora Sep 28, 2024
ab8f06a
always test with latest stable
jpillora Sep 28, 2024
2e0a28f
Merge remote-tracking branch 'upstream/master'
NewtonMan Oct 3, 2024
f982987
ajustando hash do go para build
NewtonMan Oct 7, 2024
3ffd11f
dummy commit to try snyk again
NewtonMan Oct 10, 2024
be12054
Update README.md
NitescuLucian Jan 20, 2022
352b9bf
Set ServerName (SNI) to *hostname. Useful for spoofing our way throug…
Aug 26, 2022
5164ced
Added --sni switch to control the ServerName when connecting with TLS…
Oct 11, 2022
c5ab344
Bump actions/checkout from 2 to 3.1.0
dependabot[bot] Oct 5, 2022
1c94e98
Bump github.com/fsnotify/fsnotify from 1.4.9 to 1.6.0 (#389)
dependabot[bot] Oct 31, 2022
dea1c40
UDP buffer size override with CHISEL_UDP_MAX_SIZE environment variabl…
fsiegmund Oct 31, 2022
87f2825
Add locking around the connection count to fix a data race. (#342)
andres-portainer Oct 31, 2022
23c6691
Providing chisel's client with a logger level (#281)
zuzgon Oct 31, 2022
a1bdfe9
add EnvBool
jpillora Oct 31, 2022
02235c9
Fix #390: Use code to generate certificates for client & server (#400)
GuillaumeSmaha Jan 27, 2023
0f33103
docker alpine->google-distroless
jpillora Jan 27, 2023
f157d38
docker to use scratch
jpillora Jan 27, 2023
2dfb89d
Fix missing NetDialContext: c.config.DialContext (#398)
GuillaumeSmaha Jan 27, 2023
41ff2aa
move chisel to flyio
jpillora Jan 28, 2023
da98c43
Bump golang.org/x/sync from 0.3.0 to 0.5.0 (#472)
dependabot[bot] Dec 1, 2023
65db54a
Bump to Go 1.22. Add `.rpm` `.deb` and `.akp` to releases. Fix bad ve…
jpillora Aug 5, 2024
f699992
ajustando hash do go para build
NewtonMan Oct 7, 2024
0721ad0
dummy commit to bypass snyk error
NewtonMan Oct 11, 2024
60463f5
add Dockerfile back from lastest changes
NewtonMan Oct 11, 2024
bfe919a
always test with latest stable
jpillora Sep 28, 2024
fd493db
RDNET-798 update chisel from upstream (#5)
bmartins-unit Feb 20, 2023
db05525
RDNET-996: bump versions (#6)
bmartins-unit May 2, 2023
0b462c4
RDNET-996: test-action (#7)
bmartins-unit May 5, 2023
2994856
Upstream sync (#14)
OS-kiranmalsetty Sep 6, 2023
ccaafa1
feat(RDGRS-662): build image (#20)
OS-henriquesantos Aug 12, 2024
8ca4943
Set ServerName (SNI) to *hostname. Useful for spoofing our way throug…
Aug 26, 2022
997717b
Added --sni switch to control the ServerName when connecting with TLS…
Oct 11, 2022
f4ceec3
Bump actions/checkout from 2 to 3.1.0
dependabot[bot] Oct 5, 2022
0a2b5e6
UDP buffer size override with CHISEL_UDP_MAX_SIZE environment variabl…
fsiegmund Oct 31, 2022
694ee00
Add locking around the connection count to fix a data race. (#342)
andres-portainer Oct 31, 2022
af32801
add EnvBool
jpillora Oct 31, 2022
cb030e3
docker alpine->google-distroless
jpillora Jan 27, 2023
87565c0
Fix missing NetDialContext: c.config.DialContext (#398)
GuillaumeSmaha Jan 27, 2023
7238042
move chisel to flyio
jpillora Jan 28, 2023
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
3 changes: 3 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine
COPY chisel /app/
ENTRYPOINT ["/app/chisel"]
45 changes: 45 additions & 0 deletions .github/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# test this goreleaser config with:
# - cd chisel
# - goreleaser --skip-publish --rm-dist --config .github/goreleaser.yml
builds:
- env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/jpillora/chisel/share.BuildVersion={{.Version}}
flags:
- -trimpath
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64
- arm
- arm64
- ppc64
- ppc64le
- mips
- mipsle
- mips64
- mips64le
- s390x
goarm:
- 6
- 7
gomips:
- hardfloat
- softfloat
archives:
- format: gz
files:
- none*
release:
draft: true
prerelease: auto
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
117 changes: 109 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
on: [push, pull_request]
name: CI
on:
pull_request: {}
push: {}
permissions: write-all
jobs:
# ================
# TEST JOB
# runs on every push and PR
# runs 2x3 times (see matrix)
# BUILD AND TEST JOB
# ================
test:
name: Test
name: Build & Test
strategy:
matrix:
go-version: [1.21.x]
platform: [ubuntu-latest]
go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
Expand All @@ -23,4 +24,104 @@ jobs:
- name: Build
run: go build -v -o /dev/null .
- name: Test
run: go test -v ./...
run: go test -v ./...
# ================
# RELEASE JOBS
# runs after a success test
# only runs on push "v*" tag
# ================
release_binaries:
name: Release Binaries
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: goreleaser
if: success()
uses: docker://goreleaser/goreleaser:latest
env:
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --config .github/goreleaser.yml
# ================
# RELEASE DOCKER IMAGES (on push "v*" tag)
# ================
release_docker:
name: Release Docker Images
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: jpillora
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: jpillora/chisel
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: .github/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/386,linux/arm/v7,linux/arm/v6
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --config .github/goreleaser.yml
release_docker:
name: Release Docker Images
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: jpillora/chisel
tag-latest: true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/386,linux/arm/v7,linux/arm/v6
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Jaime Pillora <[email protected]>
Copyright (c) 2024 Jaime Pillora <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ sudo dnf -y install chisel
### Source

```sh
$ go install github.com/jpillora/chisel@latest
$ go install github.com/jpillora/chisel@latest -v
```

## Demo
Expand Down Expand Up @@ -104,7 +104,6 @@ $ chisel --help
```
<!--/tmpl-->


<!--tmpl,code=plain:echo "$ chisel server --help" && go run main.go server --help | cat | sed 's#0.0.0-src (go1\..*)#X.Y.Z#' -->
``` plain
$ chisel server --help
Expand Down Expand Up @@ -210,7 +209,6 @@ $ chisel server --help
```
<!--/tmpl-->


<!--tmpl,code=plain:echo "$ chisel client --help" && go run main.go client --help | sed 's#0.0.0-src (go1\..*)#X.Y.Z#' -->
``` plain
$ chisel client --help
Expand Down Expand Up @@ -392,7 +390,6 @@ Internally, this is done using the _Password_ authentication method provided by

1. Now you have an encrypted, authenticated SOCKS5 connection over HTTP


#### Caveats

Since WebSockets support is required:
Expand Down
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"encoding/base64"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"regexp"
"strings"
"time"
Expand Down Expand Up @@ -105,7 +105,7 @@ func NewClient(c *Config) (*Client, error) {
tlsConfig: nil,
}
//set default log level
client.Logger.Info = true
client.Logger.Info = c.Verbose
//configure tls
if u.Scheme == "wss" {
tc := &tls.Config{}
Expand All @@ -118,7 +118,7 @@ func NewClient(c *Config) (*Client, error) {
tc.InsecureSkipVerify = true
} else if c.TLS.CA != "" {
rootCAs := x509.NewCertPool()
if b, err := ioutil.ReadFile(c.TLS.CA); err != nil {
if b, err := os.ReadFile(c.TLS.CA); err != nil {
return nil, fmt.Errorf("Failed to load file: %s", c.TLS.CA)
} else if ok := rootCAs.AppendCertsFromPEM(b); !ok {
return nil, fmt.Errorf("Failed to decode PEM: %s", c.TLS.CA)
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.0
golang.org/x/net v0.15.0
golang.org/x/crypto v0.12.0
golang.org/x/net v0.14.0
golang.org/x/sync v0.3.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.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
)

replace github.com/jpillora/chisel => ../chisel
replace github.com/jpillora/chisel => ../chisel
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -89,7 +88,7 @@ var commonHelp = `

func generatePidFile() {
pid := []byte(strconv.Itoa(os.Getpid()))
if err := ioutil.WriteFile("chisel.pid", pid, 0644); err != nil {
if err := os.WriteFile("chisel.pid", pid, 0644); err != nil {
log.Fatal(err)
}
}
Expand Down
16 changes: 8 additions & 8 deletions server/server_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (s *Server) handleClientHandler(w http.ResponseWriter, r *http.Request) {
//websockets upgrade AND has chisel prefix
upgrade := strings.ToLower(r.Header.Get("Upgrade"))
protocol := r.Header.Get("Sec-WebSocket-Protocol")
if upgrade == "websocket" {
if upgrade == "websocket" {
if protocol == chshare.ProtocolVersion {
s.handleWebsocket(w, r)
return
Expand Down Expand Up @@ -101,13 +101,13 @@ func (s *Server) handleWebsocket(w http.ResponseWriter, req *http.Request) {
return
}
//print if client and server versions dont match
if c.Version != chshare.BuildVersion {
v := c.Version
if v == "" {
v = "<unknown>"
}
l.Infof("Client version (%s) differs from server version (%s)",
v, chshare.BuildVersion)
cv := strings.TrimPrefix(c.Version, "v")
if cv == "" {
cv = "<unknown>"
}
sv := strings.TrimPrefix(chshare.BuildVersion, "v")
if cv != sv {
l.Infof("Client version (%s) differs from server version (%s)", cv, sv)
}
//validate remotes
for _, r := range c.Remotes {
Expand Down
5 changes: 2 additions & 3 deletions server/server_listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"crypto/tls"
"crypto/x509"
"errors"
"io/ioutil"
"net"
"os"
"os/user"
Expand Down Expand Up @@ -116,7 +115,7 @@ func addCA(ca string, c *tls.Config) error {
clientCAPool := x509.NewCertPool()
if fileInfo.IsDir() {
//this is a directory holding CA bundle files
files, err := ioutil.ReadDir(ca)
files, err := os.ReadDir(ca)
if err != nil {
return err
}
Expand All @@ -140,7 +139,7 @@ func addCA(ca string, c *tls.Config) error {
}

func addPEMFile(path string, pool *x509.CertPool) error {
content, err := ioutil.ReadFile(path)
content, err := os.ReadFile(path)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions share/cio/stdio.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cio

import (
"io"
"io/ioutil"
"os"
)

Expand All @@ -11,6 +10,6 @@ var Stdio = &struct {
io.ReadCloser
io.Writer
}{
ioutil.NopCloser(os.Stdin),
io.NopCloser(os.Stdin),
os.Stdout,
}
4 changes: 2 additions & 2 deletions share/settings/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"regexp"
"sync"

Expand Down Expand Up @@ -125,7 +125,7 @@ func (u *UserIndex) loadUserIndex() error {
if u.configFile == "" {
return errors.New("configuration file not set")
}
b, err := ioutil.ReadFile(u.configFile)
b, err := os.ReadFile(u.configFile)
if err != nil {
return fmt.Errorf("Failed to read auth file: %s, error: %s", u.configFile, err)
}
Expand Down
Loading