diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ed7e30..3410f1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,11 +89,15 @@ target_link_options(${TARGET_NAME} PRIVATE target_compile_definitions(${TARGET_NAME} PRIVATE APPLICATION_NAME="${TARGET_NAME}" - SQLITE_THREADSAFE=1 - ASIO_STANDALONE + SQLITE_THREADSAFE=1 # build sqlite with thread safty + ASIO_STANDALONE # use asio without boost + CROW_ENABLE_COMPRESSION # enable compression part of crow ) -target_link_libraries(${TARGET_NAME} pthread) +target_link_libraries(${TARGET_NAME} + pthread + z # zlib, used by crow for compression +) # Optional: Print build type at configuration time message(STATUS "Configuring build type: ${CMAKE_BUILD_TYPE}") \ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD index 125a05e..b66d3a4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Lukas Forsberg lukas96.forsberg@gmail.com pkgname=shadowrun-server -pkgver=0.1.2 +pkgver=0.1.3 pkgrel=1 arch=('x86_64') depends=() @@ -13,6 +13,7 @@ source=( ) install=shadowrun-server.install md5sums=('SKIP') # SKIP if local files +depends=('zlib') # used for compression by crow build() { cmake -S "${srcdir}" \ -B build \ diff --git a/README.md b/README.md index 9fbd196..6a415d0 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ npm run build 1. tar the source files to make it cleaner ``` -tar czf shadowrun-server-0.1.2.tar.gz source/ modules/ assets/ frontend/build/ shadowrun-server.service CMakeLists.txt shadowrun-server.install +tar czf shadowrun-server-0.1.3.tar.gz source/ modules/ assets/ frontend/build/ shadowrun-server.service CMakeLists.txt shadowrun-server.install ``` 2. create the package @@ -43,7 +43,7 @@ makepkg -f 3. place the package in archrepo on server ``` -scp shadowrun-server-0.1.2-1-x86_64.pkg.tar.zst lukas@192.168.1.101:/home/lukas/Drive/archrepo/x86_64/ +scp shadowrun-server-0.1.3-1-x86_64.pkg.tar.zst lukas@192.168.1.101:/home/lukas/Drive/archrepo/x86_64/ ``` 4. diff --git a/source/main.cpp b/source/main.cpp index 8b0d968..e1b69c4 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -6,6 +6,7 @@ #include "login.hpp" #include "ShadowrunApi.hpp" #include "databasepool.h" +#include "crow/compression.h" using namespace std; @@ -74,5 +75,9 @@ int main() { }); app.loglevel(crow::LogLevel::INFO); - app.bindaddr("0.0.0.0").port(settings.http_port).multithreaded().run(); + app.bindaddr("0.0.0.0") + .port(settings.http_port) + .use_compression(crow::compression::algorithm::GZIP) + .multithreaded() + .run(); }