* Use pure.css for a basic grid
* Detect disconnections, update UI accordingly
* Make GET/SET commands configurable and interactive
* Add button to clear logs
* Test with current branch
The keep_alive flag is needed on http_response for websocket
connections. Without it, the server closes the connection as soon as a
reply to the first frame is sent.
Mostly adding trace logs to websocket.c, but also some in http.c and
worker.c for events relating to event loop and client requests and
responses. This is useful for debugging websocket issues.
* Add WEBDIS_TRACE log level for internal operations
* Warn when verbosity config is invalid
* Add slog_enabled to bypass buffer allocations if the level is filtered
1. Switch to evbuffer for correct handling of partial writes
2. Implement WS state machine in each worker
3. Clean up debug logging
4. Add detailed network log messages to help find WS issues
5. Switch to getopt_long
* Only process `Connection: close` header if full request was read
(#194). This likely fixes the same issue also reported in #145.
* Fix small memory leak when the `type` query string parameter is
used; the value was not being freed leading to growing memory usage
of a few bytes per request. Upgrading is recommended if you use this
feature.
* Fix invalid call to `ioctl`, which did not seem to affect Linux
systems but could have had an impact on macOS (found in #197).
The `request` parameter is unsigned long, not int. This was invalid on
macOS and caused issues when sockets were considered non-blocking. Also
adds an error log if the call fails.
Thanks @likuilin for opening an issue that led to this discovery.
Passing `?type=foo/bar` in the query string makes Webdis return the
response with a `Content-Type: foo/bar` header (this is useful to serve
files from Webdis, e.g. web page or their dependencies such as CSS,
images, etc). I discovered with Valgrind that the *value* of this query
string parameter was leaked and never freed, which would likely not
cause a huge issue but would still gradually grow the memory usage.
There were 2 different functions taking care of this parameter, the
first calling strdup(3) on it and the second *transferring* pointer
ownership into it (meaning overwriting the just-strdup'd value).
This is now fixed, Webdis no longer leaks this small string, and an
allocation was avoided.
* Fixed compilation warnings
* Fixed code quality issues found by CodeQL
* Upgraded base image from alpine:3.12.6 to alpine:3.12.7
See CWE-125 and CVE-2021-30139). This is *not* a security issue if
you just use the webdis image to run the service, but could be if
you're building a new Docker image using webdis as a base image.
* CodeQL: overrunning write in jansson/dump.c
* CodeQL: overrunning write in http.c
* CodeQL: redundant condition in websocket.c
* CodeQL: redundant condition in jansson/utf.c
* CodeQL: File created without restricting permissions in server.c
* CodeQL: Futile conditional in pool.c
* CodeQL: Too many arguments in jansson/load.c
* CodeQL: Commented-out code in http.c
* Jansson: disable truncation warning locally in error reporting function
* Fixed compilation warnings
* Fsync frequency for log file is now configurable
* Added support for REPLY_STATUS in nested JSON objects (helps with
RediSearch)
Alpine 3.12.4 uses a vulnerable version of libssl1.1
(CVE-2021-3449 and CVE-2021-3450), issues that are fixed in Alpine
3.12.5. This is not really a problem for Webdis since it doesn't use
SSL, but the vulnerability shows up on image scans and users who build
images with Webdis as the base image could be at risk if their own
changes depend on this library.
When strings are added as elements of an array but typed as
REDIS_REPLY_STATUS instead of REDIS_REPLY_STRING, Webdis encodes them as
nulls. REDIS_REPLY_STATUS should only be encoded as [true, str] or
[false, str] when this is a top-level status response, not an array
element. In these cases we only need the string.
Fixes#188
Webdis used to call fsync after every single log message, which had a
significant negative impact on performance. This change introduces 3
config options for fsync: no explicit fsync (the new default), a periodic
fsync called every N milliseconds, or the old behavior.
The new config key is also documented and validates its inputs.
1. plaintext was not free'd after encoding credentials
2. ACL commands were duplicated when there was no need to
In both cases the value came from conf_string_or_envvar which always
uses strdup.