Commit Graph

638 Commits

Author SHA1 Message Date
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
Michael Klishin 730856e296
LDAP: match on eldap_search_result record for OTP 24.3 compat
In https://github.com/erlang/otp/pull/5538, the eldap_search_result
record structure has changed:
https://github.com/erlang/otp/pull/5538/files#diff-30e064e89b115da7e974f229ed5c92f28e489da679ef42f17e70b9e7cf874179R24

It does have a default but for code
compiled on, say, Erlang 23.0, which is the case for current RabbitMQ
releases, it would still be a breaking change resulting in
case expression matching failures (a case_clause).

Closes #4284.
2022-03-17 16:47:40 +04:00
Philip Kuryloski 226e00fcd2 Tighten up dialyzer usage
now that rules_erlang no longer cascades up dialyzer warnings from deps
2022-02-24 11:18:41 +01:00
Philip Kuryloski d8201726ae Ignore dialyzer warnings for most apps 2022-02-21 09:19:56 +01:00
Philip Kuryloski efcd881658 Use rules_erlang v2
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process
2022-01-18 13:43:46 +01:00
Luke Bakken 160a74862a
Update link in comment
It is a useful comment, so update all the links to the correct place on the internet:
http://erlang.org/pipermail/erlang-questions/2010-April/050508.html
2021-11-04 15:45:17 -07:00
Philip Kuryloski 7d3d601d88 Bump test timeouts
A recent release of buildbuddy eliminated a timeout extension that
they had applied in the past. Now that they honor timeouts exactly,
we have had to adjust the timeout for many tests.
2021-07-23 13:36:09 +02:00
Philip Kuryloski 8f9de08de7 Also assert no missing suites for all other deps 2021-07-12 18:05:55 +02:00
Philip Kuryloski 3eac3cf8a8 Remove unused load statements from bazel files 2021-07-12 12:10:26 +02:00
Philip Kuryloski 8c7e7e0656 Revert "Default all `rabbitmq_integration_suite` to flaky in bazel"
This reverts commit 70cb8147b2.
2021-06-23 20:53:14 +02:00
Philip Kuryloski 70cb8147b2 Default all `rabbitmq_integration_suite` to flaky in bazel
Most tests that can start rabbitmq nodes have some chance of
flaking. Rather than chase individual flakes for now, this commit
changes the default (though it can still be overriden, as is the case
for config_scheme_SUITE in many places, since I have yet to see that
particular suite flake).
2021-06-21 16:10:38 +02:00
Philip Kuryloski 30f9a95b9f Add dialyze for remaning tier-1 plugins 2021-06-01 10:19:10 +02:00
Philip Kuryloski 98e71c45d8 Perform xref checks on many tier-1 plugins 2021-05-21 12:03:22 +02:00
Philip Kuryloski 29ddca78aa Fix additional Erlang 24 compiler warnings 2021-05-17 12:05:28 +02:00
Philip Kuryloski c13c2af614 Bazel file refactoring 2021-05-11 12:03:27 +02:00
Philip Kuryloski d194341cb8 Bazel file refactoring 2021-05-11 10:44:28 +02:00
Philip Kuryloski 072a1c0462 Refactor and dedupe .bazel file content 2021-04-16 10:22:44 +02:00
Philip Kuryloski 3ecb291d75 Add rabbitmq_consistent_hash_exchange to bazel
also fixup erlc_opts for some other plugins
2021-04-08 17:24:14 +02:00
Philip Kuryloski 78bb20f0aa Adopt change of suite_name -> name in ct_suite from @bazel-erlang 2021-04-08 14:25:06 +02:00
Philip Kuryloski 64f6c18cb8 Add the rabbitmq_auth_backend_oauth2 suite
requires recent @bazel-erlang updates
2021-03-31 19:11:32 +02:00
Philip Kuryloski 388654c542
Add a partial Bazel build (#2938)
Adds WORKSPACE.bazel, BUILD.bazel & *.bzl files for partial build & test with Bazel. Introduces a build-time dependency on https://github.com/rabbitmq/bazel-erlang
2021-03-29 11:01:43 +02:00
Philip Kuryloski a63f169fcb Remove duplicate rabbitmq-components.mk and erlang.mk files
Also adjust the references in rabbitmq-components.mk to account for
post monorepo locations
2021-03-22 15:40:19 +01:00
kjnilsson 52f745dcde Update rabbitmq-components.mk
use v1.x branch of ra
2021-03-18 15:14:40 +00:00
Loïc Hoguin d5e3bdd623
Add ADDITIONAL_PLUGINS variable
This allows including additional applications or third party
plugins when creating a release, running the broker locally,
or just building from the top-level Makefile.

To include Looking Glass in a release, for example:

$ make package-generic-unix ADDITIONAL_PLUGINS="looking_glass"

A Docker image can then be built using this release and will
contain Looking Glass:

$ make docker-image

Beware macOS users! Applications such as Looking Glass include
NIFs. NIFs must be compiled in the right environment. If you
are building a Docker image then make sure to build the NIF
on Linux! In the two steps above, this corresponds to Step 1.

To run the broker with Looking Glass available:

$ make run-broker ADDITIONAL_PLUGINS="looking_glass"

This commit also moves Looking Glass dependency information
into rabbitmq-components.mk so it is available at all times.
2021-03-12 12:29:28 +01:00
Michael Klishin 97ff62d3b2
Drop trailing newlines from logged messages where possible
Lager strips trailing newline characters but OTP logger with the default
formatter adds a newline at the end. To avoid unintentional multi-line log
messages we have to revisit most messages logged.

Some log entries are intentionally multiline, others
are printed to stdout directly: newlines are required there
for sensible formatting.
2021-03-11 15:17:37 +01:00
Jean-Sébastien Pédron cdcf602749
Switch from Lager to the new Erlang Logger API for logging
The configuration remains the same for the end-user. The only exception
is the log root directory: it is now set through the `log_root`
application env. variable in `rabbit`. People using the Cuttlefish-based
configuration file are not affected by this exception.

The main change is how the logging facility is configured. It now
happens in `rabbit_prelaunch_logging`. The `rabbit_lager` module is
removed.

The supported outputs remain the same: the console, text files, the
`amq.rabbitmq.log` exchange and syslog.

The message text format slightly changed: the timestamp is more precise
(now to the microsecond) and the level can be abbreviated to always be
4-character long to align all messages and improve readability. Here is
an example:

    2021-03-03 10:22:30.377392+01:00 [dbug] <0.229.0> == Prelaunch DONE ==
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Starting RabbitMQ 3.8.10+115.g071f3fb on Erlang 23.2.5
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Licensed under the MPL 2.0. Website: https://rabbitmq.com

The example above also shows that multiline messages are supported and
each line is prepended with the same prefix (the timestamp, the level
and the Erlang process PID).

JSON is also supported as a message format and now for any outputs.
Indeed, it is possible to use it with e.g. syslog or the exchange. Here
is an example of a JSON-formatted message sent to syslog:

    Mar  3 11:23:06 localhost rabbitmq-server[27908] <0.229.0> - {"time":"2021-03-03T11:23:06.998466+01:00","level":"notice","msg":"Logging: configured log handlers are now ACTIVE","meta":{"domain":"rabbitmq.prelaunch","file":"src/rabbit_prelaunch_logging.erl","gl":"<0.228.0>","line":311,"mfa":["rabbit_prelaunch_logging","configure_logger",1],"pid":"<0.229.0>"}}

For quick testing, the values accepted by the `$RABBITMQ_LOGS`
environment variables were extended:
  * `-` still means stdout
  * `-stderr` means stderr
  * `syslog:` means syslog on localhost
  * `exchange:` means logging to `amq.rabbitmq.log`

`$RABBITMQ_LOG` was also extended. It now accepts a `+json` modifier (in
addition to the existing `+color` one). With that modifier, messages are
formatted as JSON intead of plain text.

The `rabbitmqctl rotate_logs` command is deprecated. The reason is
Logger does not expose a function to force log rotation. However, it
will detect when a file was rotated by an external tool.

From a developer point of view, the old `rabbit_log*` API remains
supported, though it is now deprecated. It is implemented as regular
modules: there is no `parse_transform` involved anymore.

In the code, it is recommended to use the new Logger macros. For
instance, `?LOG_INFO(Format, Args)`. If possible, messages should be
augmented with some metadata. For instance (note the map after the
message):

    ?LOG_NOTICE("Logging: switching to configured handler(s); following "
                "messages may not be visible in this log output",
                #{domain => ?RMQLOG_DOMAIN_PRELAUNCH}),

Domains in Erlang Logger parlance are the way to categorize messages.
Some predefined domains, matching previous categories, are currently
defined in `rabbit_common/include/logging.hrl` or headers in the
relevant plugins for plugin-specific categories.

At this point, very few messages have been converted from the old
`rabbit_log*` API to the new macros. It can be done gradually when
working on a particular module or logging.

The Erlang builtin console/file handler, `logger_std_h`, has been forked
because it lacks date-based file rotation. The configuration of
date-based rotation is identical to Lager. Once the dust has settled for
this feature, the goal is to submit it upstream for inclusion in Erlang.
The forked module is calld `rabbit_logger_std_h` and is based
`logger_std_h` in Erlang 23.0.
2021-03-11 15:17:36 +01:00
dcorbacho 61f7b2a723 Update to ranch 2.0 2021-03-08 23:11:05 +01:00
Michael Klishin b6c4831e75
Bump Lager to 3.9.1 2021-03-04 04:36:39 +03:00
Loïc Hoguin 66ac1bf5e9
Bump observer_cli to 1.6.1
More responsive when the system is overloaded with file calls.
2021-03-01 21:55:27 +03:00
Michael Klishin 8fe3df9343
Upgrade Lager to 3.9.0 for OTP 24 compatibility
`lager_util:expand_path/1` use changes are
due to erlang-lager/lager#540
2021-02-26 00:52:15 +03:00
Michael Klishin f73e851f9c
Bump observer_cli to 1.6.0 2021-02-24 12:53:55 +03:00
Michael Klishin a5098b28a7
Bump Lager to 3.8.2 for OTP 24 compatibility 2021-02-24 12:53:30 +03:00
Michael Klishin 66badb9492
LDAP plugin: handle undefined app env values, pass Dialyzer 2021-02-11 21:26:27 +03:00
Michael Klishin cd683de436
Correct a duplicate snippet name 2021-02-11 19:46:06 +03:00
Michael Klishin 8ea212a6b6
New configuration settings for TLS
* [Client] hostname verification matching: wildcard or none
 * SNI hostname or none

Closes #2805
2021-02-11 00:12:24 +03:00
Arnaud Cogoluègnes b921ac11a8
Merge pull request #2712 from rabbitmq/rabbitmq-stream-prometheus
Add stream prometheus plugin
2021-01-27 16:46:37 +01:00
Michael Klishin 52479099ec
Bump (c) year 2021-01-22 09:00:14 +03:00
Arnaud Cogoluègnes bf72683eb2
Add stream prometheus plugin 2021-01-11 16:49:56 +01:00
Arnaud Cogoluègnes 23d7e8114c
Introduce stream management plugin 2020-11-19 14:48:25 +01:00
Jean-Sébastien Pédron 47686ee1f0
Remove unused .github directories
They were valid until the switch to the "monorepository" when everything
was merged into a single Git repository.
2020-11-17 13:33:16 +01:00
Arnaud Cogoluègnes 31a6448f0a Update rabbitmq-components.mk 2020-11-03 14:27:34 +01:00
Michael Klishin bc1f698dd6 Update rabbitmq-components.mk 2020-10-21 12:55:30 +03:00
Luke Bakken ac0df164ee Update rabbitmq-components.mk 2020-08-04 08:41:46 -07:00
Jean-Sébastien Pédron 91d053fd97 Update rabbitmq-components.mk 2020-07-30 12:06:51 +02:00
Luke Bakken 2881b75afb Update rabbitmq-components.mk 2020-07-29 10:02:01 -07:00
dcorbacho bc683ca0a6 Update erlang.mk 2020-07-21 14:31:50 +01:00
Jean-Sébastien Pédron 367fae631c Update rabbitmq-components.mk 2020-07-21 12:07:56 +02:00
Michael Klishin eb885b6cea Update rabbitmq-components.mk 2020-07-21 03:42:42 +03:00
dcorbacho f32267511d Revert drop of Exhibit B on MPL 2.0 2020-07-20 16:56:59 +01:00
dcorbacho ef50beca9f Update LICENSE 2020-07-20 10:41:12 +01:00
Michael Klishin 589705e935 Update MPL2 license file, drop Exhibit B
and add a VMware copyright notice.

We did not mean to make this code Incompatible with Secondary Licenses
as defined in [1].

1. https://www.mozilla.org/en-US/MPL/2.0/FAQ/
2020-07-17 14:53:06 +03:00
dcorbacho 015e1152c2 Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-10 20:19:35 +01:00
Jean-Sébastien Pédron e4490b9cd0 Update erlang.mk 2020-06-23 17:13:20 +02:00
Michael Klishin 343d276395 Bump Recon to 2.5.1
for Erlang 23 compatibility of 'rabbitmq-diagnostics observer'

References zhongwencool/observer_cli#68.
2020-06-09 08:22:13 +03:00
Jean-Sébastien Pédron 7fbf4d5824 Merge pull request #121 from rabbitmq/setup-slapd
Setup slapd(8)
2020-03-26 16:16:17 +01:00
Jean-Sébastien Pédron 5e403e56ee Travis CI: Update config from rabbitmq-common 2020-03-26 16:07:18 +01:00
Jean-Sébastien Pédron 0a71c3cf7b system_SUITE: Setup slapd(8) at the beginning of the testsuite
... instead of relying on an external script to configure it.

This way, if OpenLDAP server is installed, `make ct-system` should work.
`TESTING.md` is updated with this new information.

It also means the following resources are now unused:
* The Docker and Vagrant files
* `setup.sh` and `seed.sh` in the `example` directory
2020-03-26 16:07:08 +01:00
Jean-Sébastien Pédron 3dbfddfca0 example/README.md: Record the source of those LDIF files 2020-03-26 15:54:23 +01:00
Jean-Sébastien Pédron 7eafadead3 rabbit_ldap_seed: Remove trailing whitespace 2020-03-26 14:52:36 +01:00
Michael Klishin ffefe91771 Explain 2020-03-24 16:08:11 +03:00
Luke Bakken d8ff8a548a Setting idle_timeout to 0 will request a connection for every operation
[171933299]
2020-03-23 14:32:59 -07:00
Luke Bakken ef14002fb6 Setting idle_timeout to 0 will request a connection for every operation
[171933299]
2020-03-23 10:29:26 -07:00
Jean-Sébastien Pédron 6c2d8a3c65 Update copyright (year 2020) 2020-03-10 16:05:14 +01:00
Jean-Sébastien Pédron 084605ab9d Update copyright (year 2020) 2020-03-10 16:02:56 +01:00
Gerhard Lazu 8f96fcb478 Update rabbitmq-components.mk 2020-03-06 09:19:13 +00:00
Gerhard Lazu 3299116be0 Update erlang.mk 2020-03-06 09:17:17 +00:00
Jean-Sébastien Pédron c3d58ccbbf Travis CI: Update config from rabbitmq-common 2020-03-04 14:31:20 +01:00
Jean-Sébastien Pédron 6f5aa0f8b6 Travis CI: Refresh config patch 2020-03-04 14:30:16 +01:00
Jean-Sébastien Pédron 234fe38096 Travis CI: Update config from rabbitmq-common 2020-03-04 11:17:13 +01:00
Jean-Sébastien Pédron 4a020deec5 Travis CI: Update config from rabbitmq-common 2020-03-03 14:53:37 +01:00
Jean-Sébastien Pédron 6fa1b6c21d Travis CI: Refresh config patch 2020-03-03 14:30:21 +01:00
Luke Bakken dcb92cfabf Remove unused variable
See b67ccfbd15
2020-02-28 15:08:36 -08:00
Luke Bakken c0f43acfba Remove spammy log message
Fixes #118
2020-02-27 14:40:05 -08:00
Gerhard Lazu 33e4b2e079 Update rabbitmq-components.mk 2020-02-11 15:31:41 +00:00
Michael Klishin d9890ad642 (c) bump 2019-12-29 05:50:24 +03:00
Jean-Sébastien Pédron c1e8307714 Git: Ignore copied CLI 2019-12-12 13:23:51 +01:00
Jean-Sébastien Pédron e4368878ec Update rabbitmq-components.mk 2019-12-12 13:14:52 +01:00
Jean-Sébastien Pédron 043fda72b8 system_SUITE: Bump timetrap from 1 to 2 minutes 2019-11-21 16:49:13 +01:00
Luke Bakken d9835870d2 Ensure results match expected rabbit_authz_backend behaviour
Fixes #116
2019-10-30 14:05:06 -07:00
Michael Klishin 554eeed9b2 Add a Dockerfile for running integration tests 2019-10-14 22:41:03 +03:00
Luke Bakken b843487019 Add warning messages when configuration values do not make sense 2019-10-14 09:58:58 -07:00
kjnilsson e59926bdbe Update rabbitmq-components.mk 2019-09-13 10:24:14 +01:00
kjnilsson b0a5340e00 Update rabbitmq-components.mk 2019-09-04 10:30:51 +01:00
Jean-Sébastien Pédron 809806784a Update erlang.mk 2019-08-29 20:44:48 +02:00
Michael Klishin c5096b0177 Update rabbitmq-components.mk 2019-08-11 01:47:47 +10:00
Jean-Sébastien Pédron 9d4786d5b8 Update erlang.mk 2019-08-02 09:53:29 +02:00
Michael Klishin 99212833d9 Update rabbitmq-components.mk 2019-08-01 17:13:08 +03:00
Luke Bakken 4ff2b8fb31 Update GitHub templates
Related to rabbitmq/rabbitmq-auth-backend-oauth2#34
2019-07-18 14:30:38 -07:00
Arnaud Cogoluègnes f5e3966e52 Update rabbitmq-components.mk 2019-07-09 16:05:49 +02:00
Michael Klishin 1d712739d5 Adapt to rabbit_authz_backend interface changes in rabbitmq/rabbitmq-auth-backend-oauth2#28. 2019-07-03 10:41:01 +02:00
Jean-Sébastien Pédron cb200c6327 Update rabbitmq-components.mk 2019-06-28 16:05:25 +02:00
Jean-Sébastien Pédron 420bca49ec Update erlang.mk 2019-06-28 16:01:41 +02:00
Arnaud Cogoluègnes db497a2baf Propagate protocol-specific context
Information like MQTT client ID is now propagated to the LDAP registry
for all authentication and authorization functions.

References rabbitmq/rabbitmq-server#1767
2019-06-03 15:54:37 +02:00
Gerhard Lazu 2c1aeb3866 Update rabbitmq-components.mk 2019-06-03 02:23:31 +01:00
Jean-Sébastien Pédron ffb311264b Update rabbitmq-components.mk 2019-05-17 15:17:13 +02:00
Michael Klishin 68a744b06f Update rabbitmq-components.mk 2019-05-17 08:36:23 +03:00
Michael Klishin 4dd8b09cee Update rabbitmq-components.mk 2019-05-16 23:22:43 +03:00
Michael Klishin 461cb5f6ed Update rabbitmq-components.mk 2019-05-14 11:50:39 +03:00
Michael Klishin 1b88a4aa63 Update rabbitmq-components.mk 2019-05-13 16:40:25 +03:00
Gerhard Lazu 088bb2bcba Update rabbitmq-components.mk 2019-05-01 13:18:07 +01:00