Skip to content

Commit

Permalink
Merge branch 'release/0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Apr 23, 2021
2 parents f63d12a + 1abead2 commit 2c4b28f
Show file tree
Hide file tree
Showing 24 changed files with 1,358 additions and 275 deletions.
163 changes: 110 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
go-version: 1.16
- name: Build for multi-platform
run: |
set -xeu
Expand All @@ -31,6 +31,9 @@ jobs:
done
operational_test:
runs-on: ubuntu-18.04
defaults:
run:
shell: bash
steps:
- name: Build SSH server Dockerfile
run: |
Expand All @@ -53,69 +56,123 @@ jobs:
RUN echo "export VISIBLE=now" >> /etc/profile
ENTRYPOINT [ "/usr/sbin/sshd", "-D" ]
EOS
- run: sudo apt install -y socat
- name: Run SSH Server
run: docker run -d -p 2022:22 --init ssh-server
- name: Wait for running SSH server
run: sleep 3
- name: Run Nginx
run: docker run -d -p 8888:80 nginx:alpine
- name: Run Piping Server
run: docker run -d -p 8080:8080 nwtgck/piping-server:v1.1.3
- name: Wait for running Piping server
run: sleep 3
run: docker run -d -p 8080:8080 nwtgck/piping-server:v1.2.0
- uses: actions/checkout@v2
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
go-version: 1.16
- run: CGO_ENABLED=0 go build -o piping-tunnel main/main.go

# Normal tunnel
- run: ./piping-tunnel -s http://localhost:8080 server -p 2022 aaa bbb &
- run: ./piping-tunnel -s http://localhost:8080 client -p 3322 aaa bbb &
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
- run: ssh -p 3322 -o 'StrictHostKeyChecking no' guest@localhost hostname
- name: Normal tunnel
run: |
set -eux
./piping-tunnel -s http://localhost:8080 server -p 2022 aaa bbb &
./piping-tunnel -s http://localhost:8080 client -p 3322 aaa bbb &
sleep 1
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
ssh -p 3322 -o 'StrictHostKeyChecking no' guest@localhost hostname
- name: Unix socket on server host side
run: |
set -eux
socat UNIX-LISTEN:/tmp/my_nginx_socat TCP:localhost:8888 &
sleep 1
./piping-tunnel -s http://localhost:8080 server --unix-socket=/tmp/my_nginx_socat aaa bbb &
./piping-tunnel -s http://localhost:8080 client -p 8889 aaa bbb &
sleep 1
curl localhost:8889
- name: Unix socket on client host side
run: |
set -eux
./piping-tunnel -s http://localhost:8080 server -p 8888 aaa bbb &
./piping-tunnel -s http://localhost:8080 client --unix-socket=/tmp/my_unginx aaa bbb &
sleep 1
curl --unix-socket /tmp/my_unginx http:/index.html
- name: Encrypt with AES-CTR
run: |
set -eux
./piping-tunnel -s http://localhost:8080 server -p 2022 --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa bbb &
./piping-tunnel -s http://localhost:8080 client -p 3322 --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa bbb &
sleep 1
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
ssh -p 3322 -o 'StrictHostKeyChecking no' guest@localhost hostname
# Encrypt with AES-CTR
- run: ./piping-tunnel -s http://localhost:8080 server -p 2022 --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa bbb &
- run: ./piping-tunnel -s http://localhost:8080 client -p 3322 --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa bbb &
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
- run: ssh -p 3322 -o 'StrictHostKeyChecking no' guest@localhost hostname
- name: yamux
run: |
set -eux
# Run server-host with yamux
./piping-tunnel -s http://localhost:8080 server -p 2022 --yamux aaa-yamux bbb-yamux & echo $! > pid1
# Run client-host with yamux
./piping-tunnel -s http://localhost:8080 client -p 4422 --yamux aaa-yamux bbb-yamux & echo $! > pid2
sleep 1
# Check whether ssh multiple times
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost hostname
ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost ls -l /
kill $(cat pid1) && kill $(cat pid2)
# Multiplexing
- name: Run server-host with yamux
run: ./piping-tunnel -s http://localhost:8080 server -p 2022 --yamux aaa-yamux bbb-yamux & echo $! > pid1
- name: Run client-host with yamux
run: ./piping-tunnel -s http://localhost:8080 client -p 4422 --yamux aaa-yamux bbb-yamux & echo $! > pid2
# Check whether ssh multiple times
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
- run: ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost hostname
- run: ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost ls -l /
- run: kill $(cat pid1) && kill $(cat pid2)
- name: yamux (encrypt with AES-CTR)
run: |
set -eux
# Run server-host with yamux (encrypt with AES-CTR)
./piping-tunnel -s http://localhost:8080 server -p 2022 --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-yamux bbb-yamux & echo $! > pid1
# Run client-host with yamux (encrypt with AES-CTR)
./piping-tunnel -s http://localhost:8080 client -p 4422 --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-yamux bbb-yamux & echo $! > pid2
sleep 1
# Check whether ssh multiple times
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost hostname
ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost ls -l /
kill $(cat pid1) && kill $(cat pid2)
# Multiplexing (encrypt with AES-CTR)
- name: Run server-host with yamux (encrypt with AES-CTR)
run: ./piping-tunnel -s http://localhost:8080 server -p 2022 --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-yamux bbb-yamux & echo $! > pid1
- name: Run client-host with yamux (encrypt with AES-CTR)
run: ./piping-tunnel -s http://localhost:8080 client -p 4422 --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-yamux bbb-yamux & echo $! > pid2
# Check whether ssh multiple times
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
- run: ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost hostname
- run: ssh -p 4422 -o 'StrictHostKeyChecking no' guest@localhost ls -l /
- run: kill $(cat pid1) && kill $(cat pid2)
- name: yamux SOCKS
run: |
set -eux
# Run socks with yamux
./piping-tunnel -s http://localhost:8080 socks --yamux aaa-socks bbb-socks & echo $! > pid1
# Run client-host with yamux
./piping-tunnel -s http://localhost:8080 client -p 1081 --yamux aaa-socks bbb-socks & echo $! > pid2
sleep 1
# NOTE: Depends on external resource: example.com
curl -x socks5h://localhost:1081 https://example.com
kill $(cat pid1) && kill $(cat pid2)
# SOCKS
- name: Run socks with yamux
run: ./piping-tunnel -s http://localhost:8080 socks --yamux aaa-socks bbb-socks & echo $! > pid1
- name: Run client-host with yamux
run: ./piping-tunnel -s http://localhost:8080 client -p 1081 --yamux aaa-socks bbb-socks & echo $! > pid2
# NOTE: Depends on external resource: example.com
- run: curl -x socks5h://localhost:1081 https://example.com
- run: kill $(cat pid1) && kill $(cat pid2)
- name: yamux SOCKS (encrypt with AES-CTR)
run: |
set -eux
# Run socks with yamux (encrypt with AES-CTR)
./piping-tunnel -s http://localhost:8080 socks --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-socks bbb-socks & echo $! > pid1
# Run client-host with yamux (encrypt with AES-CTR)
./piping-tunnel -s http://localhost:8080 client -p 1081 --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-socks bbb-socks & echo $! > pid2
sleep 1
# NOTE: Depends on external resource: example.com
curl -x socks5h://localhost:1081 https://example.com
kill $(cat pid1) && kill $(cat pid2)
# SOCKS (encrypt with AES-CTR)
- name: Run socks with yamux (encrypt with AES-CTR)
run: ./piping-tunnel -s http://localhost:8080 socks --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-socks bbb-socks & echo $! > pid1
- name: Run client-host with yamux (encrypt with AES-CTR)
run: ./piping-tunnel -s http://localhost:8080 client -p 1081 --yamux --symmetric --cipher-type=aes-ctr --passphrase=mypass aaa-socks bbb-socks & echo $! > pid2
# NOTE: Depends on external resource: example.com
- run: curl -x socks5h://localhost:1081 https://example.com
- run: kill $(cat pid1) && kill $(cat pid2)
- name: pmux
run: |
set -eux
# Run server-host1 with pmux
./piping-tunnel -s http://localhost:8080 server -p 2022 --pmux aaa-pmux bbb-pmux & echo $! > pid1
sleep 1
# pmux allows multiple clients in one set of paths
# Run client-host1 with pmux
./piping-tunnel -s http://localhost:8080 client -p 5522 --pmux aaa-pmux bbb-pmux & echo $! > pid2
# Run client-host2 with pmux
./piping-tunnel -s http://localhost:8080 client -p 6622 --pmux aaa-pmux bbb-pmux & echo $! > pid3
sleep 2
# Check whether ssh multiple times
# (base: -o option: https://www.cyberithub.com/ssh-host-key-verification-failed-error-in-linux/)
ssh -p 5522 -o 'StrictHostKeyChecking no' guest@localhost hostname
ssh -p 5522 -o 'StrictHostKeyChecking no' guest@localhost ls -l /
ssh -p 6622 -o 'StrictHostKeyChecking no' guest@localhost ls -l /
kill $(cat pid1) && kill $(cat pid2) && kill $(cat pid3)
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: v0.149.0
version: v0.159.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ nfpms:
- license: MIT
maintainer: Ryo Ota <[email protected]>
homepage: https://github.com/nwtgck/go-piping-tunnel
description: "Tunnel over HTTP with Piping Server"
description: "Tunneling from anywhere with Piping Server"
formats:
- rpm
- deb
Expand All @@ -46,4 +46,4 @@ brews:
owner: nwtgck
name: homebrew-piping-tunnel
homepage: "https://github.com/nwtgck/go-piping-tunnel"
description: "Tunnel over HTTP with Piping Server"
description: "Tunneling from anywhere with Piping Server"
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,24 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.9.0] - 2021-04-23
### Added
* Create pmux, which is a multiplexer specialized in Piping Server
* Add --host to specify target host for server host
* Support SOCKS4 and SOCKS4a
* Use HTTP/2 by default when the server supports
* Add --verbose for logging
* Add --unix-socket flags in server and client hosts

### Changed
* Make --yamux attach `Content-Type: application/yamux`
* (breaking change) Rename --c-to-s-buf-size to --cs-buf-size in server host
* (breaking change) Rename --s-to-c-buf-size to --sc-buf-size in client host

## [0.8.0] - 2021-01-01
### Added
* Add -c flag to symmetrically
* Add a feature of encrypting with OpenPGP
* Add a feature of encrypting with OpenPGP
* Add a feature of encrypting with AES-CTR
* Add --cipher-type flag

Expand Down Expand Up @@ -76,7 +90,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
### Added
* Initial release

[Unreleased]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.8.0...HEAD
[Unreleased]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.9.0...HEAD
[0.9.0]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.5.0...v0.6.0
Expand Down
Loading

0 comments on commit 2c4b28f

Please sign in to comment.