Repository navigation
Description
WEBrick is not meant for production use. Its README says:
WEBrick is intended for use in testing and local development. It is not intended for production use, and it is not intended to receive traffic from untrusted sources.
A WEBrick maintainer also said that WEBrick issues are not handled as vulnerabilities for this reason (ruby/webrick#145 (comment)). Fluentd is moving away from WEBrick for the same reason (fluent/fluentd#4648).
in_prometheus still serves metrics with WEBrick in two cases.
- The deprecated
<ssl>section withextra_conf.extra_confis passed to WEBrick as SSL options, so it has no meaning without WEBrick. - An IPv6
bindaddress (fix: Add IPv6 support for bind parameter #240). Thehttp_serverhelper could not build a URI for IPv6 addresses at that time.
fluent-plugin-prometheus/lib/fluent/plugin/in_prometheus.rb
Lines 92 to 96 in 379987c
| # Use webrick for IPv6 or SSL extra_conf | |
| # The http_server helper has issues with IPv6 URI construction | |
| if (@ssl && @ssl['enable'] && @ssl['extra_conf']) || @bind.include?(':') | |
| start_webrick | |
| return |
The gemspec does not declare webrick. It is installed only because fluentd depends on it, and Ruby does not bundle it since 3.0. Once fluentd drops the dependency, both cases will fail with LoadError: cannot load such file -- webrick.
Possible direction:
- IPv6: the
http_serverhelper supports IPv6 bind addresses since fluentd v1.20.0 (fix: Support IPv6 bind addresses in http_server helper fluentd#5239). We can use it for IPv6 too. For older fluentd, we need to either raise the minimum fluentd version or reject IPv6bindwith a clear error. extra_conf: the<ssl>section has been deprecated since v1.8.0 in favor of<transport tls>. We can removeextra_confin the next major version. Few users seem to rely on it. Combining it withprivate_key_pathhas not worked since v1.8.0 (Read the private key file when <ssl> is served by WEBrick #276), and nobody reported it.
Activity