Commit Graph

16 Commits

Author SHA1 Message Date
Joris Vink 5eb2160269 resolve filemap paths after workers chrooted.
otherwise the paths inside chrooted workers are incorrect.
2018-07-08 17:51:35 +02:00
Joris Vink 04077c66b6 Add filemap_ext configuration option.
Allows you to specify the default extensions used for a file served
via a filemap, eg:
	filemap_ext	.html

Gives us ability to provide clean urls.
2018-07-03 19:58:43 +02:00
Joris Vink 4a8d8ab7f8 log referer in accesslog if present. 2018-06-29 22:37:48 +02:00
Joris Vink 6dca7d51e6 update prototype for kore_date_to_time() 2018-06-29 09:56:38 +02:00
Joris Vink 3e5939a8e3 make sure fileref is dropped if softremoved 2018-06-29 05:03:50 +02:00
Joris Vink 202234cf97 filemap and fileref improvements.
- make sure we can serve updated files even if we have an old
  fileref around.

- add filemap_index as a configuration option: allows one to specify
  what file to serve if a directory was requested (eg: index.html)
2018-06-28 23:00:42 +02:00
Joris Vink 80f5425698 Add filemaps.
A filemap is a way of telling Kore to serve files from a directory
much like a traditional webserver can do.

Kore filemaps only handles files. Kore does not generate directory
indexes or deal with non-regular files.

The way files are sent to a client differs a bit per platform and
build options:

default:
  - mmap() backed file transfer due to TLS.

NOTLS=1
  - sendfile() under FreeBSD, macOS and Linux.
  - mmap() backed file for OpenBSD.

The opened file descriptors/mmap'd regions are cached and reused when
appropriate. If a file is no longer in use it will be closed and evicted
from the cache after 30 seconds.

New API's are available allowing developers to use these facilities via:
  void net_send_fileref(struct connection *, struct kore_fileref *);
  void http_response_fileref(struct http_request *, struct kore_fileref *);

Kore will attempt to match media types based on file extensions. A few
default types are built-in. Others can be added via the new "http_media_type"
configuration directive.
2018-06-28 13:27:44 +02:00
Joris Vink 8aaf7aaf79 Alter where the version number comes from.
Now if we are a git repo we fetch the branch name and
commitid to build the version string. If there is no
git repo we'll look at the RELEASE file.
2018-06-22 14:24:42 +02:00
Joris Vink e475bd0c92 Add configurable x509 chain validation depth.
You can now per domain configure the depth for x509 chain validation:
	client_verify_depth	1

By default this is 1.

While here change around some log messages and properly set
the callback for x509 verification rather then via hoops and loops.
2018-06-09 12:50:50 +02:00
Joris Vink 9e12b2c6dd Use sigaction() for signals.
Don't duplicate signal setup code between parent and worker processes.
2018-05-25 20:49:02 +02:00
Joris Vink 439a3b36f0 Add kore_strtodouble().
Use it for http_argument_get_float() and http_argument_get_double().
2018-05-04 15:55:35 +02:00
Sebastiaan a3cab0d97b Websocket memory leak fix when using kore_websocket_send() to send data. (#238) 2018-04-13 07:40:37 +02:00
Joris Vink 65666942e6 we're still in dev, not rc. 2018-04-09 14:23:55 +02:00
Joris Vink a33ce78a19 it's time. 2018-04-09 14:14:00 +02:00
Joris Vink 9c337ded1e Change kore_parent_configure() for single binaries.
This function now takes any remaining arguments passed on the command line
after kore parsed its own.

For C the new prototype looks like this:

void kore_parent_configure(int argc, char **argv);

For python code, kore will pass each argument to the function so you
can do things like:

def kore_parent_configure(arg1, arg2):
2018-04-09 12:51:20 +02:00
Joris Vink e6833a4892 Move header files to include/kore.
Mimics how the header files are installed on a system
as PREFIX/include/kore.

This is required for getting kodev to use the headers from the
kore_source option instead of requiring the kore headers to be
installed on the system even when building as a single_binary.
2018-03-30 13:45:29 +02:00