Blob Blame History Raw
From 1b5ee93a61f1bbb4207a905138937bbefda6bbd3 Mon Sep 17 00:00:00 2001
From: Shannon Weyrick <sweyrick@ns1.com>
Date: Fri, 24 Jun 2022 11:29:20 -0400
Subject: [PATCH] Various updates (#94)

* remove unused test framework which was causing issues

* add missing include

* add missing initializer, suspected cause of segfault in DoH

* remove travis, update docker to bullseye image

* add github ci

* update gitignore

* build deps, DOH

* remove mac from CI

* fix cmake cmd

* always build docker
---
 .gitignore             |  2 ++
 CMakeLists.txt         | 20 --------------------
 Dockerfile             |  9 ++++-----
 README.md              | 12 ++++--------
 ci/install-ldns.sh     | 18 ------------------
 ci/install-libuv.sh    | 17 -----------------
 flame/httpssession.cpp |  1 +
 flame/httpssession.h   |  1 +
 tests/main.cpp         | 17 -----------------
 9 files changed, 12 insertions(+), 85 deletions(-)
 delete mode 100644 ci/install-ldns.sh
 delete mode 100644 ci/install-libuv.sh
 delete mode 100644 tests/main.cpp

diff --git a/.gitignore b/.gitignore
index e517db6..490e460 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 build*/
 build_output/
+cmake-build-*/
+.idea*
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 467fa49..1e34bd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -204,26 +204,6 @@ target_link_libraries(flame
         PRIVATE ${LIBURL_PARSER_LIBRARIES}
         )
 
-add_executable(tests
-        tests/main.cpp
-        )
-
-if (NOT CATCH_FOUND)
-    message(STATUS "Using bundled catch2")
-    target_include_directories(tests SYSTEM
-        PRIVATE "${CMAKE_SOURCE_DIR}/3rd/catch"
-        )
-endif()
-
-target_include_directories(tests
-        PRIVATE "${CMAKE_SOURCE_DIR}/tests"
-        PRIVATE "${CMAKE_SOURCE_DIR}/flame"
-        )
-
-target_link_libraries(tests
-        PRIVATE flamecore
-        )
-
 install(TARGETS flame flamecore
         RUNTIME DESTINATION bin
         LIBRARY DESTINATION lib${LIB_SUFFIX}
diff --git a/Dockerfile b/Dockerfile
index 232eb84..33ea8f9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:buster-slim AS build
+FROM debian:bullseye-slim AS build
 
 ENV BUILD_DEPS "g++ cmake make libldns-dev libnghttp2-dev libuv1-dev libgnutls28-dev pkgconf"
 ENV DEBIAN_FRONTEND=noninteractive
@@ -13,12 +13,11 @@ RUN \
     mkdir /tmp/build && \
     cd /tmp/build && \
     cmake -DDOH_ENABLE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo /src && \
-    make all tests && \
-    ./tests
+    make all
 
-FROM debian:buster-slim AS runtime
+FROM debian:bullseye-slim AS runtime
 
-ENV RUNTIME_DEPS "libldns2 libuv1 nghttp2"
+ENV RUNTIME_DEPS "libldns3 libuv1 nghttp2"
 
 RUN \
     apt-get update && \
diff --git a/README.md b/README.md
index f4915fb..6d4573e 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-Flamethrower [![Build Status](https://travis-ci.org/DNS-OARC/flamethrower.svg?branch=master)](https://travis-ci.org/DNS-OARC/flamethrower)
+Flamethrower 
 ============
 > This project is in [active development](https://github.com/ns1/community/blob/master/project_status/ACTIVE_DEVELOPMENT.md).
 
 A DNS performance and functional testing utility.
 
-2017-2020© NSONE, Inc.
+2017-2022© NSONE, Inc.
 
 Overview
 --------
@@ -115,7 +115,6 @@ Optional DoH support requires:
 * nghttp2
 
 Optional dependencies:
-* catch >= 2.3
 * docopt
 * nlohmann-json >= 3.7.3
 * cpp-httplib
@@ -141,11 +140,8 @@ make
 
 Building the docker image:
 ```
-org="myorg"
-image="myflame"
-tag="latest"
-docker build --network host -t ${org}/${image}:${tag} -f Dockerfile .
-docker run --rm -it --net host ${org}/${image}:${tag} --help
+docker build . --tag ns1labs/flame --file Dockerfile
+docker run --rm --net host ns1labs/flame --help
 ```
 
 Contributions
diff --git a/ci/install-ldns.sh b/ci/install-ldns.sh
deleted file mode 100644
index 4fe883c..0000000
--- a/ci/install-ldns.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-VERSION=1.7.0
-ARCHIVE="https://www.nlnetlabs.nl/downloads/ldns/ldns-${VERSION}.tar.gz"
-
-set -ex
-
-cd /tmp
-wget -O "ldns-${VERSION}.tar.gz" "$ARCHIVE"
-tar -xf "ldns-${VERSION}.tar.gz"
-cd "ldns-${VERSION}"
-
-./configure --disable-dane
-make
-sudo make install
-sudo ldconfig
-sudo mkdir -p /usr/local/lib/pkgconfig
-sudo cp packaging/libldns.pc /usr/local/lib/pkgconfig/
diff --git a/ci/install-libuv.sh b/ci/install-libuv.sh
deleted file mode 100644
index 0f235d4..0000000
--- a/ci/install-libuv.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-VERSION=1.25.0
-ARCHIVE="https://github.com/libuv/libuv/archive/v${VERSION}.tar.gz"
-
-set -ex
-
-cd /tmp
-wget -O "libuv-${VERSION}.tar.gz" "$ARCHIVE"
-tar -xf "libuv-${VERSION}.tar.gz"
-cd "libuv-${VERSION}"
-
-./autogen.sh
-./configure
-make
-sudo make install
-sudo ldconfig
diff --git a/flame/httpssession.cpp b/flame/httpssession.cpp
index f2a616e..857c3fe 100644
--- a/flame/httpssession.cpp
+++ b/flame/httpssession.cpp
@@ -32,6 +32,7 @@ HTTPSSession::HTTPSSession(std::shared_ptr<uvw::TCPHandle> handle,
     , _handshake_error{handshake_error_handler}
     , _target{target}
     , _method{method}
+    , _current_session{nullptr}
 {
 }
 
diff --git a/flame/httpssession.h b/flame/httpssession.h
index c414d5c..fe904ea 100644
--- a/flame/httpssession.h
+++ b/flame/httpssession.h
@@ -2,6 +2,7 @@
 
 #include <gnutls/gnutls.h>
 #include <nghttp2/nghttp2.h>
+#include <unordered_map>
 
 #ifdef DOH_ENABLE
 #include "base64.h"
diff --git a/tests/main.cpp b/tests/main.cpp
deleted file mode 100644
index 32179b9..0000000
--- a/tests/main.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#define CATCH_CONFIG_RUNNER
-#include <catch2/catch.hpp>
-#include <cstdlib>
-
-int main(int argc, char *argv[])
-{
-    Catch::Session session;
-
-    int result = session.applyCommandLine(argc, argv);
-    if (result != 0) {
-        return result;
-    }
-
-    result = session.run();
-
-    return (result == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
-}
-- 
2.41.0