Skip to content

Commit

Permalink
Merge branch 'release/0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Mar 8, 2023
2 parents 7c02ada + e83f59d commit 1adc4be
Show file tree
Hide file tree
Showing 11 changed files with 172 additions and 952 deletions.
83 changes: 24 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,45 @@
name: CI

on: [push, pull_request]
on: [push]

env:
PIPING_SERVER_CHECK_VERSION: 0.7.1

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.19
- name: Build
run: CGO_ENABLED=0 go build -o go-piping-server main/main.go
- name: Test
run: go test -v ./...

linux_operational_test:
runs-on: ubuntu-18.04
linux_piping_server_check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.19
- name: Build
run: CGO_ENABLED=0 go build -o go-piping-server main/main.go
- name: Operational test
run: |
set -xeu
# Create certificates
mkdir ssl_certs && cd ssl_certs && openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -sha256 -nodes --subj '/CN=localhost/' && cd -
# Run a server
./go-piping-server --http-port=8181 --enable-https --https-port=8443 --crt-path=./ssl_certs/server.crt --key-path=./ssl_certs/server.key &> ./piping-server.log &
# Get server PID
server_pid=$!
sleep 3
# Transfer data over HTTP
echo "hello, world" | curl -T - localhost:8181/mypath &
diff <(echo "hello, world") <(curl localhost:8181/mypath)
# Make a large random file
dd if=/dev/urandom iflag=count_bytes count=500M bs=1M of=/tmp/500M.dat
# Transfer large data over HTTP
cat /tmp/500M.dat | curl -T - localhost:8181/mypath &
diff <(cat /tmp/500M.dat) <(curl localhost:8181/mypath)
rm /tmp/500M.dat
# Transfer data over HTTPS
echo "hello, world with HTTPS" | curl -kT - https://localhost:8443/mypath2 &
diff <(echo "hello, world with HTTPS") <(curl -k https://localhost:8443/mypath2)
# Make a large random file
dd if=/dev/urandom iflag=count_bytes count=500M bs=1M of=/tmp/500M.dat
# Transfer large data over HTTPS
cat /tmp/500M.dat | curl -kT - https://localhost:8443/mypath2 &
diff <(cat /tmp/500M.dat) <(curl -k https://localhost:8443/mypath2)
rm /tmp/500M.dat
# HTTP/2 support
(echo hello | curl -ksST- https://localhost:8443/mypath3 -o /dev/null -w '%{http_version}:%{http_code}\n' > /tmp/http2_post.txt) &
diff <(echo '2:200') <(curl -ksS https://localhost:8443/mypath3 -o /dev/null -w '%{http_version}:%{http_code}\n')
diff <(echo '2:200') /tmp/http2_post.txt
# Transfer data using multipart
# Make a large random file
dd if=/dev/urandom iflag=count_bytes count=500M bs=1M of=/tmp/500M.dat
# Transfer large data over HTTP
curl -F myfile=@/tmp/500M.dat localhost:8181/mypath3 &
diff <(cat /tmp/500M.dat) <(curl localhost:8181/mypath3)
rm /tmp/500M.dat
# Stop the server
kill $server_pid
# Print server's log
cat ./piping-server.log
- name: Create certificates
run: cd /tmp && mkdir ssl_certs && cd ssl_certs && openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -sha256 -nodes --subj '/CN=localhost/' && cd -
- name: Install piping-server-check
run: cd /tmp && wget -O piping-server-check.deb https://github.com/nwtgck/piping-server-check/releases/download/v${PIPING_SERVER_CHECK_VERSION}/piping-server-check-${PIPING_SERVER_CHECK_VERSION}-linux-amd64.deb && sudo dpkg -i piping-server-check.deb
- name: piping-server-check
# sometimes .same_path_sender_rejection subcheck fails (why?)
# TODO: add --http1.0-tls
run: piping-server-check --http1.0 --http1.1 --http1.1-tls --h2c --h2 --h3 --tls-skip-verify --concurrency 100 --compromise post_first_byte_by_byte_streaming --compromise post_first.same_path_sender_rejection --compromise put.same_path_sender_rejection --compromise http1.0/multipart_form_data --compromise http1.0-tls/multipart_form_data --server-command='mkdir -p /tmp/logs && ./go-piping-server --http-port=$HTTP_PORT --enable-https --enable-http3 --https-port=$HTTPS_PORT --crt-path=/tmp/ssl_certs/server.crt --key-path=/tmp/ssl_certs/server.key 2>&1 | tee /tmp/logs/$(date "+%s%3N").log > /dev/stderr' --transfer-speed-byte $((1024 * 1024 * 1024 * 1024)) --transfer-span 3s --transfer-span 10s
timeout-minutes: 1
- name: Show server logs from piping-server-check
run: cat /tmp/logs/*
15 changes: 7 additions & 8 deletions .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:

jobs:
build_and_push:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- run: echo ${{github.ref_name}}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Create Docker image names
id: create-docker-image-names
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
# language=js
script: |
const dockerImageNames = [];
if (context.payload.ref === 'refs/heads/master') {
Expand All @@ -32,17 +33,15 @@ jobs:
const shouldPush = dockerImageNames.length !== 0;
core.setOutput('docker-push', shouldPush + "");
core.setOutput('docker-image-names', shouldPush ? dockerImageNames.join(",") : "dummy_image_name_not_to_push");
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: nwtgck
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
goreleaser:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.19
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: v1.0.0
args: release --rm-dist
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.5.0] - 2023-03-08
### Changed
* Update dependencies
* (Docker) golang:1.19
* Smoother streaming
* Send message to sender

## [0.4.0] - 2022-01-15
### Added
* Support HEAD method for the reserved paths
Expand Down Expand Up @@ -43,7 +50,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-server/compare/v0.4.0...HEAD
[Unreleased]: https://github.com/nwtgck/go-piping-server/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/nwtgck/go-piping-server/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/nwtgck/go-piping-server/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/nwtgck/go-piping-server/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/nwtgck/go-piping-server/compare/v0.1.0...v0.2.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: base platform is always linux/amd64 because go can cross-build
FROM --platform=linux/amd64 golang:1.16
FROM --platform=linux/amd64 golang:1.19

ARG TARGETPLATFORM

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

## Install for Ubuntu
```bash
wget https://github.com/nwtgck/go-piping-server/releases/download/v0.3.0/go-piping-server-0.3.0-linux-amd64.deb
sudo dpkg -i go-piping-server-0.3.0-linux-amd64.deb
wget https://github.com/nwtgck/go-piping-server/releases/download/v0.4.0/go-piping-server-0.4.0-linux-amd64.deb
sudo dpkg -i go-piping-server-0.4.0-linux-amd64.deb
```

## Install for macOS
Expand All @@ -13,7 +13,7 @@ brew install nwtgck/go-piping-server/go-piping-server
```

## Install for Windows
[Download](https://github.com/nwtgck/go-piping-server/releases/download/v0.3.0/go-piping-server-0.3.0-windows-amd64.zip)
[Download](https://github.com/nwtgck/go-piping-server/releases/download/v0.4.0/go-piping-server-0.4.0-windows-amd64.zip)

Get more executables in the [releases](https://github.com/nwtgck/go-piping-server/releases).

Expand Down
29 changes: 24 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
module github.com/nwtgck/go-piping-server

go 1.16
go 1.19

require (
github.com/lucas-clemente/quic-go v0.24.0
github.com/spf13/cobra v1.3.0
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
gotest.tools/v3 v3.0.3
github.com/lucas-clemente/quic-go v0.31.1
github.com/spf13/cobra v1.6.1
golang.org/x/net v0.8.0
gotest.tools/v3 v3.4.0
)

require (
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/marten-seemann/qpack v0.3.0 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.3 // indirect
github.com/marten-seemann/qtls-go1-19 v0.1.1 // indirect
github.com/onsi/ginkgo/v2 v2.2.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.6.0 // indirect
)
Loading

0 comments on commit 1adc4be

Please sign in to comment.