added compression to crow

This commit is contained in:
2026-02-22 22:06:07 +01:00
parent f805804bc0
commit 990028808b
4 changed files with 17 additions and 7 deletions

View File

@@ -89,11 +89,15 @@ target_link_options(${TARGET_NAME} PRIVATE
target_compile_definitions(${TARGET_NAME} PRIVATE target_compile_definitions(${TARGET_NAME} PRIVATE
APPLICATION_NAME="${TARGET_NAME}" APPLICATION_NAME="${TARGET_NAME}"
SQLITE_THREADSAFE=1 SQLITE_THREADSAFE=1 # build sqlite with thread safty
ASIO_STANDALONE 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 # Optional: Print build type at configuration time
message(STATUS "Configuring build type: ${CMAKE_BUILD_TYPE}") message(STATUS "Configuring build type: ${CMAKE_BUILD_TYPE}")

View File

@@ -1,7 +1,7 @@
# Maintainer: Lukas Forsberg lukas96.forsberg@gmail.com # Maintainer: Lukas Forsberg lukas96.forsberg@gmail.com
pkgname=shadowrun-server pkgname=shadowrun-server
pkgver=0.1.2 pkgver=0.1.3
pkgrel=1 pkgrel=1
arch=('x86_64') arch=('x86_64')
depends=() depends=()
@@ -13,6 +13,7 @@ source=(
) )
install=shadowrun-server.install install=shadowrun-server.install
md5sums=('SKIP') # SKIP if local files md5sums=('SKIP') # SKIP if local files
depends=('zlib') # used for compression by crow
build() { build() {
cmake -S "${srcdir}" \ cmake -S "${srcdir}" \
-B build \ -B build \

View File

@@ -32,7 +32,7 @@ npm run build
1. tar the source files to make it cleaner 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 2. create the package
@@ -43,7 +43,7 @@ makepkg -f
3. place the package in archrepo on server 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. 4.

View File

@@ -6,6 +6,7 @@
#include "login.hpp" #include "login.hpp"
#include "ShadowrunApi.hpp" #include "ShadowrunApi.hpp"
#include "databasepool.h" #include "databasepool.h"
#include "crow/compression.h"
using namespace std; using namespace std;
@@ -74,5 +75,9 @@ int main() {
}); });
app.loglevel(crow::LogLevel::INFO); 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();
} }