Skip to content

Releases: fomadev/lith

v1.0.9 - Hybrid RAM Cache Subsystem & Core Refactoring

Choose a tag to compare

@github-actions github-actions released this 09 Jul 22:45

What's New in v1.0.9

This release introduces an enterprise-grade hybrid optimization layer to LITH's core engine, allowing smooth transitioning between high-performance production workloads and agile local design environments.

Key Enhancements

  • Hybrid RAM Cache Architecture (USE_CACHE):
    Introduced a configurable dual-mode cache strategy managed natively via lith.conf.
    • Development Mode (USE_CACHE=0): Completely bypasses the static memory cache. Every inbound request forces a fresh, synchronized read from disk (Disk Fallback), eliminating the need to restart the engine while editing HTML/CSS assets.
    • Production Mode (USE_CACHE=1): Leverages lightning-fast in-memory processing (RAM Cache hit).
  • Thread-Safe Hot-Reload Engine:
    Armed workers with POSIX stat() file-system verification routines. When running in Production Mode, LITH safely monitors file timestamps (st_mtime). If an asset is updated on disk, it temporarily relinquishes the reader lock to acquire an exclusive writer lock (pthread_rwlock_wrlock) to perform an atomic, hot memory-swap without interrupting client traffic.
  • Global Configuration Sharing (global_config):
    Refactored the application bootstrap pattern in src/main.c to securely expose memory-isolated properties to deep worker routines within src/http_router.c, removing structural overhead and preventing local state drift.

Bug Fixes & Code Cleanup

  • Header Collisions Resolved: Rectified standard cross-platform encapsulation layers in src/main.c by ensuring appropriate server_utils.h inclusions for both POSIX and Winsock environments.
  • Syntax Scrubber: Eliminated dead variable iterations (bytes_processed) and invalid library inclusions (<stdio;h>) inside the HTTP routing framework that prevented successful GCC/MinGW builds.

Updated lith.conf Schema

To control the new capabilities, add the following parameters to your configuration:

# Cache strategy configuration (v1.0.9)
# 0 = DISABLED (Development Mode: Instant disk read on every request)
# 1 = ENABLED  (Production Mode: High-speed RAM caching with automated Hot-Reload)
USE_CACHE=0

Contributors

@fordimalanda

v1.0.8 - Native Linux Daemon Mode & Robust DX Pipeline

Choose a tag to compare

@github-actions github-actions released this 08 Jul 23:16

Overview

LITH v1.0.8 delivers true production-grade deployment capabilities by introducing a Native Linux Daemon Mode #8 alongside an architectural cleanup of the bootstrap pipeline. This update allows the engine to run completely detached in the background for permanent monitoring environments while refining developer experience (DX) tooling across dual Windows/UNIX workflows.


Key Technical Enhancements

1. Dual-Fork POSIX Daemonization

  • Terminal Disconnection: Implements a strict dual-fork() sequence under Linux. The parent process safely terminates to hand control back to the shell, while the final child detaches completely from the session controller via setsid().
  • System Isolation: Configures automated file creation mask resets (umask(0)) and safely migrates the operational directory to the system root partition (chdir("/")) to prevent storage volume locking.
  • Continuous I/O Journaling: Fully closes standard descriptors (stdin, stdout, stderr) and cleanly re-routes output streams into a localized append-only lith.log engine log.

2. Cross-Platform Fallback & Safety

  • Windows Portability Guard: Adds compile-time platform validation (#ifdef _WIN32). When the --daemon or -d flag is invoked under Windows, the CLI catches the argument, reports a warning profile to the user, and smoothly falls back to foreground mode.
  • Decoupled Architecture: Migrated the main bootstrap runtime and CLI argument parser entirely out of the network stack file into a dedicated src/main.c pipeline, eliminating symbol conflicts and duplicate entry points.

3. Bulletproof GNU Make Infrastructure

  • Shell-Agnostic Actions: Refactored the clean directive in the Makefile to use a dual-pass backslash and forward-slash sweep (rm -f). This guarantees successful workspace wiping across native Linux containers and partial POSIX environments like w64devkit.
  • Prototype Linking Visibility: Centralized structural includes to ensure load_config() definitions remain explicitly visible across early translation units.

Technical Specifications (v1.0.8)

  • Engine Version: 1.0.8
  • Background Logger: lith.log (stdout/stderr redirection)
  • Permanent Pool Capacity: 8 Threads
  • Network I/O Block Buffer: 4096 bytes
  • Anti-Slowloris Network Window: 3 seconds (SO_RCVTIMEO)

Licensing Terms

This release is distributed under the FomaDev Public License (FPL). Personal, academic, and internal architectural evaluations are permitted without fee. Standalone commercial redistribution, proprietary platform embedding, or independent commercial forks require explicit written authorization.

v1.0.7 - Architectural Thread Pool & Explicit CLI Routing

Choose a tag to compare

@github-actions github-actions released this 08 Jul 14:12
737c2a0

Overview

LITH v1.0.7 introduces a major architectural shift from a thread-per-connection model to a high-performance, resource-bounded Architectural Thread Pool. This upgrade eliminates runtime thread creation/destruction latency, provides strict stability under heavy multi-threaded stress, and transitions the engine to an explicit CLI routing command layout.


Key Technical Enhancements

1. Architectural Thread Pool Implementation

  • Worker Synchronization: Instantiates 8 permanent, isolated worker threads at boot time using an inner FIFO task queue guarded by POSIX condition variables (pthread_cond_t) and mutexes (pthread_mutex_t).
  • Zero-Allocation Request Loop: Sockets are cleanly handed over to the permanent pool, allowing the core listener thread to immediately accept subsequent connections without blocking.
  • Race-Condition Immunity: Removed all relying static global variables. Critical server states (like the web asset root directory) are now localized within the thread pool configuration context.

2. Explicit CLI Routing Command Design

  • Command Path Mapping: The engine now enforces an explicit action schema. The server must be invoked using the start command keyword (lith start [port]).
  • Graceful Fault Interception: Striking the binary without arguments or with improper parameters cleanly prints standard execution layout sheets to stderr and exits safely without panics.

3. Industrial-Grade CI Validation Suite

  • Automated Stress Canvas: Implemented a comprehensive automated test matrix (test-suite.yml) executing 7 sequential infrastructure validations (HTTP Keep-Alive persistence, Directory Traversal resistance, ApacheBench multi-thread concurrency, and Anti-Slowloris timeout protections).
  • Asynchronous Isolation: Refactored the test runner to use background shell process execution and strict sub-shell input streams, mitigating socket hang-ups under severe network loads.

Technical Specifications (v1.0.7)

  • Engine Version: 1.0.7
  • Permanent Pool Capacity: 8 Threads
  • Network I/O Block Buffer: 4096 bytes (BUFFER_SIZE)
  • Worker Stack Allocation Boundary: 16 KB
  • Anti-Slowloris Network Window: 3 seconds (SO_RCVTIMEO)
  • Maximum Keep-Alive Request Recycle Cap: 100 transactions

Contributors

@fordimalanda

v1.0.6 - High-Performance HTTP Keep-Alive Integration

Choose a tag to compare

@github-actions github-actions released this 30 Jun 19:24

Overview

LITH v1.0.6 introduces native support for HTTP Keep-Alive (persistent TCP connections) and switches the protocol parser to a fully case-insensitive validation engine. This release dramatically optimizes network performance, eliminating TCP handshake overhead for consecutive resource transfers, and improves compatibility with modern web browsers and automated clients.

In addition, the entire automated build infrastructure has been universalized to support seamless compilation under hybrid environments like w64devkit, Git Bash, and standard Linux CI pipelines.


What's New in v1.0.6

Core Networking & Protocol Enhancements

  • Persistent Connections (Keep-Alive): Embedded an active network loop inside server_worker.c to keep client sockets recycled and active for up to 100 consecutive requests within a strict 3-second timeout window (SO_RCVTIMEO).
  • Case-Insensitive Parsing Subsystem: Integrated <strings.h> and strncasecmp to handle variations in header values (close, Close, CLOSE, keep-alive). Both Content-Length and Connection headers are now immune to client casing idiosyncrasies.
  • Enhanced Timeout Semantics: Differentiated client timeouts between initial connection stalls (yielding an explicit 408 Request Timeout) and natural Keep-Alive session closures.

Architecture & Build Pipeline Improvements

  • Universal POSIX Infrastructure: Refactored the Makefile and directory creation flags (mkdir -p) to enforce a single, silent, and agnostic compilation pipeline across Windows, macOS, and Linux.
  • Repository Cleanup: Optimized project tracking by excluding GCC automated dependency tree tracking artifacts (*.d) from the index via centralized .gitignore rules.

Architectural Breakdown

The server modules have reached full maturity and separation of concerns:

  1. src/server.c: Dedicated low-level TCP connection listening and socket initialization.
  2. src/server_worker.c: Persistent thread pool workers driving the Keep-Alive network loop.
  3. src/http_parser.c: Case-insensitive protocol and MIME state machine.
  4. src/http_router.c: Sandboxed static asset rendering and API routing dispatcher.

Technical Specifications

  • Version: 1.0.6
  • Socket Block Size: 4096 bytes
  • Max Cumulative Buffer: 16 KB
  • Session Lifecycle: max=100 requests or timeout=3s
  • External Dependencies: Zero (Pure Standard C11 / POSIX Threads)

Contributors

@fordimalanda


Distributed under the terms of the FomaDev Public License (FPL).

v1.0.5 — Core Modularity & HTTP POST Engine

Choose a tag to compare

@github-actions github-actions released this 30 Jun 15:02

Overview

LITH v1.0.5 marks a significant structural evolution, transitioning from a static file distributor to an interactive application server layer. This release introduces native network stream aspiration for the HTTP POST method alongside a completely overhauled modular codebase architecture.

Architectural Changes & Updates

HTTP POST Protocol Engine

  • Implemented sequential network chunk ingestion triggered by Content-Length header validation to ensure fragmented or large payloads are fully buffered before processing.
  • Introduced an optimized zero-copy body_start context pointer directly referencing the active network buffer, neutralizing duplicate string allocation hazards.
image

Modular Internal Restructuring

  • Isolated structural sub-routines into a dedicated module architecture under src/server/.
  • Consolidated configuration parsing routines into src/server/config.c and system-agnostic file operations into src/server/utils.c.
  • Refined the primary network lifecycle engine (src/server.c) to maintain a lean, highly legible execution path.

Build Portability & CI/CD Pipelines

  • Hardened the Makefile compilation logic with cross-platform explicit artifact scrubbing (rm -f) covering both POSIX and Windows (.exe) extensions.
  • Standardized the production distribution package structure (bin/, public/, lith.conf) inside automated build matrices (release.yml and build.yml) to seamlessly support downstream system PATH integration.

Technical Specifications

  • Core Standard: ISO C11
  • Concurrency: Native POSIX Threads (pthreads)
  • Network Stack: Multi-Platform Socket Abstraction (Winsock2 / POSIX Sockets)
  • Maximum Temporary Parsing Buffer: 16 KB

Contributors

@fordimalanda


Distributed by the FomaDev Maintenance Team under the FomaDev Public License (FPL).

v1.0.4 - External Configuration Engine & Winsock Optimization

Choose a tag to compare

@github-actions github-actions released this 30 Jun 12:12

Overview

LITH version 1.0.4 introduces a highly requested structural improvement: an External Configuration Engine. This release decouples runtime environment variables from the compiled binary execution layer, allowing seamless modifications to network interfaces and root sandboxes without requiring code recompilation.

Additionally, this milestone optimizes low-level platform socket flags, eliminating platform-specific initialization noise on Windows architectures.


What's Changed

Core Enhancements

  • Dynamic Configuration Parser (lith.conf): Added a native, lightweight flat-file parsing engine that reads PORT and PUBLIC_DIR parameters at boot time. Supports custom line trims, blank lines, and shell-style comments (#).
  • Runtime Parameter Surcharge: Maintained historical operational compatibility by allowing instant CLI argument overrides (bin/lith <port>), prioritizing active human intents over state metadata.

Security & Windows Architecture Fixes

  • Strict Winsock Abstraction Isolation: Refactored compile-time #ifdef _WIN32 conditional bindings inside src/server.c.
  • Parasitic Warning Elimination: Fixed a logical collision where Windows evaluated conflicting socket flags. SO_EXCLUSIVEADDRUSE is now enforced strictly on Windows suites to block port-jacking vectors, while standard POSIX SO_REUSEADDR is isolated exclusively to Linux and macOS lifecycles, removing the [WARN] Failed to set SO_REUSEADDR log artifact.
  • Thread-Safe Context Sandboxing: Upgraded internal lifecycle data routines to map an isolated memory footprint (ExpandedClientContext) to worker threads, mitigating data race conditions if configuration maps change dynamically.

Contriutors

@fordimalanda

v1.0.3 - Comprehensive HTTP Error Layouts

Choose a tag to compare

@fordimalanda fordimalanda released this 29 Jun 21:26

Overview

This minor release upgrades LITH's core client handler to replace plain text responses with dynamic, unified HTML error templates for common edge cases (400 Bad Request, 403 Forbidden, 404 Not Found, and 500 Internal Server Error).

Technical Changes

  • Centralized Template Engine: Added get_error_html() within src/http_parser.c implementing an ultra-lightweight dark-themed responsive canvas for professional error rendering.
  • Granular Validation Interception: Enhanced parsing checks inside lith_client_handler to isolate malformed HTTP payloads early and route them to 400 Bad Request state responses.
  • Refined Status Distribution: Synchronized directory traversal filters and missing filesystem assets to push structured 403 and 404 HTML packages with mathematically accurate Content-Length structures.
  • Stream Exception Isolation: Implemented 500 Internal Server Error recovery routines when unexpected conditions trigger structural stream drops during network read isolates (recv <= 0).

Contributors

@fordimalanda

v1.0.2 - Dynamic MIME Type Management

Choose a tag to compare

@fordimalanda fordimalanda released this 29 Jun 17:57

Overview

This minor release introduces dynamic MIME type detection based on file extensions. LITH now properly instructs web browsers on how to interpret and render non-HTML assets (such as CSS, JavaScript, and Images), paving the way for rich, multi-resource static web applications.

Technical Changes

  • MIME Dictionary Lookup: Declared get_mime_type() routine within include/http_parser.h and implemented it in src/http_parser.c to map standard extensions (.html, .css, .js, .png, .jpg, .ico, .json, etc.).
  • Fallback Content Type: Unmapped or extensionless files gracefully fall back to application/octet-stream security standards.
  • Dynamic Header Injection: Refactored the response delivery sub-routine in src/server.c to compute and stream the exact matching Content-Type header payload dynamically.
  • Buffer Security: Increased the HTTP response header buffer size to 384 bytes to eliminate any potential string overflow risks during format operations.

Contributors

@fordimalanda

v1.0.1.1 - Port Collision Fix

Choose a tag to compare

@fordimalanda fordimalanda released this 29 Jun 16:38

Overview

This patch release resolves a critical cross-platform issue where secondary instances of the server could start silently on an already occupied port. The server now guarantees strict port availability validation during initialization.

Technical Changes

  • Windows Socket Security: Implemented SO_EXCLUSIVEADDRUSE on Windows to prevent permissive instance overlay and port hijacking.
  • POSIX Alignment: Kept the non-permissive standard behavior of SO_REUSEADDR for Linux and macOS environments.
  • Strict Error Handling: Modified src/main.c to gracefully capture binding failures, print an explicit console message, and immediately terminate the process with a non-zero exit code (exit 1).
  • Resource Cleanup: Relocated WSACleanup() into the SIGINT signal handler to ensure proper network library deallocation upon manual shutdown via Ctrl+C.

Issue Tracking

  • Closes #1

Contributors

@fordimalanda

v1.0.1 - Security Update

Choose a tag to compare

@fordimalanda fordimalanda released this 24 May 23:07

Overview

LITH version 1.0.1 is a critical security update focused on path validation and infrastructure stability. This release addresses potential security vulnerabilities regarding arbitrary local file exposure and introduces a robust automated cross-platform distribution pipeline.

Architectural Changes

1. Security Hardening (Directory Traversal Fix)

  • Implemented a canonical path safety check routine (is_safe_path) inside the core server handling engine.
  • Explicitly blocks and intercepts incoming raw HTTP payloads containing relative path sequencing components (..).
  • Configured the server to immediately drop invalid descriptors and dispatch a standalone 403 Forbidden response instead of exposing system boundaries.

2. CI/CD Compilation Pipeline

  • Created a localized Multi-Platform GitHub Actions Matrix build configuration.
  • Configured automated target compilation routines for native Linux, Windows (via unified MSYS2 toolchains), and macOS setups.
  • Consolidated automated operational build deployments into specific independent distribution packages (.zip and .tar.gz) containing clean standalone binary executions.

Verifying the Update

To confirm the security fix is operational on a running instance, execute a path traversal probe with path normalization disabled:

curl --path-as-is http://localhost:8080/../../etc/passwd

Expected Server Response: 403 Forbidden

Contributors

@fordimalanda