boostorg / redis

An async redis client designed for performance and scalability
https://www.boost.org/doc/libs/develop/libs/redis/doc/html/index.html
Boost Software License 1.0
212 stars 38 forks source link

Setup a Redis server with TLS support to use in the CI tests #191

Closed mzimbres closed 3 months ago

mzimbres commented 3 months ago

I had to disable the TLS tests after shutting down my server running on occase.de. A new one will be needed in the CI. I believe the work of @anarthal in Boost.MySql could offer some guidance here (although I haven't looked at it yet).

anarthal commented 3 months ago

My recommendation is to:

Should you have any questions or need any help with this, please let me know.

mzimbres commented 3 months ago

@anarthal Thanks for detailed overview. Would it make sense to enhance the container you are using with a Redis server so I can avoid all the trouble?

anarthal commented 3 months ago

I'm afraid it does not. The MySQL containers are just MySQL. I'm also using build containers (which I don't think you're using), but these don't contain MySQL at all. It's good practice to keep containers as small as possible.

I can write you a minimal Dockerfile, GHA workflow to build an image, and GHA workflow to run your CI with a local Redis server, but you will need to adjust it afterwards to run the tests only for that workflow. I'll also need the specific configuration you need for your tests.

mzimbres commented 3 months ago

I can write you a minimal Dockerfile, GHA workflow to build an image, and GHA workflow to run your CI with a local Redis server, but you will need to adjust it afterwards to run the tests only for that workflow. I'll also need the specific configuration you need for your tests.

Any help would be much appreciated, thanks.

anarthal commented 3 months ago

Does the server need to have any particular configuration regarding SSL?

mzimbres commented 3 months ago

The TLS tests are very simple and won't even validate server the certificate. At the moment I am using the following parameters

config cfg;
cfg.use_ssl = true;
cfg.username = "aedis";
cfg.password = "aedis";
cfg.addr.host = "db.occase.de";
cfg.addr.port = "6380";

but those are rather arbitrary.

My server on db.occase.de was also exposed to the network so I set an ACL that would only accept PING commands from the aedis user. Thefore I also used the TLS server to test how the handshake works in this case. You can ignore this at first because ACL can be set on the client side via commands too, no need to put on the config files.