Skip to content

Commit

Permalink
Alert user about telemetry and give instructions to remove. Remove IP…
Browse files Browse the repository at this point in the history
… address from logging. #382 (#395)

* Alert user about telemetry and give instructions to remove.  Remove IP address from logging.  #382

* fix errors

* increase xcode rev

* move some external code to submodules

* more codecov cleanup

* fix race condition

* fix fd on console

* move another print to warning

* more logging fixes

* consolidate cmake install
  • Loading branch information
MisterTea committed Feb 17, 2021
1 parent 3942bea commit 7c43c75
Show file tree
Hide file tree
Showing 31 changed files with 184 additions and 21,787 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -145,7 +145,7 @@ jobs:
command: cd build; TSAN_OPTIONS="suppressions=../test/test_tsan.suppression" ./et-test
mac_tsan:
macos:
xcode: "10.2.1"
xcode: "11.3.1"
steps:
- run:
name: Avoid hosts unknown for github
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/vcpkg_build.yml
Expand Up @@ -35,22 +35,19 @@ jobs:

steps:
- name: Install Dependencies (Linux)
run: sudo apt-get update && sudo apt-get install ninja-build libutempter-dev libunwind-dev libcurl4-openssl-dev
run: sudo apt-get update && sudo apt-get install cmake ninja-build libutempter-dev libunwind-dev libcurl4-openssl-dev
if: matrix.os == 'ubuntu-latest'
- name: Install Dependencies (Windows)
run: choco install ninja
run: choco install ninja nsis
if: matrix.os == 'windows-latest'
- name: Install Dependencies (macOS)
run: brew install ninja
run: brew install ninja cmake
if: matrix.os == 'macos-latest'

- uses: actions/checkout@v2
with:
submodules: recursive

# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest

# Restore both vcpkg and its artifacts from the GitHub cache service.
- name: Restore vcpkg and its artifacts.
uses: actions/cache@v2
Expand Down Expand Up @@ -84,7 +81,7 @@ jobs:
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
- uses: actions/upload-artifact@v2
with:
name: et-client-${{matrix.os}}
Expand Down
15 changes: 15 additions & 0 deletions .gitmodules
Expand Up @@ -31,3 +31,18 @@
[submodule "external/cpp-httplib"]
path = external/cpp-httplib
url = https://github.com/yhirose/cpp-httplib.git
[submodule "external/PlatformFolders"]
path = external/PlatformFolders
url = https://github.com/sago007/PlatformFolders.git
[submodule "external/sole"]
path = external/sole
url = https://github.com/r-lyeh-archived/sole.git
[submodule "external/simpleini"]
path = external/simpleini
url = https://github.com/brofield/simpleini.git
[submodule "external/json"]
path = external/json
url = https://github.com/nlohmann/json.git
[submodule "external/base64"]
path = external/base64
url = https://github.com/tkislan/base64.git
29 changes: 17 additions & 12 deletions CMakeLists.txt
Expand Up @@ -23,6 +23,7 @@ find_package(SELinux)
ENDIF()

add_subdirectory("external/sentry-native")
add_subdirectory("external/PlatformFolders")

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/cotire/CMake" ${CMAKE_MODULE_PATH})
INCLUDE(cotire)
Expand Down Expand Up @@ -52,8 +53,8 @@ if(UNIX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
endif()

# Enable C++-11
set(CMAKE_CXX_STANDARD 11)
# Enable C++-17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(WIN32)
Expand Down Expand Up @@ -107,13 +108,15 @@ PROTOBUF_GENERATE_CPP(

proto/ET.proto
)
SET_SOURCE_FILES_PROPERTIES(${ET_SRCS} ${ET_HDRS} PROPERTIES GENERATED TRUE)
PROTOBUF_GENERATE_CPP(
ETERMINAL_SRCS
ETERMINAL_HDRS

proto/ETerminal.proto
)
add_custom_target(
SET_SOURCE_FILES_PROPERTIES(${ETERMINAL_SRCS} ${ETERMINAL_HDRS} PROPERTIES GENERATED TRUE)
add_custom_target(
generated-code
DEPENDS

Expand All @@ -122,17 +125,17 @@ add_custom_target(
)

IF(ANDROID)
set(CORE_LIBRARIES OpenSSL::SSL ZLIB::ZLIB util)
set(CORE_LIBRARIES platform_folders OpenSSL::SSL ZLIB::ZLIB util)
ELSEIF(FREEBSD)
set(CORE_LIBRARIES OpenSSL::SSL ZLIB::ZLIB util execinfo)
set(CORE_LIBRARIES platform_folders OpenSSL::SSL ZLIB::ZLIB util execinfo)
ELSEIF(NETBSD)
set(CORE_LIBRARIES OpenSSL::SSL ZLIB::ZLIB util resolv execinfo)
set(CORE_LIBRARIES platform_folders OpenSSL::SSL ZLIB::ZLIB util resolv execinfo)
ELSEIF(WIN32)
set(CORE_LIBRARIES OpenSSL::SSL ZLIB::ZLIB Ws2_32 Shlwapi dbghelp)
set(CORE_LIBRARIES platform_folders OpenSSL::SSL ZLIB::ZLIB Ws2_32 Shlwapi dbghelp)
ELSEIF(APPLE)
set(CORE_LIBRARIES OpenSSL::SSL ZLIB::ZLIB util resolv)
set(CORE_LIBRARIES platform_folders OpenSSL::SSL ZLIB::ZLIB util resolv)
ELSE()
set(CORE_LIBRARIES OpenSSL::SSL ZLIB::ZLIB unwind util resolv)
set(CORE_LIBRARIES platform_folders OpenSSL::SSL ZLIB::ZLIB unwind util resolv)
ENDIF()

MACRO(DECORATE_TARGET TARGET_NAME)
Expand All @@ -148,10 +151,15 @@ ENDMACRO()
include_directories(
external/easyloggingpp/src
external/ThreadPool
external/PlatformFolders
external/Catch2/single_include
external/cxxopts/include
external/msgpack-c/include
external/sentry-native/include
external/json/single_include/nlohmann
external/sole
external/base64
external/simpleini
external/cpp-httplib
src/base
src/terminal
Expand Down Expand Up @@ -217,9 +225,6 @@ add_library(
src/base/DaemonCreator.hpp
src/base/DaemonCreator.cpp

src/base/SystemUtils.hpp
src/base/SystemUtils.cpp

src/base/RawSocketUtils.hpp
src/base/RawSocketUtils.cpp

Expand Down
11 changes: 11 additions & 0 deletions codecov.yml
@@ -0,0 +1,11 @@
ignore:
- "external"
- "external_imported"
- "src/base/WinsockContext.hpp"
- "src/htm" # HTM not tested yet
- "src/terminal/ParseConfigFile.hpp"
- "src/terminal/TelemetryService*"
- "src/terminal/PsuedoTerminalConsole.hpp"
- "src/terminal/PsuedoUserTerminal.hpp"
- "src/base/TcpSocketHandler*"
- "src/base/SubprocessToString*"
1 change: 1 addition & 0 deletions external/PlatformFolders
Submodule PlatformFolders added at d09665
1 change: 1 addition & 0 deletions external/base64
Submodule base64 added at 6780d5
1 change: 1 addition & 0 deletions external/json
Submodule json added at 176d8e
1 change: 1 addition & 0 deletions external/simpleini
Submodule simpleini added at 7bca74
1 change: 1 addition & 0 deletions external/sole
Submodule sole added at 424b96
15 changes: 12 additions & 3 deletions src/base/Headers.hpp
Expand Up @@ -83,13 +83,24 @@ inline int close(int fd) { return ::closesocket(fd); }
#include <unordered_set>
#include <vector>

#if __has_include(<filesystem>)
#include <filesystem>
#else
#include <experimental/filesystem>
using namespace std::experimental;
#endif

#include "ET.pb.h"
#include "ETerminal.pb.h"
#include "SimpleIni.h"
#include "ThreadPool.h"
#include "base64.hpp"
#include "base64.h"
#include "easylogging++.h"
#include "json.hpp"
#include "sago/platform_folders.h"
#include "sentry.h"
#include "sole.hpp"

#if !defined(__ANDROID__)
#include "ust.hpp"
#endif
Expand All @@ -98,8 +109,6 @@ inline int close(int fd) { return ::closesocket(fd); }
#include <utempter.h>
#endif

#include "sentry.h"

#if defined(_MSC_VER)
#define popen _popen
#define pclose _pclose
Expand Down
10 changes: 5 additions & 5 deletions src/base/SocketHandler.hpp
Expand Up @@ -87,27 +87,27 @@ class SocketHandler {
}

inline void writeB64(int fd, const char* buf, size_t count) {
size_t encodedLength = base64::Base64::EncodedLength(count);
size_t encodedLength = Base64::EncodedLength(count);
string s(encodedLength, '\0');
if (!base64::Base64::Encode(buf, count, &s[0], s.length())) {
if (!Base64::Encode(buf, count, &s[0], s.length())) {
throw runtime_error("b64 decode failed");
}
writeAllOrThrow(fd, &s[0], s.length(), false);
}

inline void readB64(int fd, char* buf, size_t count) {
size_t encodedLength = base64::Base64::EncodedLength(count);
size_t encodedLength = Base64::EncodedLength(count);
string s(encodedLength, '\0');
readAll(fd, &s[0], s.length(), false);
if (!base64::Base64::Decode((const char*)&s[0], s.length(), buf, count)) {
if (!Base64::Decode((const char*)&s[0], s.length(), buf, count)) {
throw runtime_error("b64 decode failed");
}
}

inline void readB64EncodedLength(int fd, string* out, size_t encodedLength) {
string s(encodedLength, '\0');
readAll(fd, &s[0], s.length(), false);
if (!base64::Base64::Decode(s, out)) {
if (!Base64::Decode(s, out)) {
throw runtime_error("b64 decode failed");
}
}
Expand Down
74 changes: 0 additions & 74 deletions src/base/SystemUtils.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions src/base/SystemUtils.hpp

This file was deleted.

0 comments on commit 7c43c75

Please sign in to comment.