8 Commits

Author SHA1 Message Date
William Lallemand
6316f958e3 ADMIN: reload: introduce -vv mode
The -v verbose mode displays the loading messages returned by the master
CLI reload command upon error.

The new -vv mode displays the loading messages even upon success,
showing the content of `show startup-logs` after the reload attempt.
2025-09-29 19:29:10 +02:00
William Lallemand
5d05f343b9 ADMIN: reload: introduce verbose and silent mode
By default haproxy-reload displays the error that are not emitted by
haproxy, but only emitted by haproxy-reload.

-s silent mode, don't display any error

-v verbose mode, display the loading messages returned by the master CLI
reload command upon error.
2025-09-29 19:29:10 +02:00
William Lallemand
8635c7d789 ADMIN: reload: add a synchronous reload helper
haproxy-reload is a utility script which reload synchronously using the
master CLI, instead of asynchronously with kill.
2025-09-28 22:10:40 +02:00
William Lallemand
02f7bff90b ADMIN: dump-certs: use same error format as haproxy
Replace error/notice by [ALERT]/[WARNING]/[NOTICE] like it's done in
haproxy.

ALERT means a failure and the program will exit 1 just after it
WARNING will continue the execution of the program
NOTICE will continue the execution as well
2025-09-28 20:21:07 +02:00
William Lallemand
5c9f28641b ADMIN: dump-certs: fix lack of / in -p
Add a trailing / so -p don't fail if it wasn't specified.
2025-09-28 18:21:25 +02:00
William Lallemand
172ac6ad03 ADMIN: dump-certs: create files in a tmpdir
Files dumped from the socket are put in a temporary directory, this
directory is then removed upon exit.

Variable were cleaned to be clearer:
- crt_filename -> prev_crt
- key_filename -> prev_key
- ${crt_filename}.${tmp} -> new_crt
- ${key_filename}.${tmp} -> new_key
2025-09-28 18:21:25 +02:00
William Lallemand
8781c65d8a ADMIN: dump-certs: don't update the file if it's up to date
Compare the fingerprint of the leaf certificate to the previous file to
check if it needs to be updated or not

Also skip the check if no file is on the disk.
2025-09-28 18:21:20 +02:00
William Lallemand
3a6ea8b959 ADMIN: haproxy-dump-certs: implement a certificate dumper
haproxy-dump0-certs is a bash script that connects to your master socket
or your stat socket in order to dump certificates from haproxy memory to
the corresponding files.
2025-09-28 13:38:48 +02:00