1898 Commits

Author SHA1 Message Date
Frederic Cambus
af99a4d9e2 Conditionally allow syscalls required to run on arm.
Those syscalls do not exist on other Kore supported platforms, so we
must check that they exist before allowing them.
2020-09-17 17:41:03 +02:00
Frederic Cambus
28ea1b3c7e Add missing tests for SYS_mmap, fixes the build on arm. 2020-09-17 17:41:00 +02:00
Frederic Cambus
7290944bf3 Add support for logging seccomp violations on arm.
On ARM EABI, the syscall number can be read from register r7.
2020-09-16 23:07:45 +02:00
Frederic Cambus
9deb2e71bf Use kore_worker_name() when logging worker exits in worker_reaper(). 2020-09-15 12:19:08 +02:00
Frederic Cambus
debe6cb019 Mention the seccomp_tracing configuration option. 2020-09-14 23:21:21 +02:00
Frederic Cambus
60bc618c3f Allow the clock_nanosleep syscall, it is required for kore_accesslog().
glibc 2.31 calls clock_nanosleep in its nanosleep function.
2020-09-14 19:15:25 +02:00
Frederic Cambus
19573a7bf0 Also add DESTDIR in the uninstall targets in kore and kodev Makefiles. 2020-09-14 14:07:31 +02:00
Joris Vink
a62c504a40 Set KORE_SOURCE for tools-build target. 2020-09-09 22:35:19 +02:00
Joris Vink
e87ba0f2d8 Add flavors for kore-serve for all platforms. 2020-09-09 22:31:46 +02:00
Joris Vink
51e9c64fc0 strdup the application name. 2020-09-09 22:30:56 +02:00
Joris Vink
cdb45118e2 kill unused variable 2020-09-09 22:22:54 +02:00
Joris Vink
814a994e99 Don't depend on pushd/popd 2020-09-09 22:18:59 +02:00
Joris Vink
21d1e5156b Add tools directory.
Includes the kore-serve utility that spins up a Kore instance
on the local directory and serves the contents via a filemap
on localhost port 8888.

Used by myself when hacking on the kore website.
2020-09-09 22:14:29 +02:00
Joris Vink
4e384167f0 The version.c file has moved.
Therefor make sure kodev knows the correct place to look for it
and include it in single binary builds.
2020-09-09 21:27:07 +02:00
Joris Vink
2dca8fd6cc Add an install-sources target.
This will place the required sources for building
single binary builds under $PREFIX/share/kore.

The kodev utility will now pickup this KORE_SOURCE path automatically
unless another one is given via the conf/build.conf file or the KORE_SOURCE
environment path.
2020-09-09 21:09:40 +02:00
Joris Vink
d7dd9707d7 Remove getopt() for KORE_SINGLE_BINARY.
If KORE_SINGLE_BINARY is enabled, remove the getopt() call that
Kore does itself. This way all arguments are passed to the
kore_parent_configure() hook as-is allowing developers to
more easily implement their own option handling.
2020-09-08 22:38:06 +02:00
Frederic Cambus
3bf5896cfb Add DESTDIR support in both kore and kodev Makefiles. 2020-09-08 21:28:58 +02:00
Joris Vink
f6af4a27f4 Enable type-limits warning.
Remove unneeded comparison in the JSON code.
via https://marc.info/?l=openbsd-ports&m=159958572325174&w=2
2020-09-08 19:29:15 +02:00
Joris Vink
aaf8be40c2 Add casts for isxdigit and isspace.
The argument must be representable as an unsigned char or EOF.
2020-09-08 19:19:56 +02:00
Joris Vink
4498270bbe add missing contributer. 2020-09-08 19:13:31 +02:00
Joris Vink
5a3e174439 Add the BEERS file. 2020-09-08 19:12:00 +02:00
Frederic Cambus
3ac956c67d Use kore_worker_name() when logging worker shutdowns. 2020-09-08 15:15:33 +02:00
Frederic Cambus
d9673857d8 Fix a couple of typos in various places. 2020-09-08 13:01:18 +02:00
Joris Vink
636469f555 Only reset accept_avail if we grabbed the lock.
Otherwise in certain scenarios it could mean that workers
unsuccessfully grabbed the lock, reset accept_avail and
no longer attempt to grab the lock afterwards.

This can cause a complete stall in workers processing requests.
2020-09-08 11:51:06 +02:00
Joris Vink
1d27558e39 nicer warning 2020-09-03 19:24:26 +02:00
Joris Vink
b84c88a0e6 remove the yet wording. 2020-09-03 19:08:08 +02:00
Joris Vink
58247eec4a I don't support x86 on Linux, remove it.
Pointed out by entitled end user.
2020-09-03 19:05:43 +02:00
Tobias Kortkamp
85b26533b7 Unbreak build with multiple make jobs
Without it python_curlopt.h might not be available at the right
time when using something like make -j4:

src/python.c:50:10: fatal error: 'python_curlopt.h' file not found
         ^~~~~~~~~~~~~~~~~~
1 error generated.

Signed-off-by: Tobias Kortkamp <t@tobik.me>
2020-09-03 14:07:41 +02:00
Joris Vink
45f5ec97a2 we are at 4.0.0 2020-08-31 19:59:31 +02:00
Joris Vink
8097d22da7 whitespace fixes 2020-08-24 10:17:53 +02:00
Joris Vink
4aa53df3b6 Make sure curl state transitions work properly. 2020-08-17 16:45:10 +02:00
Joris Vink
8b9f7a6c12 improve our asynchronous curl support.
- Remove the edge trigger io hacks we had in place.
- Use level triggered io for the libcurl fds instead.
- Batch all curl events together and process them at the end
  of our worker event loop.
2020-08-17 15:15:04 +02:00
Joris Vink
eaef4b654a Only call PyMem_SetupDebugHooks() if DEBUG is 1.
We do not need the memory debug hooks in production environments.
2020-08-13 09:10:19 +02:00
Joris Vink
d2617fdf32 Do not let DEBUG imply NOOPT any longer. 2020-08-13 09:10:00 +02:00
Joris Vink
6b3347ae3a coro_running could be NULL, check it. 2020-08-12 13:43:38 +02:00
Joris Vink
7613a4a135 Python: Improve the kore.socket interface.
- Make sure PyBuffer_Release() is called for y* arguments.
- Make sure buffer is cleaned up for SENDTO socket ops as well.
2020-08-11 15:24:59 +02:00
Joris Vink
68d078766e Clear lockop before removing a reference from the coroutine. 2020-08-10 12:19:42 +02:00
Joris Vink
08d66e3926 set a worker its running flag to 0 if it dies. 2020-08-10 09:33:34 +02:00
Joris Vink
0b659807bf more missing syscalls on aarch64 2020-07-14 15:47:58 +02:00
Joris Vink
0268a0ae0a Wrap certain syscalls inside of an ifdef.
Makes kore with python and acme work on my pinebook pro.
2020-07-14 15:38:54 +02:00
Joris Vink
bb2f0d8b52 Python: improve kore.lock when handling cancelled coroutines.
If a coroutine is killed from another coroutine and the killed coroutine
was waiting on a kore.lock() object, it would have been incorrectly
woken up again once said lock was released.

This would cause a Python exception that a generator was already
running and a crash due to the pool element already being freed.

Track the active locking operation per coroutine so we can remove
the coroutine if it is killed, fixing the problem.
2020-07-09 20:22:18 +02:00
Joris Vink
8235759bca Python: Add kore.app().
This method allows you to set a Python object and obtain it
by calling the method again without any arguments.

eg:

foo = SomeClass()

kore.app(foo)

foo = kore.app()
2020-07-05 21:47:22 +02:00
Joris Vink
e38c6e5d30 Python: Several fixes for our async curl support.
- Fix the curl-extract-opt.sh generation script to work on newer
  curl releases as the header changed slightly.
- Use the correct handles when calling curl_easy_setopt() inside
  of our setopt functions exported via Python.
- Add a curl.setbody() method, allowing a body to be sent to be set.
  (eg when sending mail via SMTP).
- Regen of our python_curlopt.h from 7.71.1
2020-07-02 08:41:17 +02:00
Joris Vink
122a86013b Python: respond with 500 in case of a coroutine error.
If a coroutine throws an exception, respond with a 500
after logging the exception itself.
2020-06-30 09:57:48 +02:00
Joris Vink
2316f1016d Always prune disconnected clients at the end of the event loop. 2020-06-26 12:25:07 +02:00
Joris Vink
74432aeff7 Set netwait to 10ms if a signal is pending.
If a signal is delivered after the signal check in the worker
loop we could end up in a scenario where we wait for i/o to
start triggering it.
2020-06-16 17:29:45 +02:00
Frederic Cambus
ce8290cefc Add missing test for SYS_stat, fixes the build on arm64. 2020-06-09 21:44:38 +02:00
Joris Vink
8a39d18196 work around different dirname()/basename() implementations. 2020-06-09 12:22:22 +02:00
Joris Vink
30e9b642a0 Skip ACME worker process if ACME isnt built-in. 2020-06-05 14:21:39 +02:00
Joris Vink
dcb34033fa trailing whitespace 2020-05-08 22:43:12 +02:00