pre-commit / fix simple file trailing things
This commit is contained in:
parent
10e132e8ef
commit
5ad54a8904
@ -5,3 +5,7 @@ repos:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
# - repo: https://github.com/pocc/pre-commit-hooks
|
||||
# rev: master
|
||||
# hooks:
|
||||
# - id: clang-format
|
||||
|
59
.travis.yml
59
.travis.yml
@ -1,59 +0,0 @@
|
||||
language: bash
|
||||
|
||||
# See https://github.com/amaiorano/vectrexy/blob/master/.travis.yml
|
||||
# for ideas on installing vcpkg
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# macOS
|
||||
# - os: osx
|
||||
# env:
|
||||
# - HOMEBREW_NO_AUTO_UPDATE=1
|
||||
# compiler: clang
|
||||
# script:
|
||||
# - brew install redis
|
||||
# - brew services start redis
|
||||
# - brew install mbedtls
|
||||
# - python test/run.py
|
||||
# - make ws
|
||||
|
||||
Linux
|
||||
- os: linux
|
||||
dist: bionic
|
||||
before_install:
|
||||
- sudo apt-get install -y libmbedtls-dev
|
||||
- sudo apt-get install -y redis-server
|
||||
script:
|
||||
- python test/run.py
|
||||
# - make ws
|
||||
env:
|
||||
- CC=gcc
|
||||
- CXX=g++
|
||||
|
||||
# Clang + Linux disabled for now
|
||||
# - os: linux
|
||||
# dist: xenial
|
||||
# script: python test/run.py
|
||||
# env:
|
||||
# - CC=clang
|
||||
# - CXX=clang++
|
||||
|
||||
# Windows
|
||||
# - os: windows
|
||||
# env:
|
||||
# - CMAKE_PATH="/c/Program Files/CMake/bin"
|
||||
# script:
|
||||
# - cd third_party/zlib
|
||||
# - cmake .
|
||||
# - cmake --build . --target install
|
||||
# - cd ../..
|
||||
# # - cd third_party/mbedtls
|
||||
# # - cmake .
|
||||
# # - cmake --build . --target install
|
||||
# # - cd ../..
|
||||
# - export PATH=$CMAKE_PATH:$PATH
|
||||
# - cd test
|
||||
# - cmake .
|
||||
# - cmake --build --parallel .
|
||||
# - ixwebsocket_unittest.exe
|
||||
# # - python test/run.py
|
@ -122,7 +122,7 @@ if (USE_TLS)
|
||||
option(USE_MBED_TLS "Use Mbed TLS" OFF)
|
||||
endif()
|
||||
option(USE_OPEN_SSL "Use OpenSSL" OFF)
|
||||
|
||||
|
||||
if (USE_MBED_TLS)
|
||||
list( APPEND IXWEBSOCKET_HEADERS ixwebsocket/IXSocketMbedTLS.h)
|
||||
list( APPEND IXWEBSOCKET_SOURCES ixwebsocket/IXSocketMbedTLS.cpp)
|
||||
|
@ -1,10 +1,10 @@
|
||||
FROM alpine:3.11 as build
|
||||
|
||||
RUN apk add --no-cache gcc g++ musl-dev linux-headers cmake openssl-dev
|
||||
RUN apk add --no-cache gcc g++ musl-dev linux-headers cmake openssl-dev
|
||||
RUN apk add --no-cache make
|
||||
RUN apk add --no-cache zlib-dev
|
||||
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
RUN chown -R app:app /opt
|
||||
RUN chown -R app:app /usr/local
|
||||
|
||||
@ -23,7 +23,7 @@ RUN apk add --no-cache libstdc++
|
||||
RUN apk add --no-cache strace
|
||||
RUN apk add --no-cache gdb
|
||||
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
COPY --chown=app:app --from=build /usr/local/bin/ws /usr/local/bin/ws
|
||||
RUN chmod +x /usr/local/bin/ws
|
||||
RUN ldd /usr/local/bin/ws
|
||||
|
@ -1,6 +1,6 @@
|
||||
FROM centos:8 as build
|
||||
|
||||
RUN yum install -y gcc-c++ make cmake zlib-devel openssl-devel redhat-rpm-config
|
||||
RUN yum install -y gcc-c++ make cmake zlib-devel openssl-devel redhat-rpm-config
|
||||
|
||||
RUN yum install -y epel-release
|
||||
RUN yum install -y mbedtls-devel
|
||||
|
@ -2,14 +2,14 @@
|
||||
FROM debian:buster as build
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN mkdir -p /tmp/cmake
|
||||
WORKDIR /tmp/cmake
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN tar zxf cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install libssl-dev
|
||||
RUN apt-get -y install libz-dev
|
||||
RUN apt-get -y install make
|
||||
@ -25,9 +25,9 @@ RUN ["make"]
|
||||
FROM debian:buster as runtime
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN apt-get update
|
||||
# Runtime
|
||||
RUN apt-get install -y libssl1.1
|
||||
RUN apt-get update
|
||||
# Runtime
|
||||
RUN apt-get install -y libssl1.1
|
||||
RUN apt-get install -y ca-certificates
|
||||
RUN ["update-ca-certificates"]
|
||||
|
||||
|
@ -8,7 +8,7 @@ RUN yum install -y openssl-devel
|
||||
RUN yum install -y wget
|
||||
RUN mkdir -p /tmp/cmake
|
||||
WORKDIR /tmp/cmake
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN tar zxf cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
|
||||
ARG CMAKE_BIN_PATH=/tmp/cmake/cmake-3.14.0-Linux-x86_64/bin
|
||||
@ -27,7 +27,7 @@ FROM fedora:30 as runtime
|
||||
|
||||
RUN yum install -y libtsan
|
||||
|
||||
RUN groupadd app && useradd -g app app
|
||||
RUN groupadd app && useradd -g app app
|
||||
COPY --chown=app:app --from=build /usr/local/bin/ws /usr/local/bin/ws
|
||||
RUN chmod +x /usr/local/bin/ws
|
||||
RUN ldd /usr/local/bin/ws
|
||||
|
@ -2,14 +2,14 @@
|
||||
FROM ubuntu:bionic as build
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN mkdir -p /tmp/cmake
|
||||
WORKDIR /tmp/cmake
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN tar zxf cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install libssl-dev
|
||||
RUN apt-get -y install libz-dev
|
||||
RUN apt-get -y install make
|
||||
|
@ -2,14 +2,14 @@
|
||||
FROM ubuntu:disco as build
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN mkdir -p /tmp/cmake
|
||||
WORKDIR /tmp/cmake
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN tar zxf cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install libssl-dev
|
||||
RUN apt-get -y install libz-dev
|
||||
RUN apt-get -y install make
|
||||
|
@ -2,14 +2,14 @@
|
||||
FROM ubuntu:xenial as build
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install wget
|
||||
RUN mkdir -p /tmp/cmake
|
||||
WORKDIR /tmp/cmake
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
RUN tar zxf cmake-3.14.0-Linux-x86_64.tar.gz
|
||||
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install g++
|
||||
RUN apt-get -y install libssl-dev
|
||||
RUN apt-get -y install libz-dev
|
||||
RUN apt-get -y install make
|
||||
|
@ -121,7 +121,7 @@ ws_connect: connection closed: code 1000 reason Normal closure
|
||||
|
||||
## [8.0.6] - 2020-01-31
|
||||
|
||||
(snake) add an option to disable answering pongs as response to pings, to test cobra client behavior with hanged connections
|
||||
(snake) add an option to disable answering pongs as response to pings, to test cobra client behavior with hanged connections
|
||||
|
||||
## [8.0.5] - 2020-01-31
|
||||
|
||||
|
@ -47,12 +47,12 @@ vcpkg install ixwebsocket
|
||||
|
||||
Conan is currently supported through a recipe in [Conan Center](https://github.com/conan-io/conan-center-index/tree/master/recipes/ixwebsocket) ([Bintray entry](https://bintray.com/conan/conan-center/ixwebsocket%3A_)).
|
||||
|
||||
Package reference
|
||||
Package reference
|
||||
|
||||
* Conan 1.21.0 and up: `ixwebsocket/7.9.2`
|
||||
* Earlier versions: `ixwebsocket/7.9.2@_/_`
|
||||
|
||||
Note that the version listed here might not be the latest one. See Bintray or the recipe itself for the latest version. If you're migrating from the previous, custom Bintray remote, note that the package reference _has_ to be lower-case.
|
||||
Note that the version listed here might not be the latest one. See Bintray or the recipe itself for the latest version. If you're migrating from the previous, custom Bintray remote, note that the package reference _has_ to be lower-case.
|
||||
|
||||
### Docker
|
||||
|
||||
|
@ -73,5 +73,3 @@ Here is a simplistic diagram which explains how the code is structured in term o
|
||||
| |
|
||||
+-----------------------+
|
||||
```
|
||||
|
||||
|
||||
|
@ -465,4 +465,3 @@ For a client, specifying `caFile` can be used if connecting to a server that use
|
||||
For a server, specifying `caFile` implies that:
|
||||
1. You require clients to present a certificate
|
||||
1. It must be signed by one of the trusted roots in the file
|
||||
|
||||
|
@ -23,7 +23,7 @@ add_library(ixcrypto STATIC
|
||||
${IXCRYPTO_HEADERS}
|
||||
)
|
||||
|
||||
set(IXCRYPTO_INCLUDE_DIRS
|
||||
set(IXCRYPTO_INCLUDE_DIRS
|
||||
.
|
||||
../ixcore)
|
||||
|
||||
@ -47,4 +47,3 @@ else()
|
||||
target_link_libraries(ixcrypto ${OPENSSL_LIBRARIES})
|
||||
target_compile_definitions(ixcrypto PUBLIC IXCRYPTO_USE_OPEN_SSL)
|
||||
endif()
|
||||
|
||||
|
@ -14993,4 +14993,3 @@ using Catch::Detail::Approx;
|
||||
// end catch_reenable_warnings.h
|
||||
// end catch.hpp
|
||||
#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -823,7 +823,7 @@ $ honcho start
|
||||
15:29:57 send.1 | [2020-01-05 15:29:57.399] [info] ws_send: received message (25183026 bytes)
|
||||
15:29:57 send.1 | [2020-01-05 15:29:57.399] [info] ws_send: Done !
|
||||
15:29:59 send.1 | [2020-01-05 15:29:59.233] [info] ws_send: connection closed: code 1000 reason Normal closure
|
||||
15:29:59 send.1 |
|
||||
15:29:59 send.1 |
|
||||
15:29:59 system | send.1 stopped (rc=0)
|
||||
15:29:59 system | sending SIGTERM to nginx.1 (pid 75372)
|
||||
15:29:59 system | sending SIGTERM to websocket_server.1 (pid 75374)
|
||||
|
@ -33,4 +33,3 @@ start_server = websockets.serve(echo, host, 8766, max_size=2 ** 30)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
||||
|
||||
|
@ -39,5 +39,3 @@ start_server = websockets.serve(echo, host, 8766, max_size=2 ** 30, ssl=ssl_cont
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
||||
|
||||
|
||||
|
22
test/run.py
22
test/run.py
@ -28,7 +28,7 @@ TEST_EXE_PATH = None
|
||||
|
||||
class Command(object):
|
||||
"""Run system commands with timeout
|
||||
|
||||
|
||||
From http://www.bo-yang.net/2016/12/01/python-run-command-with-timeout
|
||||
Python3 might have a builtin way to do that.
|
||||
"""
|
||||
@ -42,7 +42,7 @@ class Command(object):
|
||||
|
||||
def run(self, timeout=None):
|
||||
'''5 minutes default timeout'''
|
||||
|
||||
|
||||
if timeout is None:
|
||||
timeout = 5 * 60
|
||||
|
||||
@ -175,9 +175,9 @@ def log(msg, color):
|
||||
|
||||
|
||||
def isSuccessFullRun(output):
|
||||
'''When being run from lldb, we cannot capture the exit code
|
||||
so we have to parse the output which is produced in a
|
||||
consistent way. Whenever we'll be on a recent enough version of lldb we
|
||||
'''When being run from lldb, we cannot capture the exit code
|
||||
so we have to parse the output which is produced in a
|
||||
consistent way. Whenever we'll be on a recent enough version of lldb we
|
||||
won't have to do this.
|
||||
'''
|
||||
pid = None
|
||||
@ -212,9 +212,9 @@ def testLLDBOutput():
|
||||
]
|
||||
|
||||
failedOutputWithFailedUnittest = [
|
||||
'===============================================================================',
|
||||
'test cases: 1 | 0 passed | 1 failed', 'assertions: 15 | 14 passed | 1 failed',
|
||||
'',
|
||||
'===============================================================================',
|
||||
'test cases: 1 | 0 passed | 1 failed', 'assertions: 15 | 14 passed | 1 failed',
|
||||
'',
|
||||
'Process 279 exited with status = 1 (0x00000001) ',
|
||||
'',
|
||||
"Process 279 launched: '/Users/bsergeant/src/foss/ixwebsocket/test/build/Darwin/ixwebsocket_unittest' (x86_64)"
|
||||
@ -306,9 +306,9 @@ def prettyPrintXML(root):
|
||||
|
||||
def generateXmlOutput(results, xmlOutput, testRunName, runTime):
|
||||
'''Generate a junit compatible XML file
|
||||
|
||||
|
||||
We prefer doing this ourself instead of letting Catch2 do it.
|
||||
When the test is crashing (as has happened on Jenkins), an invalid file
|
||||
When the test is crashing (as has happened on Jenkins), an invalid file
|
||||
with no trailer can be created which trigger an XML reading error in validateTestSuite.
|
||||
|
||||
Something like that:
|
||||
@ -513,7 +513,7 @@ def main():
|
||||
print('LLDB is only supported on Apple at this point')
|
||||
args.lldb = False
|
||||
|
||||
return run(args.test, buildDir, sanitizer, xmlOutput,
|
||||
return run(args.test, buildDir, sanitizer, xmlOutput,
|
||||
testRunName, args.build_only, args.lldb, args.cpu_count, args.run_only)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug .. || exit 1
|
||||
make || exit 1
|
||||
|
4
third_party/.clang-format
vendored
Normal file
4
third_party/.clang-format
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"DisableFormat": true,
|
||||
"SortIncludes": false
|
||||
}
|
@ -37,7 +37,7 @@ if (NOT JSONCPP_FOUND)
|
||||
set(JSONCPP_SOURCES ../third_party/jsoncpp/jsoncpp.cpp)
|
||||
endif()
|
||||
|
||||
add_executable(ws
|
||||
add_executable(ws
|
||||
../third_party/msgpack11/msgpack11.cpp
|
||||
${STATSD_CLIENT_SOURCES}
|
||||
${JSONCPP_SOURCES}
|
||||
|
@ -7,7 +7,7 @@ generate_key() {
|
||||
local path=${1}
|
||||
local base=${2}
|
||||
local type=${3:-'rsa'} # "ec" or "rsa"
|
||||
|
||||
|
||||
mkdir -p ${path}
|
||||
if [[ "${type}" == "rsa" ]]; then
|
||||
openssl genrsa -out "${path}/${base}-key.pem"
|
||||
@ -24,7 +24,7 @@ generate_ca() {
|
||||
local base="${2:-'root-ca'}"
|
||||
local type="${3:-'rsa'}" # "ec" or "rsa"
|
||||
local org="${4:-'/O=machinezone/O=IXWebSocket'}"
|
||||
|
||||
|
||||
mkdir -p ${path}
|
||||
|
||||
generate_key "${path}" "${base}" "${type}"
|
||||
@ -54,14 +54,14 @@ generate_cert() {
|
||||
-key "${path}/${base}-key.pem" \
|
||||
-subj "${org}/CN=${base}" \
|
||||
-out "${path}/${base}.csr"
|
||||
|
||||
|
||||
|
||||
if [ "${base}" == "${cabase}" ]; then
|
||||
# self-signed
|
||||
openssl x509 -req -in "${path}/${base}.csr" \
|
||||
-signkey "${path}/${base}-key.pem" -days 365 -sha256 \
|
||||
-extfile <(printf "subjectAltName=${san}") \
|
||||
-outform PEM -out "${path}/${base}-crt.pem"
|
||||
-outform PEM -out "${path}/${base}-crt.pem"
|
||||
else
|
||||
openssl x509 -req -in ${path}/${base}.csr \
|
||||
-CA "${path}/${cabase}-crt.pem" \
|
||||
@ -82,7 +82,7 @@ type=${2:-'rsa'}
|
||||
org=${3:-'/O=machinezone/O=IXWebSocket'}
|
||||
|
||||
if ! which openssl &>/dev/null; then
|
||||
|
||||
|
||||
if ! grep -qa -E 'docker|lxc' /proc/1/cgroup; then
|
||||
# launch a container with openssl and run this script there
|
||||
docker run --rm -i -v $(pwd):/work alpine sh -c "apk add bash openssl && /work/generate_certs.sh /work/${outdir} && chown -R $(id -u):$(id -u) /work/${outdir}"
|
||||
@ -90,9 +90,9 @@ if ! which openssl &>/dev/null; then
|
||||
echo "Please install openssl in this container to generate test certs, or launch outside of docker" >&2 && exit 1
|
||||
fi
|
||||
else
|
||||
|
||||
|
||||
generate_ca "${outdir}" "trusted-ca" "${type}" "${org}"
|
||||
|
||||
|
||||
generate_cert "${outdir}" "trusted-server" "trusted-ca" "${type}" "${org}"
|
||||
generate_cert "${outdir}" "trusted-client" "trusted-ca" "${type}" "${org}"
|
||||
|
||||
|
@ -39,7 +39,7 @@ fi
|
||||
cd /tmp/ws_test
|
||||
ws transfer --port 8090 ${server_tls} --pidfile /tmp/ws_test/pidfile.transfer &
|
||||
|
||||
# Wait until the transfer server is up
|
||||
# Wait until the transfer server is up
|
||||
while true
|
||||
do
|
||||
nc -zv 127.0.0.1 8090 && {
|
||||
@ -60,7 +60,7 @@ cd /tmp/ws_test/send
|
||||
dd if=/dev/urandom of=/tmp/ws_test/send/20M_file count=20000 bs=1024
|
||||
|
||||
# Start the sender job
|
||||
ws send ${client_tls} --pidfile /tmp/ws_test/pidfile.send "${protocol}127.0.0.1:8090" /tmp/ws_test/send/20M_file
|
||||
ws send ${client_tls} --pidfile /tmp/ws_test/pidfile.send "${protocol}127.0.0.1:8090" /tmp/ws_test/send/20M_file
|
||||
|
||||
# Wait until the file has been written to disk
|
||||
while true
|
||||
|
Loading…
Reference in New Issue
Block a user