Download


Size Date Name SHA256 Signature
985007 2018-07-09 kore-3.0.0.tar.gz kore-3.0.0.tar.gz.sha256 Minisign signature

Changelog for the 3.0.0 release


This is a major release due to API changes compared to the last official release.

Moved kore build tools into kodev

The development tools that came built-in with Kore have been split up into its own utility called kodev. This tool can be used to create, build and run Kore applications in an easy and straight forward manner.

Additional kodev will now automatically generate page handlers for static assets that can be used in the configuration to serve the static content. The handlers are called asset_serve_asset_name_ext and will automatically include an ETag for the content.

Filemap support

With the introduction of filemaps Kore is able to serve files from a specified directory like a normal webserver. This is useful in case you want to host a bunch of static files without precompiling them into Kore assets.

Filemapped URLs automatically get an last-modifier header attached to their responses and their media types are controllable via the Kore configuration http_media_type option.

Kore will not generate directory indexes and shares open file references across multiple requests.

Depending on the platform / build configuration either mmap()'d files or sendfile() is used to transfer the contents of the file to the client.

A filemap is configured inside of a domain context, for example mapping files under /git to /source/:

domain * {
	filemap /source/ /git
}

Changes to the memory system

Added tagged pointers, allowing an application to allocate a chunk of memory tied to an identifier so that upon module reload they can fetch the allocated pointer again.

Example, in your module init code:

cfg = kore_mem_lookup(SOME_ID_NUMBER));
if (cfg == NULL)
	cfg = kore_malloc_tagged(sizeof(*cfg), SOME_ID_NUMBER);

Python support

This version introduces support to write page handlers in pure Python if Kore was built with PYTHON=1. The python API tries to mimic most of the C API.

The Python code is directly executed inside of the Kore worker processes.

Example Python handler:

import kore

def myhandler(req):
	xrequest = req.request_header("x-request")
	if xrequest != None:
		req.response_header("x-response", xrequest)

	req.response(200, b'hello world)

Example Python asynchronous PostgreSQL handler:

import json
import kore

async def myquery(req):
	result = await req.pgsql("db", "SELECT * FROM pg_delay(10)")
	req.response(200, json.dumps(result).encode("utf-8"))

Other changes

  • - Added manual page for kodev.1
  • - Several TLS layer improvements
  • - Added support for PATCH method
  • - Support for OpenSSL 1.1.0 releases
  • - Use platform default compiler/linker for kodev
  • - Decoupled the pgsql layer from the HTTP layer
  • - Allow querystring params blocks even for POSTs
  • - Accesslogs are now in the Combined Log Format
  • - Allow workers to listen on different ports independently
  • - Let KORE_MSG_WORKER_ALL include the source worker
  • - Allow the keymgr to pull in additional entropy via a configured file
  • - Added configurable x509 verification depth for client certificates
  • - Added http_argument_get_float() and http_argument_get_double()
  • - Incoming HTTP requests are now zero-copy when being parsed into an http_request structure.
  • - While waiting for a response from the keymgr a worker process will now process queued http requests.
  • - Automatically rollback failed pgsql queries so we can reuse connections without them being in failed state.

API breakage vs last release

  • - The pgsql API has completely been reworked.
  • - kore_onload() has been renamed kore_worker_configure().
  • - kore_preload() has been renamed kore_parent_configure().
  • - http_request_header() its out parameter has been constified.
  • - http_populate_get() is deprecated, use http_populate_qs() instead
  • - struct http_request its path, host and agent member have been constified.

Many thanks to everybody who contributed to this release.