Initial commit

This commit is contained in:
Ilya 2022-11-07 21:52:11 +03:00
commit 300ade4e8b
17 changed files with 1237 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.idea
cmake-build-debug
rglog

15
.gitmodules vendored Normal file
View File

@ -0,0 +1,15 @@
[submodule "dependencies/curlpp"]
path = dependencies/curlpp
url = https://github.com/jpbarrette/curlpp.git
[submodule "dependencies/websocketpp"]
path = dependencies/websocketpp
url = https://github.com/zaphoyd/websocketpp
[submodule "dependencies/argparse"]
path = dependencies/argparse
url = https://github.com/p-ranav/argparse
[submodule "dependencies/boost"]
path = dependencies/boost
url = https://github.com/boostorg/boost
[submodule "dependencies/json"]
path = dependencies/json
url = https://github.com/nlohmann/json

12
CMakeLists.txt Executable file
View File

@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.12)
project(RLogs)
add_subdirectory(dependencies)
INCLUDE_DIRECTORIES("dependencies/argparse/include/" ".")
INCLUDE_DIRECTORIES("dependencies/websocketpp/" ".")
INCLUDE_DIRECTORIES("dependencies/json/include/" ".")
find_package(Boost COMPONENTS system)
set(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lboost_system -lpthread -lcrypto -lssl")
add_executable(RLogs src/main.cpp src/connection.cpp src/connection.h)

788
Makefile Normal file
View File

@ -0,0 +1,788 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.13
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /mnt/c/Users/Ilya/CLionProjects/untitled
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /mnt/c/Users/Ilya/CLionProjects/untitled
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target package
package: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
/usr/bin/cpack --config ./CPackConfig.cmake
.PHONY : package
# Special rule for the target package
package/fast: package
.PHONY : package/fast
# Special rule for the target package_source
package_source:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
/usr/bin/cpack --config ./CPackSourceConfig.cmake /mnt/c/Users/Ilya/CLionProjects/untitled/CPackSourceConfig.cmake
.PHONY : package_source
# Special rule for the target package_source
package_source/fast: package_source
.PHONY : package_source/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\" \"dev\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles/progress.marks
$(MAKE) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
$(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -P /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles/VerifyGlobs.cmake
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named untitled
# Build rule for target.
untitled: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 untitled
.PHONY : untitled
# fast build rule for target.
untitled/fast:
$(MAKE) -f CMakeFiles/untitled.dir/build.make CMakeFiles/untitled.dir/build
.PHONY : untitled/fast
#=============================================================================
# Target rules for targets named curlpp_static
# Build rule for target.
curlpp_static: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 curlpp_static
.PHONY : curlpp_static
# fast build rule for target.
curlpp_static/fast:
$(MAKE) -f dependencies/curlpp/CMakeFiles/curlpp_static.dir/build.make dependencies/curlpp/CMakeFiles/curlpp_static.dir/build
.PHONY : curlpp_static/fast
#=============================================================================
# Target rules for targets named curlpp
# Build rule for target.
curlpp: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 curlpp
.PHONY : curlpp
# fast build rule for target.
curlpp/fast:
$(MAKE) -f dependencies/curlpp/CMakeFiles/curlpp.dir/build.make dependencies/curlpp/CMakeFiles/curlpp.dir/build
.PHONY : curlpp/fast
#=============================================================================
# Target rules for targets named boost_atomic
# Build rule for target.
boost_atomic: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_atomic
.PHONY : boost_atomic
# fast build rule for target.
boost_atomic/fast:
$(MAKE) -f dependencies/Boost/libs/atomic/CMakeFiles/boost_atomic.dir/build.make dependencies/Boost/libs/atomic/CMakeFiles/boost_atomic.dir/build
.PHONY : boost_atomic/fast
#=============================================================================
# Target rules for targets named boost_chrono
# Build rule for target.
boost_chrono: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_chrono
.PHONY : boost_chrono
# fast build rule for target.
boost_chrono/fast:
$(MAKE) -f dependencies/Boost/libs/chrono/CMakeFiles/boost_chrono.dir/build.make dependencies/Boost/libs/chrono/CMakeFiles/boost_chrono.dir/build
.PHONY : boost_chrono/fast
#=============================================================================
# Target rules for targets named boost_container
# Build rule for target.
boost_container: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_container
.PHONY : boost_container
# fast build rule for target.
boost_container/fast:
$(MAKE) -f dependencies/Boost/libs/container/CMakeFiles/boost_container.dir/build.make dependencies/Boost/libs/container/CMakeFiles/boost_container.dir/build
.PHONY : boost_container/fast
#=============================================================================
# Target rules for targets named boost_context
# Build rule for target.
boost_context: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_context
.PHONY : boost_context
# fast build rule for target.
boost_context/fast:
$(MAKE) -f dependencies/Boost/libs/context/CMakeFiles/boost_context.dir/build.make dependencies/Boost/libs/context/CMakeFiles/boost_context.dir/build
.PHONY : boost_context/fast
#=============================================================================
# Target rules for targets named boost_contract
# Build rule for target.
boost_contract: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_contract
.PHONY : boost_contract
# fast build rule for target.
boost_contract/fast:
$(MAKE) -f dependencies/Boost/libs/contract/CMakeFiles/boost_contract.dir/build.make dependencies/Boost/libs/contract/CMakeFiles/boost_contract.dir/build
.PHONY : boost_contract/fast
#=============================================================================
# Target rules for targets named boost_coroutine
# Build rule for target.
boost_coroutine: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_coroutine
.PHONY : boost_coroutine
# fast build rule for target.
boost_coroutine/fast:
$(MAKE) -f dependencies/Boost/libs/coroutine/CMakeFiles/boost_coroutine.dir/build.make dependencies/Boost/libs/coroutine/CMakeFiles/boost_coroutine.dir/build
.PHONY : boost_coroutine/fast
#=============================================================================
# Target rules for targets named boost_date_time
# Build rule for target.
boost_date_time: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_date_time
.PHONY : boost_date_time
# fast build rule for target.
boost_date_time/fast:
$(MAKE) -f dependencies/Boost/libs/date_time/CMakeFiles/boost_date_time.dir/build.make dependencies/Boost/libs/date_time/CMakeFiles/boost_date_time.dir/build
.PHONY : boost_date_time/fast
#=============================================================================
# Target rules for targets named boost_exception
# Build rule for target.
boost_exception: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_exception
.PHONY : boost_exception
# fast build rule for target.
boost_exception/fast:
$(MAKE) -f dependencies/Boost/libs/exception/CMakeFiles/boost_exception.dir/build.make dependencies/Boost/libs/exception/CMakeFiles/boost_exception.dir/build
.PHONY : boost_exception/fast
#=============================================================================
# Target rules for targets named boost_fiber_numa
# Build rule for target.
boost_fiber_numa: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_fiber_numa
.PHONY : boost_fiber_numa
# fast build rule for target.
boost_fiber_numa/fast:
$(MAKE) -f dependencies/Boost/libs/fiber/CMakeFiles/boost_fiber_numa.dir/build.make dependencies/Boost/libs/fiber/CMakeFiles/boost_fiber_numa.dir/build
.PHONY : boost_fiber_numa/fast
#=============================================================================
# Target rules for targets named boost_fiber
# Build rule for target.
boost_fiber: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_fiber
.PHONY : boost_fiber
# fast build rule for target.
boost_fiber/fast:
$(MAKE) -f dependencies/Boost/libs/fiber/CMakeFiles/boost_fiber.dir/build.make dependencies/Boost/libs/fiber/CMakeFiles/boost_fiber.dir/build
.PHONY : boost_fiber/fast
#=============================================================================
# Target rules for targets named boost_filesystem
# Build rule for target.
boost_filesystem: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_filesystem
.PHONY : boost_filesystem
# fast build rule for target.
boost_filesystem/fast:
$(MAKE) -f dependencies/Boost/libs/filesystem/CMakeFiles/boost_filesystem.dir/build.make dependencies/Boost/libs/filesystem/CMakeFiles/boost_filesystem.dir/build
.PHONY : boost_filesystem/fast
#=============================================================================
# Target rules for targets named boost_graph
# Build rule for target.
boost_graph: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_graph
.PHONY : boost_graph
# fast build rule for target.
boost_graph/fast:
$(MAKE) -f dependencies/Boost/libs/graph/CMakeFiles/boost_graph.dir/build.make dependencies/Boost/libs/graph/CMakeFiles/boost_graph.dir/build
.PHONY : boost_graph/fast
#=============================================================================
# Target rules for targets named boost_iostreams
# Build rule for target.
boost_iostreams: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_iostreams
.PHONY : boost_iostreams
# fast build rule for target.
boost_iostreams/fast:
$(MAKE) -f dependencies/Boost/libs/iostreams/CMakeFiles/boost_iostreams.dir/build.make dependencies/Boost/libs/iostreams/CMakeFiles/boost_iostreams.dir/build
.PHONY : boost_iostreams/fast
#=============================================================================
# Target rules for targets named boost_json
# Build rule for target.
boost_json: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_json
.PHONY : boost_json
# fast build rule for target.
boost_json/fast:
$(MAKE) -f dependencies/Boost/libs/json/CMakeFiles/boost_json.dir/build.make dependencies/Boost/libs/json/CMakeFiles/boost_json.dir/build
.PHONY : boost_json/fast
#=============================================================================
# Target rules for targets named boost_locale
# Build rule for target.
boost_locale: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_locale
.PHONY : boost_locale
# fast build rule for target.
boost_locale/fast:
$(MAKE) -f dependencies/Boost/libs/locale/CMakeFiles/boost_locale.dir/build.make dependencies/Boost/libs/locale/CMakeFiles/boost_locale.dir/build
.PHONY : boost_locale/fast
#=============================================================================
# Target rules for targets named boost_log
# Build rule for target.
boost_log: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_log
.PHONY : boost_log
# fast build rule for target.
boost_log/fast:
$(MAKE) -f dependencies/Boost/libs/log/CMakeFiles/boost_log.dir/build.make dependencies/Boost/libs/log/CMakeFiles/boost_log.dir/build
.PHONY : boost_log/fast
#=============================================================================
# Target rules for targets named boost_log_setup
# Build rule for target.
boost_log_setup: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_log_setup
.PHONY : boost_log_setup
# fast build rule for target.
boost_log_setup/fast:
$(MAKE) -f dependencies/Boost/libs/log/CMakeFiles/boost_log_setup.dir/build.make dependencies/Boost/libs/log/CMakeFiles/boost_log_setup.dir/build
.PHONY : boost_log_setup/fast
#=============================================================================
# Target rules for targets named boost_nowide
# Build rule for target.
boost_nowide: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_nowide
.PHONY : boost_nowide
# fast build rule for target.
boost_nowide/fast:
$(MAKE) -f dependencies/Boost/libs/nowide/CMakeFiles/boost_nowide.dir/build.make dependencies/Boost/libs/nowide/CMakeFiles/boost_nowide.dir/build
.PHONY : boost_nowide/fast
#=============================================================================
# Target rules for targets named boost_program_options
# Build rule for target.
boost_program_options: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_program_options
.PHONY : boost_program_options
# fast build rule for target.
boost_program_options/fast:
$(MAKE) -f dependencies/Boost/libs/program_options/CMakeFiles/boost_program_options.dir/build.make dependencies/Boost/libs/program_options/CMakeFiles/boost_program_options.dir/build
.PHONY : boost_program_options/fast
#=============================================================================
# Target rules for targets named boost_random
# Build rule for target.
boost_random: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_random
.PHONY : boost_random
# fast build rule for target.
boost_random/fast:
$(MAKE) -f dependencies/Boost/libs/random/CMakeFiles/boost_random.dir/build.make dependencies/Boost/libs/random/CMakeFiles/boost_random.dir/build
.PHONY : boost_random/fast
#=============================================================================
# Target rules for targets named boost_wserialization
# Build rule for target.
boost_wserialization: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_wserialization
.PHONY : boost_wserialization
# fast build rule for target.
boost_wserialization/fast:
$(MAKE) -f dependencies/Boost/libs/serialization/CMakeFiles/boost_wserialization.dir/build.make dependencies/Boost/libs/serialization/CMakeFiles/boost_wserialization.dir/build
.PHONY : boost_wserialization/fast
#=============================================================================
# Target rules for targets named boost_serialization
# Build rule for target.
boost_serialization: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_serialization
.PHONY : boost_serialization
# fast build rule for target.
boost_serialization/fast:
$(MAKE) -f dependencies/Boost/libs/serialization/CMakeFiles/boost_serialization.dir/build.make dependencies/Boost/libs/serialization/CMakeFiles/boost_serialization.dir/build
.PHONY : boost_serialization/fast
#=============================================================================
# Target rules for targets named boost_stacktrace_backtrace
# Build rule for target.
boost_stacktrace_backtrace: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_stacktrace_backtrace
.PHONY : boost_stacktrace_backtrace
# fast build rule for target.
boost_stacktrace_backtrace/fast:
$(MAKE) -f dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_backtrace.dir/build.make dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_backtrace.dir/build
.PHONY : boost_stacktrace_backtrace/fast
#=============================================================================
# Target rules for targets named boost_stacktrace_noop
# Build rule for target.
boost_stacktrace_noop: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_stacktrace_noop
.PHONY : boost_stacktrace_noop
# fast build rule for target.
boost_stacktrace_noop/fast:
$(MAKE) -f dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_noop.dir/build.make dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_noop.dir/build
.PHONY : boost_stacktrace_noop/fast
#=============================================================================
# Target rules for targets named boost_stacktrace_addr2line
# Build rule for target.
boost_stacktrace_addr2line: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_stacktrace_addr2line
.PHONY : boost_stacktrace_addr2line
# fast build rule for target.
boost_stacktrace_addr2line/fast:
$(MAKE) -f dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_addr2line.dir/build.make dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_addr2line.dir/build
.PHONY : boost_stacktrace_addr2line/fast
#=============================================================================
# Target rules for targets named boost_stacktrace_basic
# Build rule for target.
boost_stacktrace_basic: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_stacktrace_basic
.PHONY : boost_stacktrace_basic
# fast build rule for target.
boost_stacktrace_basic/fast:
$(MAKE) -f dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_basic.dir/build.make dependencies/Boost/libs/stacktrace/CMakeFiles/boost_stacktrace_basic.dir/build
.PHONY : boost_stacktrace_basic/fast
#=============================================================================
# Target rules for targets named boost_test_exec_monitor
# Build rule for target.
boost_test_exec_monitor: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_test_exec_monitor
.PHONY : boost_test_exec_monitor
# fast build rule for target.
boost_test_exec_monitor/fast:
$(MAKE) -f dependencies/Boost/libs/test/CMakeFiles/boost_test_exec_monitor.dir/build.make dependencies/Boost/libs/test/CMakeFiles/boost_test_exec_monitor.dir/build
.PHONY : boost_test_exec_monitor/fast
#=============================================================================
# Target rules for targets named boost_unit_test_framework
# Build rule for target.
boost_unit_test_framework: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_unit_test_framework
.PHONY : boost_unit_test_framework
# fast build rule for target.
boost_unit_test_framework/fast:
$(MAKE) -f dependencies/Boost/libs/test/CMakeFiles/boost_unit_test_framework.dir/build.make dependencies/Boost/libs/test/CMakeFiles/boost_unit_test_framework.dir/build
.PHONY : boost_unit_test_framework/fast
#=============================================================================
# Target rules for targets named boost_prg_exec_monitor
# Build rule for target.
boost_prg_exec_monitor: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_prg_exec_monitor
.PHONY : boost_prg_exec_monitor
# fast build rule for target.
boost_prg_exec_monitor/fast:
$(MAKE) -f dependencies/Boost/libs/test/CMakeFiles/boost_prg_exec_monitor.dir/build.make dependencies/Boost/libs/test/CMakeFiles/boost_prg_exec_monitor.dir/build
.PHONY : boost_prg_exec_monitor/fast
#=============================================================================
# Target rules for targets named boost_thread
# Build rule for target.
boost_thread: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_thread
.PHONY : boost_thread
# fast build rule for target.
boost_thread/fast:
$(MAKE) -f dependencies/Boost/libs/thread/CMakeFiles/boost_thread.dir/build.make dependencies/Boost/libs/thread/CMakeFiles/boost_thread.dir/build
.PHONY : boost_thread/fast
#=============================================================================
# Target rules for targets named boost_timer
# Build rule for target.
boost_timer: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_timer
.PHONY : boost_timer
# fast build rule for target.
boost_timer/fast:
$(MAKE) -f dependencies/Boost/libs/timer/CMakeFiles/boost_timer.dir/build.make dependencies/Boost/libs/timer/CMakeFiles/boost_timer.dir/build
.PHONY : boost_timer/fast
#=============================================================================
# Target rules for targets named boost_type_erasure
# Build rule for target.
boost_type_erasure: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_type_erasure
.PHONY : boost_type_erasure
# fast build rule for target.
boost_type_erasure/fast:
$(MAKE) -f dependencies/Boost/libs/type_erasure/CMakeFiles/boost_type_erasure.dir/build.make dependencies/Boost/libs/type_erasure/CMakeFiles/boost_type_erasure.dir/build
.PHONY : boost_type_erasure/fast
#=============================================================================
# Target rules for targets named boost_url
# Build rule for target.
boost_url: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_url
.PHONY : boost_url
# fast build rule for target.
boost_url/fast:
$(MAKE) -f dependencies/Boost/libs/url/CMakeFiles/boost_url.dir/build.make dependencies/Boost/libs/url/CMakeFiles/boost_url.dir/build
.PHONY : boost_url/fast
#=============================================================================
# Target rules for targets named boost_wave
# Build rule for target.
boost_wave: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 boost_wave
.PHONY : boost_wave
# fast build rule for target.
boost_wave/fast:
$(MAKE) -f dependencies/Boost/libs/wave/CMakeFiles/boost_wave.dir/build.make dependencies/Boost/libs/wave/CMakeFiles/boost_wave.dir/build
.PHONY : boost_wave/fast
src/connection.o: src/connection.cpp.o
.PHONY : src/connection.o
# target to build an object file
src/connection.cpp.o:
$(MAKE) -f CMakeFiles/untitled.dir/build.make CMakeFiles/untitled.dir/src/connection.cpp.o
.PHONY : src/connection.cpp.o
src/connection.i: src/connection.cpp.i
.PHONY : src/connection.i
# target to preprocess a source file
src/connection.cpp.i:
$(MAKE) -f CMakeFiles/untitled.dir/build.make CMakeFiles/untitled.dir/src/connection.cpp.i
.PHONY : src/connection.cpp.i
src/connection.s: src/connection.cpp.s
.PHONY : src/connection.s
# target to generate assembly for a file
src/connection.cpp.s:
$(MAKE) -f CMakeFiles/untitled.dir/build.make CMakeFiles/untitled.dir/src/connection.cpp.s
.PHONY : src/connection.cpp.s
src/main.o: src/main.cpp.o
.PHONY : src/main.o
# target to build an object file
src/main.cpp.o:
$(MAKE) -f CMakeFiles/untitled.dir/build.make CMakeFiles/untitled.dir/src/main.cpp.o
.PHONY : src/main.cpp.o
src/main.i: src/main.cpp.i
.PHONY : src/main.i
# target to preprocess a source file
src/main.cpp.i:
$(MAKE) -f CMakeFiles/untitled.dir/build.make CMakeFiles/untitled.dir/src/main.cpp.i
.PHONY : src/main.cpp.i
src/main.s: src/main.cpp.s
.PHONY : src/main.s
# target to generate assembly for a file
src/main.cpp.s:
$(MAKE) -f CMakeFiles/untitled.dir/build.make CMakeFiles/untitled.dir/src/main.cpp.s
.PHONY : src/main.cpp.s
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... install/strip"
@echo "... install/local"
@echo "... install"
@echo "... package"
@echo "... package_source"
@echo "... untitled"
@echo "... edit_cache"
@echo "... rebuild_cache"
@echo "... list_install_components"
@echo "... curlpp_static"
@echo "... curlpp"
@echo "... boost_atomic"
@echo "... boost_chrono"
@echo "... boost_container"
@echo "... boost_context"
@echo "... boost_contract"
@echo "... boost_coroutine"
@echo "... boost_date_time"
@echo "... boost_exception"
@echo "... boost_fiber_numa"
@echo "... boost_fiber"
@echo "... boost_filesystem"
@echo "... boost_graph"
@echo "... boost_iostreams"
@echo "... boost_json"
@echo "... boost_locale"
@echo "... boost_log"
@echo "... boost_log_setup"
@echo "... boost_nowide"
@echo "... boost_program_options"
@echo "... boost_random"
@echo "... boost_wserialization"
@echo "... boost_serialization"
@echo "... boost_stacktrace_backtrace"
@echo "... boost_stacktrace_noop"
@echo "... boost_stacktrace_addr2line"
@echo "... boost_stacktrace_basic"
@echo "... boost_test_exec_monitor"
@echo "... boost_unit_test_framework"
@echo "... boost_prg_exec_monitor"
@echo "... boost_thread"
@echo "... boost_timer"
@echo "... boost_type_erasure"
@echo "... boost_url"
@echo "... boost_wave"
@echo "... src/connection.o"
@echo "... src/connection.i"
@echo "... src/connection.s"
@echo "... src/main.o"
@echo "... src/main.i"
@echo "... src/main.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -P /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles/VerifyGlobs.cmake
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

View File

@ -0,0 +1,16 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.13
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/mnt/c/Users/Ilya/CLionProjects/untitled")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/mnt/c/Users/Ilya/CLionProjects/untitled")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})

View File

@ -0,0 +1 @@
99

33
dependencies/CMakeLists.txt vendored Executable file
View File

@ -0,0 +1,33 @@
include(FetchContent)
FetchContent_Declare(
curlpp
GIT_REPOSITORY "https://github.com/jpbarrette/curlpp"
GIT_TAG 6dde740658257103435ba86e5e92828112e5d2fc
)
FetchContent_Declare(
websocketpp
GIT_REPOSITORY "https://github.com/zaphoyd/websocketpp"
GIT_TAG 1b11fd301531e6df35a6107c1e8665b1e77a2d8e
)
FetchContent_Declare(
argparse
GIT_REPOSITORY "https://github.com/p-ranav/argparse"
GIT_TAG 997da9255618311d1fcb0135ce86022729d1f1cb
)
FetchContent_Declare(
Boost
GIT_REPOSITORY "https://github.com/boostorg/boost"
GIT_TAG 32da69a36f84c5255af8a994951918c258bac601
)
FetchContent_Declare(
json
GIT_REPOSITORY "https://github.com/nlohmann/json"
GIT_TAG a3e6e26dc83a726b292f5be0492fcc408663ce55
)
add_subdirectory(curlpp)
add_subdirectory(websocketpp)
add_subdirectory(argparse)
add_subdirectory(Boost)
add_subdirectory(json)

210
dependencies/Makefile vendored Normal file
View File

@ -0,0 +1,210 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.13
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /mnt/c/Users/Ilya/CLionProjects/untitled
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /mnt/c/Users/Ilya/CLionProjects/untitled
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast
# Special rule for the target package_source
package_source:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
cd /mnt/c/Users/Ilya/CLionProjects/untitled && /usr/bin/cpack --config ./CPackSourceConfig.cmake /mnt/c/Users/Ilya/CLionProjects/untitled/CPackSourceConfig.cmake
.PHONY : package_source
# Special rule for the target package_source
package_source/fast: package_source
.PHONY : package_source/fast
# Special rule for the target package
package: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
cd /mnt/c/Users/Ilya/CLionProjects/untitled && /usr/bin/cpack --config ./CPackConfig.cmake
.PHONY : package
# Special rule for the target package
package/fast: package
.PHONY : package/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\" \"dev\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# The main all target
all: cmake_check_build_system
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(CMAKE_COMMAND) -E cmake_progress_start /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles /mnt/c/Users/Ilya/CLionProjects/untitled/dependencies/CMakeFiles/progress.marks
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(MAKE) -f CMakeFiles/Makefile2 dependencies/all
$(CMAKE_COMMAND) -E cmake_progress_start /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(MAKE) -f CMakeFiles/Makefile2 dependencies/clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(MAKE) -f CMakeFiles/Makefile2 dependencies/preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(MAKE) -f CMakeFiles/Makefile2 dependencies/preinstall
.PHONY : preinstall/fast
# clear depends
depend:
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(CMAKE_COMMAND) -P /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles/VerifyGlobs.cmake
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... install/strip"
@echo "... install/local"
@echo "... package_source"
@echo "... package"
@echo "... install"
@echo "... edit_cache"
@echo "... rebuild_cache"
@echo "... list_install_components"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(CMAKE_COMMAND) -P /mnt/c/Users/Ilya/CLionProjects/untitled/CMakeFiles/VerifyGlobs.cmake
cd /mnt/c/Users/Ilya/CLionProjects/untitled && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

1
dependencies/argparse vendored Submodule

@ -0,0 +1 @@
Subproject commit 69605711566682a57c30861146b2a389c96255a0

1
dependencies/boost vendored Submodule

@ -0,0 +1 @@
Subproject commit 697913b88aa74e56d951bc3b9bfc0db6ec40071d

49
dependencies/cmake_install.cmake vendored Normal file
View File

@ -0,0 +1,49 @@
# Install script for directory: /mnt/c/Users/Ilya/CLionProjects/untitled/dependencies
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
include("/mnt/c/Users/Ilya/CLionProjects/untitled/dependencies/curlpp/cmake_install.cmake")
include("/mnt/c/Users/Ilya/CLionProjects/untitled/dependencies/websocketpp/cmake_install.cmake")
include("/mnt/c/Users/Ilya/CLionProjects/untitled/dependencies/argparse/cmake_install.cmake")
include("/mnt/c/Users/Ilya/CLionProjects/untitled/dependencies/Boost/cmake_install.cmake")
include("/mnt/c/Users/Ilya/CLionProjects/untitled/dependencies/json/cmake_install.cmake")
endif()

1
dependencies/curlpp vendored Submodule

@ -0,0 +1 @@
Subproject commit 6dde740658257103435ba86e5e92828112e5d2fc

1
dependencies/json vendored Submodule

@ -0,0 +1 @@
Subproject commit a3e6e26dc83a726b292f5be0492fcc408663ce55

1
dependencies/websocketpp vendored Submodule

@ -0,0 +1 @@
Subproject commit 1b11fd301531e6df35a6107c1e8665b1e77a2d8e

55
src/connection.cpp Executable file
View File

@ -0,0 +1,55 @@
//
// Created by Ilya on 16.10.2022.
//
#include "connection.h"
#include "string"
#include "iostream"
connection::connection(std::string session) {
this->session = session;
this->ws.init_asio();
auto handle = &connection::on_message;
this->ws.set_message_handler(websocketpp::lib::bind(
&connection::on_message,
this,
websocketpp::lib::placeholders::_1,
websocketpp::lib::placeholders::_2
));
this->ws.clear_access_channels(websocketpp::log::alevel::all);
this->ws.set_tls_init_handler(bind(&connection::on_tls_init, this, websocketpp::lib::placeholders::_1));
websocketpp::lib::error_code ec;
client::connection_ptr con = this->ws.get_connection("wss://api.redguy.ru/ws/logs/?accessToken=" + session, ec);
if (ec) {
std::cout << "could not create connection because: " << ec.message() << std::endl;
return;
}
this->ws.connect(con);
this->ws.run();
}
void connection::on_message(websocketpp::connection_hdl, client::message_ptr msg) {
nlohmann::json json = nlohmann::json::parse(msg->get_payload());
if (json["type"] == "event") {
if(json["name"] == "logWrite") {
std::cout << json["log"]["service"]["name"].get<std::string>() << ":" << json["log"]["category"].get<std::string>() << " | [" << json["log"]["created"].get<std::string>() << "] [" << json["log"]["level"].get<std::string>() << "] " << json["log"]["content"].get<std::string>() << std::endl;
}
}
}
context_ptr connection::on_tls_init(websocketpp::connection_hdl) {
context_ptr ctx = websocketpp::lib::make_shared<boost::asio::ssl::context>(boost::asio::ssl::context::tlsv12);
try {
ctx->set_options(boost::asio::ssl::context::default_workarounds |
boost::asio::ssl::context::no_sslv2 |
boost::asio::ssl::context::no_sslv3 |
boost::asio::ssl::context::single_dh_use);
ctx->set_verify_mode(boost::asio::ssl::verify_none);
} catch (std::exception &e) {
std::cout << e.what() << std::endl;
}
return ctx;
}

27
src/connection.h Executable file
View File

@ -0,0 +1,27 @@
//
// Created by Ilya on 16.10.2022.
//
#ifndef UNTITLED_CONNECTION_H
#define UNTITLED_CONNECTION_H
#include "string"
#include <websocketpp/client.hpp>
#include <websocketpp/config/asio_client.hpp>
#include <nlohmann/json.hpp>
typedef websocketpp::client<websocketpp::config::asio_tls_client> client;
typedef websocketpp::lib::shared_ptr<boost::asio::ssl::context> context_ptr;
class connection {
private:
std::string session;
client ws;
public:
explicit connection(std::string session);
void on_message(websocketpp::connection_hdl, client::message_ptr msg);
context_ptr on_tls_init(websocketpp::connection_hdl);
};
#endif //UNTITLED_CONNECTION_H

23
src/main.cpp Executable file
View File

@ -0,0 +1,23 @@
#include <iostream>
#include <argparse/argparse.hpp>
#include "connection.h"
int main(int argc, char** argv) {
argparse::ArgumentParser program("rg-api");
program.add_argument("--session")
.help("session from redguy.ru");
try {
program.parse_args(argc, argv);
}
catch (const std::runtime_error& err) {
std::cerr << err.what() << std::endl;
std::cerr << program;
std::exit(1);
}
auto session = program.get<std::string>("session");
connection con(session);
return 0;
}