Skip to content

Commit

Permalink
Merge branch 'release/1.12.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Apr 8, 2023
2 parents 0417ef3 + 93447bc commit f817776
Show file tree
Hide file tree
Showing 12 changed files with 233 additions and 248 deletions.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2.1

orbs:
node: circleci/node@4.7

executors:
linux:
machine:
image: ubuntu-2004:202107-02

jobs:
empty_test:
executor: linux
steps:
- checkout

workflows:
all-tests:
jobs:
- empty_test
103 changes: 27 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Node CI

on: [push, pull_request]

env:
PIPING_SERVER_CHECK_VERSION: 0.11.0

jobs:
build:
runs-on: ubuntu-20.04
Expand All @@ -19,85 +22,33 @@ jobs:
- run: npm run lint
- run: npm run build
- run: npm test
- name: Operational test
run: |
set -eux
# Create certificates
(mkdir /tmp/ssl_certs && cd /tmp/ssl_certs && openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -sha256 -nodes --subj '/CN=localhost/')
# Run a server
node ./dist/src/index.js --http-port=8080 --enable-https=true --https-port=8443 --key-path=/tmp/ssl_certs/server.key --crt-path=/tmp/ssl_certs/server.crt &> /tmp/piping_log.txt &
# Wait for server running
sleep 1
# Create a file to send
echo 'hello, world' > /tmp/hello.txt
# Send and wait for a receiver
curl -T /tmp/hello.txt localhost:8080/mypath &
# Get data as a file
curl localhost:8080/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Send and wait for a receiver
curl -kT /tmp/hello.txt https://localhost:8443/mypath &
# Get data as a file
curl -k https://localhost:8443/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Print server log
cat /tmp/piping_log.txt
- 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/'
- 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
run: piping-server-check --http1.1 --http1.1-tls --h2 --tls-skip-verify --compromise post_cancel_post --compromise get_cancel_get --concurrency 100 --server-command="${SERVER_COMMAND}" --n-simultaneous-requests=60 --transfer-speed-byte $((1024 * 1024 * 1024 * 1024)) --transfer-span 3s --transfer-span 10s --transfer-span 1m
env:
SERVER_COMMAND: 'mkdir -p /tmp/logs && exec node ./dist/src/index.js --http-port=$HTTP_PORT --enable-https=true --https-port=$HTTPS_PORT --key-path=/tmp/ssl_certs/server.key --crt-path=/tmp/ssl_certs/server.crt 2>&1 | tee /tmp/logs/$SERVER_RUN_ID.log > /dev/stderr'
timeout-minutes: 2
- name: Show server logs from piping-server-check
if: ${{ always() }}
run: tail -n +1 /tmp/logs/*

docker_test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: docker build -t piping-server .
- name: Operational test with Docker image
run: |
set -eux
# Run a server
docker run -d -p 8080:80 --name=piping piping-server --http-port=80
# Wait for server running
sleep 1
# Create a file to send
echo 'hello, world' > /tmp/hello.txt
# Send and wait for a receiver
curl -T /tmp/hello.txt localhost:8080/mypath &
# Get data as a file
curl localhost:8080/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Print server log
docker logs piping
# Delete container
docker rm -f piping
- name: Operational test with Docker image for HTTPS
run: |
set -eux
# 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/')
# Run a server
docker run -d -p 8080:80 -p 8443:443 -v $PWD/ssl_certs:/ssl_certs --name=piping piping-server --http-port=80 --enable-https=true --https-port=443 --key-path=/ssl_certs/server.key --crt-path=/ssl_certs/server.crt
# Wait for server running
sleep 1
# Create a file to send
echo 'hello, world' > /tmp/hello.txt
# Send and wait for a receiver
curl -kT /tmp/hello.txt https://localhost:8443/mypath &
# Get data as a file
curl -k https://localhost:8443/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Print server log
docker logs piping
# Delete container
docker rm -f piping
- 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/'
- 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
run: piping-server-check --http1.1 --http1.1-tls --h2 --tls-skip-verify --compromise post_cancel_post --compromise get_cancel_get --concurrency 100 --server-command="${SERVER_COMMAND}" --n-simultaneous-requests=60 --transfer-speed-byte $((1024 * 1024 * 1024 * 1024)) --transfer-span 3s --transfer-span 10s --transfer-span 1m
env:
SERVER_COMMAND: 'mkdir -p /tmp/logs && exec docker run --rm -p $HTTP_PORT:80 -p $HTTPS_PORT:443 -v /tmp/ssl_certs:/ssl_certs piping-server --http-port=80 --enable-https=true --https-port=443 --key-path=/ssl_certs/server.key --crt-path=/ssl_certs/server.crt 2>&1 | tee /tmp/logs/$SERVER_RUN_ID.log > /dev/stderr'
timeout-minutes: 3
- name: Show server logs from piping-server-check
if: ${{ always() }}
run: tail -n +1 /tmp/logs/*
2 changes: 1 addition & 1 deletion .github/workflows/docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
username: nwtgck
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
username: nwtgck
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.12.9] - 2023-04-08
### Changed
* Update dependencies
* (Docker) Use node 16.20.0 as base docker image

### Fixed
* Update timing of overwriting with original socket.write() in HTTP/1.0
* Set `requestTimeout: 0` to HTTP/1.1 server option for supporting Node.js 18

## [1.12.8] - 2022-11-26
### Changed
* Update dependencies
Expand Down Expand Up @@ -461,7 +470,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
* Docker automated build on Docker Hub
* Support HTTPS

[Unreleased]: https://github.com/nwtgck/piping-server/compare/v1.12.8...HEAD
[Unreleased]: https://github.com/nwtgck/piping-server/compare/v1.12.9...HEAD
[1.12.9]: https://github.com/nwtgck/piping-server/compare/v1.12.8...v1.12.9
[1.12.8]: https://github.com/nwtgck/piping-server/compare/v1.12.7...v1.12.8
[1.12.7]: https://github.com/nwtgck/piping-server/compare/v1.12.6...v1.12.7
[1.12.6]: https://github.com/nwtgck/piping-server/compare/v1.12.5...v1.12.6
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.18.1-alpine
FROM node:16.20.0-alpine

LABEL maintainer="Ryo Ota <nwtgck@nwtgck.org>"

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Here are public Piping Servers.

* <https://ppng.io>
* <https://piping.nwtgck.repl.co>
* <https://ppng.herokuapp.com>
* <https://piping.glitch.me>
* <https://piping-47q675ro2guv.runkit.sh>

Expand Down Expand Up @@ -141,7 +140,6 @@ Here are easier ways to own your Piping Server.
- Remix on Glitch <https://glitch.com/~piping>
- Clone on RunKit: <https://runkit.com/nwtgck/piping>
- Fork on Repl.it: <https://repl.it/@nwtgck/piping>
- Deploy to Heroku: <https://elements.heroku.com/buttons/nwtgck/piping-server>

See "[Ecosystem around Piping Server · nwtgck/piping-server Wiki](https://github.com/nwtgck/piping-server/wiki/Ecosystem-around-Piping-Server)" to find more about self-hosting.

Expand Down Expand Up @@ -170,8 +168,6 @@ Options:
--crt-path Certification path [string]
```

Click the button above to deploy a Piping Server to Heroku.

## Piping Server written in Rust
Piping Server is also developed in Rust.
<https://github.com/nwtgck/piping-server-rust>
Loading

0 comments on commit f817776

Please sign in to comment.