6 releases (3 breaking)

0.6.3 Oct 25, 2024
0.6.2 Oct 25, 2024
0.6.1 Feb 11, 2024
0.5.0 Aug 29, 2022
0.0.0 Mar 31, 2021

#88 in HTTP server

Download history 3/week @ 2024-07-22 7/week @ 2024-07-29 11/week @ 2024-08-05 22/week @ 2024-08-26 2/week @ 2024-09-09 43/week @ 2024-09-23 7/week @ 2024-09-30 16/week @ 2024-10-14 212/week @ 2024-10-21 43/week @ 2024-10-28 19/week @ 2024-11-04

290 downloads per month
Used in 6 crates (5 directly)

Apache-2.0 and GPL-2.0-or-later

570KB
11K SLoC

crates.io version lines of code license CI status open issues dependency status commit activity

Kvarn

A forward-thinking fast web server designed to fit your needs, efficiently.

Kvarn is a rusty, open-source, extendable web application framework with native async everywhere; zero downtime; and safe & fast defaults.

Kvarn is batteries-included (optional defaults) with support for automatic HTTPS certificates, HTTP/3, io_uring everywhere, reverse proxying, auto HTTP/2 push, in-memory caching (proper cache invalidation), server communication provided by a simple CLI, and easy website creation through Markdown and Chute.

If you're looking for an executable to run your webserver with, see Mölla. Using Mölla, you can configure your host(s), add a search engine, authentication, and other parts of the Kvarn ecosystem. More info is available on the website.

See the changelog or visit our website for more info.

Current state

A stable API is available and the crate is on crates.io. You can view the latest documentation online.

When using Mölla, you get access to all of Kvarn's extensions and most of it's features. If you need to develop custom extension (like those on icelk.dev) you need to compile Kvarn yourself. Luckily, Mölla makes it easy to add custom extensions.

To use the latest and greatest you can add Kvarn as a git dependency, though the latest version is recommended:

[dependencies]
kvarn = { git = "https://github.com/Icelk/kvarn" }

Dependencies

To increase security, build-times, reliability, and speed, I use dependencies sparingly.

The two heavy-hitters are tokio (async runtime for async networking, file access, and extensions) and rustls (for encryption, optional if you want to run a unsafe (often local) web server). brotli and flate2 are enabled by default to provide compression, but can be turned off. h2 provides optional (but strongly preferred) support for the HTTP/2 protocol.

See kvarn.org for more details.

Pushing to production

Take a look at the sample.service for how to configure systemd to use kvarnctl to manage Kvarn.

You can now use systemctl --user reload kvarn or similar to reload the server if you've changed the config or recompiled (if that's your thing). This ensures (on Unix) NO downtime. Not even a millisecond.

Installation

Mölla is the recommended way to get started with Kvarn. You can download it and other Kvarn tools (kvarnctl & chute) for Linux and macOS at the Releases page.

For Kvarn chute downloads for Linux, go here and download the artefact from the topmost job.

kvarnctl is also available as CI builds.

Documentation

Documentation of the main branch can be found at doc.kvarn.org.

To document with information on which cargo features enables the code, set the environment variable RUSTDOCFLAGS to --cfg docsrs (e.g. in Fish set -x RUSTDOCFLAGS "--cfg docsrs") and then run cargo +nightly doc.

Changelog

See the changelog.

Contributing

This library, and all other sub-projects in this repository, are distributed under the Apache License 2.0. So must all contributions also be.

All rights are reserved for images and logos unless explicitly stated otherwise. You are free to use them if reasonable credit is given. I reserve the right to order you to remove any usage at will.

Dependencies

~9–24MB
~380K SLoC