Joris Vink
ac6fcf8981
deal with sendfile() in newer linux kernels.
2018-07-09 10:00:38 +00:00
Joris Vink
570f9ac986
move optimzations back to -O2, not -O3.
2018-07-09 09:45:10 +02:00
Joris Vink
bc1206c4fc
better README now that we're moving from GH
2018-07-09 09:10:57 +02:00
Joris Vink
93c94eb9c1
add minisign public key
2018-07-09 07:42:18 +02:00
Joris Vink
e665cc900d
redirect to /uri/ if need be.
2018-07-09 06:28:28 +02:00
Joris Vink
04f4306cf2
simplify logic
2018-07-08 15:58:56 +00:00
Joris Vink
04deeeafb9
make sure we can still resolve new paths
2018-07-08 15:57:00 +00:00
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
10cf14f756
use realpath() to resolve ondisk paths.
2018-07-08 17:40:16 +02:00
Joris Vink
3ddcaf4661
typo
2018-07-07 13:34:58 +02:00
Joris Vink
71659ab197
correct includes
2018-07-07 13:23:43 +02:00
Joris Vink
f02f88295c
revert b5e122 for now.
2018-07-06 11:21:46 +02:00
Joris Vink
4f16a5d272
make net_read() and net_write() more sane.
2018-07-05 12:36:47 +00:00
Joris Vink
47c1a1d195
set referer to NULL in http_request_new().
2018-07-05 05:02:49 +00:00
Joris Vink
3e4b9f4fe8
let filemaps be matched to the domains.
2018-07-04 14:26:38 +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
b5e122419b
Let http_populate_post() listen to content-type
2018-07-03 08:25:06 +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
72073701b0
Add last-modified and if-modified-since for filemaps.
2018-06-29 09:56:04 +02:00
Joris Vink
cca269ff5d
make sure we use fd_off in linux sendfile properly
2018-06-29 03:10:28 +00:00
Joris Vink
3e5939a8e3
make sure fileref is dropped if softremoved
2018-06-29 05:03:50 +02:00
Joris Vink
09b362ced4
remove norwegian debugging
2018-06-28 23:02:46 +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
521ff6a11d
catch more bad ranges in http_argument_urldecode()
2018-06-28 15:39:03 +02:00
Joris Vink
2139527df7
run path via http_argument_urldecode().
2018-06-28 15:28:25 +02:00
Joris Vink
70e945afb7
limit http_argument_urldecode() to sane characters
2018-06-28 15:27:55 +02:00
Joris Vink
c2f66af937
better error log message
2018-06-28 14:53:43 +02:00
Joris Vink
3faf89d83d
use server time.
2018-06-28 14:52:49 +02:00
Joris Vink
afd76ff55d
Change accesslog format to Combined Log Format.
2018-06-28 14:25:32 +02:00
Joris Vink
f2c87fd130
limit filemaps to HEAD/GET requests.
2018-06-28 14:24:02 +02:00
Joris Vink
d876e41ebb
shuffle headers around
2018-06-28 13:45:04 +02:00
Joris Vink
48955dcb13
fix order of arguments to filemap
2018-06-28 13:35:09 +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
9be72aff57
bump size of http_version array.
2018-06-23 17:23:45 +02:00
Joris Vink
fc58007cc1
remove lingering character
2018-06-22 23:02:57 +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
d5ca2b42c6
invoke platform specific compiler for kodev build.
2018-06-19 22:46:55 +02:00
Joris Vink
7b20192e02
install kodev manual page.
2018-06-19 22:40:55 +02:00
Joris Vink
b147ce4d25
2018
2018-06-19 15:07:28 +02:00
Joris Vink
46182608c6
most of the existing docs are updated.
2018-06-19 12:03:10 +02:00
Joris Vink
296b1693ac
don't forward argc/argv for kodev create.
...
Means we don't have to do weird shit that doesn't work on !macos anyway.
2018-06-15 20:51:48 +02:00
Joris Vink
c257299fa4
add shorthand for building with fsanitize.
2018-06-12 19:43:10 +02:00
Joris Vink
8802ad5f40
mention that 2.x is outdated.
2018-06-09 20:08:39 +02:00
Joris Vink
21b1d5a905
be honest with documentation.
2018-06-09 12:58:23 +02:00
Joris Vink
929e54e880
add client_verify_depth to example config.
2018-06-09 12:55:09 +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
3dfad1b7d6
remove unneeded include.
2018-05-04 15:56:56 +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