You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by hu...@apache.org on 2022/09/24 15:14:26 UTC

[incubator-kvrocks] branch unstable updated: Disable the TLS by default (#911)

This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 91cebf2  Disable the TLS by default (#911)
91cebf2 is described below

commit 91cebf2ccec66c711d64cd207b90ff9e600a565d
Author: hulk <hu...@gmail.com>
AuthorDate: Sat Sep 24 23:14:22 2022 +0800

    Disable the TLS by default (#911)
---
 .github/workflows/kvrocks.yaml | 20 ++++++++++++++------
 CMakeLists.txt                 |  2 +-
 Dockerfile                     |  4 ++--
 README.md                      |  7 +++++++
 4 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/kvrocks.yaml b/.github/workflows/kvrocks.yaml
index 15dc683..5bd1bdf 100644
--- a/.github/workflows/kvrocks.yaml
+++ b/.github/workflows/kvrocks.yaml
@@ -72,24 +72,30 @@ jobs:
           - name: Darwin Clang
             os: macos-11
             compiler: auto
+            with_openssl: -DENABLE_OPENSSL=ON
           - name: Darwin Clang without Jemalloc
             os: macos-11
             compiler: auto
             without_jemalloc: -DDISABLE_JEMALLOC=ON
+            with_openssl: -DENABLE_OPENSSL=ON
           - name: Ubuntu GCC
             os: ubuntu-18.04
             compiler: gcc
+            with_openssl: -DENABLE_OPENSSL=ON
           - name: Ubuntu Clang
             os: ubuntu-18.04
             compiler: clang
+            with_openssl: -DENABLE_OPENSSL=ON
           - name: Ubuntu GCC ASan
             os: ubuntu-18.04
             without_jemalloc: -DDISABLE_JEMALLOC=ON
             with_sanitizer: -DENABLE_ASAN=ON
+            with_openssl: -DENABLE_OPENSSL=ON
             compiler: gcc
           - name: Ubuntu GCC TSan
             os: ubuntu-18.04
             without_jemalloc: -DDISABLE_JEMALLOC=ON
+            with_openssl: -DENABLE_OPENSSL=ON
             with_sanitizer: -DENABLE_TSAN=ON
             compiler: gcc
             runtime_env_vars: TSAN_OPTIONS="suppressions=$(realpath ./tests/tsan-suppressions)"
@@ -97,30 +103,34 @@ jobs:
             os: ubuntu-18.04
             with_sanitizer: -DENABLE_ASAN=ON
             without_jemalloc: -DDISABLE_JEMALLOC=ON
+            with_openssl: -DENABLE_OPENSSL=ON
             compiler: clang
           - name: Ubuntu Clang TSan
             os: ubuntu-18.04
             with_sanitizer: -DENABLE_TSAN=ON
             without_jemalloc: -DDISABLE_JEMALLOC=ON
+            with_openssl: -DENABLE_OPENSSL=ON
             compiler: clang
             runtime_env_vars: TSAN_OPTIONS="suppressions=$(realpath ./tests/tsan-suppressions)"
           - name: Ubuntu GCC Ninja
             os: ubuntu-18.04
             with_ninja: --ninja
+            with_openssl: -DENABLE_OPENSSL=ON
             compiler: gcc
           - name: Ubuntu GCC Ninja without Jemalloc
             os: ubuntu-18.04
             with_ninja: --ninja
             without_jemalloc: -DDISABLE_JEMALLOC=ON
+            with_openssl: -DENABLE_OPENSSL=ON
             compiler: gcc
           - name: Ubuntu GCC without luajit
             os: ubuntu-18.04
             without_luajit: -DUSE_LUAJIT=OFF
+            with_openssl: -DENABLE_OPENSSL=ON
             compiler: gcc
           - name: Ubuntu GCC without OpenSSL
             os: ubuntu-18.04
             compiler: gcc
-            without_openssl: -DENABLE_OPENSSL=OFF
 
     runs-on: ${{ matrix.os }}
     steps:
@@ -164,10 +174,8 @@ jobs:
 
       - name: Build Kvrocks
         run: |
-          ./x.py build -j$NPROC --unittest --compiler \
-            ${{ matrix.compiler }} ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} \
-            ${{ matrix.without_jemalloc }} ${{ matrix.without_openssl }} ${{ matrix.without_luajit }} \
-            ${{ env.CMAKE_EXTRA_DEFS }}
+          ./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.without_jemalloc }} ${{ matrix.without_luajit }} \
+            ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.with_openssl }} ${{ env.CMAKE_EXTRA_DEFS }}
 
       - name: Run Unit Test
         run: |
@@ -196,7 +204,7 @@ jobs:
         run: |
           export ${{ matrix.runtime_env_vars }}
           ./x.py test tcl build --cli-path $HOME/local/bin/redis-cli --dont-clean
-          if [[ -z "${{ matrix.without_openssl }}" ]] && [[ "${{ matrix.os }}" == ubuntu* ]]; then
+          if [[ -n "${{ matrix.with_openssl }}" ]] && [[ "${{ matrix.os }}" == ubuntu* ]]; then
             git clone https://github.com/jsha/minica
             cd minica && go build && cd ..
             ./minica/minica --domains localhost
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a529bc..e41f174 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@ option(ENABLE_TSAN "enable thread santinizer" OFF)
 option(ASAN_WITH_LSAN "enable leak santinizer while address santinizer is enabled" ON)
 option(ENABLE_STATIC_LIBSTDCXX "link kvrocks with static library of libstd++ instead of shared library" ON)
 option(USE_LUAJIT "use luaJIT instead of lua" ON)
-option(ENABLE_OPENSSL "enable openssl to support tls connection" ON)
+option(ENABLE_OPENSSL "enable openssl to support tls connection" OFF)
 
 if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
     cmake_policy(SET CMP0135 NEW)
diff --git a/Dockerfile b/Dockerfile
index bd32996..8e806d0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -26,7 +26,7 @@ RUN apt install -y git gcc g++ make cmake autoconf automake libtool python3 libs
 WORKDIR /kvrocks
 
 COPY . .
-RUN ./x.py build
+RUN ./x.py build -DENABLE_OPENSSL=ON
 
 FROM ubuntu:focal
 
@@ -38,5 +38,5 @@ COPY ./kvrocks.conf  ./conf/
 RUN sed -i -e 's%dir /tmp/kvrocks%dir /var/lib/kvrocks%g' ./conf/kvrocks.conf
 VOLUME /var/lib/kvrocks
 
-EXPOSE 6666:6666 
+EXPOSE 6666:6666
 ENTRYPOINT ["./bin/kvrocks", "-c", "./conf/kvrocks.conf"]
diff --git a/README.md b/README.md
index da91e0b..72d1ead 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,13 @@ $ ./x.py build # `./x.py build -h` to check more options;
                # especially, `./x.py build --ghproxy` will fetch dependencies via ghproxy.com.
 ```
 
+To build with TLS support, you'll need OpenSSL development libraries (e.g. libssl-dev on Debian/Ubuntu) and run:
+
+```shell
+$ ./x.py build -DENABLE_OPENSSL=ON
+```
+
+
 ### Running kvrocks
 
 ```shell