653 Commits (ea01d687b546108b6baf0bc27d16e085739b3b6d)
 

Author SHA1 Message Date
Nicolas Favre-Felix 649cadcab7
Release 0.1.16
* 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).
3 years ago
Nicolas Favre-Felix 950c5153d7
Fix invalid ioctl call
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.
3 years ago
Nicolas Favre-Felix d254a72ae4
Update outdated docker image versions in README 3 years ago
Nicolas Favre-Felix 66ef564b13
Fix memory leak in `?type=...` feature
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.
3 years ago
Jessie Murray 6556039e05
Only process `Connection: close` header if full request was read (fixes #194) (#195) 3 years ago
Nicolas Favre-Felix 1e4c6f8b96
Post-release README update 3 years ago
Nicolas Favre-Felix 0e6ef3f7c9
Version bump after release 3 years ago
Nicolas Favre-Felix d988eea778
Release 0.1.15
* 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.
3 years ago
Nicolas Favre-Felix e6379ada2b
Upgrade base image from alpine:3.12.6 to 3.12.7 3 years ago
Nicolas Favre-Felix c0329d7813
Remove old .gitignore from Jansson
This was causing jansson_config.h to be excluded when the repo was
cloned with certain git pull commands.
3 years ago
Jessie Murray d1f4b831d9
CodeQL fixes (#192)
* 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
3 years ago
Nicolas Favre-Felix 4b5923f685
Add CodeQL workflow
* Configures code scanning for C
* Adds built-in "security and quality" suite
* Imports more CodeQL queries from GitHub repo
3 years ago
Nicolas Favre-Felix 3c7431a93d
Update ECR links after getting approved for a named account 4 years ago
Nicolas Favre-Felix c8dd4bc1a6
Re-sign Docker image 4 years ago
Nicolas Favre-Felix 0dd8325bbf
Update base image to alpine:3.12.6
Alpine 3.12.5 has a known vulnerability:
  High severity vulnerability found in busybox/busybox
  Description: Improper Handling of Exceptional Conditions
  Info: https://snyk.io/vuln/SNYK-ALPINE312-BUSYBOX-1089799
  Introduced through: busybox/busybox@1.31.1-r19, alpine-baselayout/alpine-baselayout@3.2.0-r7, busybox/ssl_client@1.31.1-r19
  From: busybox/busybox@1.31.1-r19
  From: alpine-baselayout/alpine-baselayout@3.2.0-r7 > busybox/busybox@1.31.1-r19
  From: busybox/ssl_client@1.31.1-r19
  Fixed in: 1.31.1-r20
4 years ago
Nicolas Favre-Felix 60c224e667
Post-release version bump and README update 4 years ago
Nicolas Favre-Felix c52f6374b5
Release 0.1.14
* Fixed compilation warnings
* Fsync frequency for log file is now configurable
* Added support for REPLY_STATUS in nested JSON objects (helps with
  RediSearch)
4 years ago
Nicolas Favre-Felix 6cfab3e563
Update base image to Alpine 3.12.5
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.
4 years ago
Nicolas Favre-Felix 80cf4d191d
Disable CircleCI 4 years ago
Jessie Murray b3eded6a1c
Add build (+ test) workflow for GitHub Actions (#191)
Performs the same tasks as on CircleCI and adds badge to README.md.
No change made to the CircleCI config.
4 years ago
Jessie Murray 1cd2a8b934
Add support for REDIS_REPLY_STATUS in nested JSON (#189)
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
4 years ago
Jessie Murray 53f483fb6a
Make fsync frequency configurable for log file (#187)
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.
4 years ago
Jessie Murray 2e71e85f4f Add explicit cast to msgpack callback 4 years ago
Jessie Murray efbd274294 Add "fall through" comments in switch to disable warning 4 years ago
Jessie Murray 24b09bb372 Remove strncpy false positive warning in slog.c
Use memcpy instead
4 years ago
Jessie Murray 34c51efc5e Add __attribute__ ((unused)) in dict.c
Checks for __GNUC__ to see if __attribute__ is available
4 years ago
Jessie Murray e3a29117e7 Fix warnings in conf.c
1. Remove unused size_t sz variable
2. Remove const on free()'d variable
4 years ago
Nicolas Favre-Felix 639026ec33
Remove unused .travis.yml 4 years ago
Nicolas Favre-Felix 726c96fb89
Update alpine base image for OpenSSL fix
Resolves:
* https://snyk.io/vuln/SNYK-ALPINE312-OPENSSL-1075734
* https://snyk.io/vuln/SNYK-ALPINE312-OPENSSL-1075735
* https://snyk.io/vuln/SNYK-ALPINE312-OPENSSL-1075736
4 years ago
Nicolas Favre-Felix c6d5d20de7
Post-release version bump and README update 4 years ago
Nicolas Favre-Felix d7738afd58
Release 0.1.13
* Adds support for Redis 6.0 auth
* Fixes one-time leak of 26 bytes when reading the config file
4 years ago
Nicolas Favre-Felix 875ca6fb74
Add Redis auth section in README 4 years ago
Jessie Murray 4bc0871006
Fix small leaks in conf.c (fixes #184) (#185)
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.
4 years ago
Jessie Murray fd3ec5d3ba Fixes for PR #183
Stop logging an error when auth is disabled and free all the fields of
redis_auth.
4 years ago
Jessie Murray 0177479cc5 Log Redis auth response
We were ignoring the response sent by Redis for AUTH commands. This
commit adds a callback which logs the response; I've tested it with
valid and invalid credentials and the log message is correct in both
cases. There's a lock on the server object to only log this once; I
tried adding it on the pool object but there's one pool per thread so
we still ended up with multiple messages.
4 years ago
Jessie Murray 09bd76f3a8 slog.c: Change level symbol to a single letter
A single symbol was added to the log depending on the level, one of ".-*#"
This had an issue: there were only 4 symbols but there are 5 levels; in
addition a `%b` was used which logged a number instead of a letter.
This commit changes the logic to add a single uppercase letter instead,
based on the level (e.g. WEBDIS_ERROR is E, _INFO is I, etc.)
4 years ago
Jessie Murray 02d60dc548 Implement Redis v6 auth (fixes #182)
* Change redis_auth in struct conf to handle old and new auth
* Update cfg.c to understand an array of two strings for redis_auth
* Update pool.c to send both username and password
4 years ago
Nicolas Favre-Felix 7fdfef0d8d
Change `docker run` command to expose port 7379 on loopback interface only 4 years ago
Nicolas Favre-Felix bcf2168b88
Add Docker Content Trust example 4 years ago
Nicolas Favre-Felix 8f33c4b298
Publish Docker Content Trust public key 4 years ago
Nicolas Favre-Felix 09f0ccc355
README: Add AWS ECR links, clean up Markdown
* Add links to new images on AWS ECR
* Clean up Markdown:
  * Change all <pre>...</pre> to ``` blocks
  * Add syntax info on code blocks
  * Add `$` prefix in front of all commands that didn't have it
  * Heading tweak
4 years ago
Nicolas Favre-Felix 9c1f900332
Update libcrypto, as recommended by snyk
Fixes https://snyk.io/vuln/SNYK-ALPINE311-OPENSSL-587980
Even though webdis doesn't use TLS, some images could be built from the
webdis image and therefore use a vulnerable version of openssl. The fix
is in version 1.1.1g and Alpine currently has 1.1.1i.
After this change, snyk no longer report any know vulnerabilities in the
Docker image.
4 years ago
Nicolas Favre-Felix 9f4a2093a6
Dockerfile updates
* Bump alpine version from 3.11.3 to 3.12.3
* Use `LABEL` instead of `MAINTAINER` which is deprecated
4 years ago
Nicolas Favre-Felix aafd53da0b
README fixes
* Make sure all external links use HTTPS
* Add missing dots in the list of supported formats/content-types
* Remove extra spaces
4 years ago
Nicolas Favre-Felix 42c11451b8
Use more common .md suffix for README 4 years ago
Nicolas Favre-Felix 955268a92d
Simplify Docker commands in README 4 years ago
Nicolas Favre-Felix 7e1c344259
Version bump after release 4 years ago
Nicolas Favre-Felix 21586199da
Release 0.1.12
* Adds support for MsgPackC on macOS
* Tests now pass with with python-msgpack (#150)
4 years ago
Nicolas Favre-Felix 1589b77da9
Clean up empty indented lines 4 years ago
Nicolas Favre-Felix c38e80a860
Wording 4 years ago