From 123e6fafb19359474d2e1c115f64cdd3adf5a343 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 12 Apr 2025 20:10:52 +0100 Subject: [PATCH] core: add version --- CMakeLists.txt | 6 ++++++ VERSION | 1 + html/index.html | 2 +- html/index.min.html | 2 +- src/core/Handler.cpp | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/CMakeLists.txt b/CMakeLists.txt index 7391148..79a2513 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,15 @@ cmake_minimum_required(VERSION 3.19) +file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW) +string(STRIP ${VER_RAW} VER) + project( checkpoint DESCRIPTION "Tiny reverse proxy that attempts to block AI scrapers" + VERSION ${VER} ) +set(CHECKPOINT_VERSION ${VER}) set(PISTACHE_BUILD_TESTS OFF) set(PISTACHE_BUILD_FUZZ OFF) @@ -20,6 +25,7 @@ set(CMAKE_CXX_STANDARD 23) add_executable(checkpoint ${SRCFILES}) add_compile_options(-Wno-deprecated-declarations -Wno-deprecated) +add_compile_definitions(CHECKPOINT_VERSION="${CHECKPOINT_VERSION}") find_package(PkgConfig REQUIRED) diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6c6aa7c --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0 \ No newline at end of file diff --git a/html/index.html b/html/index.html index 315ce1c..a7a1f44 100644 --- a/html/index.html +++ b/html/index.html @@ -216,7 +216,7 @@

- Powered by checkpoint + Powered by checkpoint v{{ tl:text checkpointVersion }} diff --git a/html/index.min.html b/html/index.min.html index e229b78..7d2dd50 100644 --- a/html/index.min.html +++ b/html/index.min.html @@ -1,2 +1,2 @@ -STOP! - Checkpoint

🛑

STOP!


Verifying that you are not a bot. This might take a short moment.

You do not need to do anything.

Why am I seeing this?


This website protects itself from AI bots and scrapers by asking you to complete a cryptographic challenge before allowing you entry.

Difficulty {{ tl:text challengeDifficulty }}, elapsed 0ms, 0h, 0h/s

Powered by checkpoint
+STOP! - Checkpoint

🛑

STOP!


Verifying that you are not a bot. This might take a short moment.

You do not need to do anything.

Why am I seeing this?


This website protects itself from AI bots and scrapers by asking you to complete a cryptographic challenge before allowing you entry.

Difficulty {{ tl:text challengeDifficulty }}, elapsed 0ms, 0h, 0h/s

Powered by checkpoint v{{ tl:text checkpointVersion }}
\ No newline at end of file diff --git a/src/core/Handler.cpp b/src/core/Handler.cpp index 797a67e..b9408f9 100644 --- a/src/core/Handler.cpp +++ b/src/core/Handler.cpp @@ -234,6 +234,7 @@ void CServerHandler::serveStop(const Pistache::Http::Request& req, Pistache::Htt page.add("challengeDifficulty", CTinylatesProp(std::to_string(DIFFICULTY))); page.add("challengeNonce", CTinylatesProp(NONCE)); + page.add("checkpointVersion", CTinylatesProp(CHECKPOINT_VERSION)); response.send(Pistache::Http::Code::Ok, page.render().value_or("error")); }