package/rousette: silence rousette warnings in log

Add --log-level command line option to filter out log messages from
lower log levels.  Then fix the annoying CzechLight warning message
and useless "NACM config validation" log.  Then add audit trail as
we have in netopeer2-server, and finish off by stripping redundant
fields from log message: timestamp, identity, and log level.

Fixes #892

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-03-20 16:18:16 +01:00
parent e9f165ebd8
commit 4dee5e4f1f
43 changed files with 420 additions and 77 deletions
@@ -1,7 +1,7 @@
From a4136d889237dadb9253ea7eb668a525dd779e6d Mon Sep 17 00:00:00 2001
From 65a99da7e857d1f6fd111d0428622563fd895810 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Thu, 12 Jun 2025 10:33:42 +0100
Subject: [PATCH 01/38] Log HTTP headers and the input data payload
Subject: [PATCH 01/42] Log HTTP headers and the input data payload
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -12,6 +12,7 @@ Hažlinský just found.
Change-Id: I2a930a02c7d30c051390fe73e6af9849edd580b4
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
@@ -1,7 +1,7 @@
From 6c5b482ea5c9fbc1149a0864b05d1bb1fa7100bf Mon Sep 17 00:00:00 2001
From 729bb0619d7cb14ca3bf97f56d3c6550bd2e75f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Fri, 13 Jun 2025 10:47:55 +0200
Subject: [PATCH 02/38] restconf: prevent throwing exception in
Subject: [PATCH 02/42] restconf: prevent throwing exception in
withRestconfExceptions wrapper
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -23,6 +23,7 @@ handle such situations.
Bug: https://github.com/CESNET/rousette/issues/19
Change-Id: Ifbd74b9bdc0ca66c4e5449a7673ef2f12ae9215e
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 2 +-
tests/restconf-plain-patch.cpp | 24 ++++++++++++++++++++++++
@@ -1,7 +1,7 @@
From 41c9d9cab47a88ee6c70ab8009b789226c0982fe Mon Sep 17 00:00:00 2001
From f548df0c693ffd1625fbcb843c6f914972315179 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Tue, 17 Jun 2025 12:46:27 +0200
Subject: [PATCH 03/38] CI: switch to the new cloud's Swift URL
Subject: [PATCH 03/42] CI: switch to the new cloud's Swift URL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -9,6 +9,7 @@ Organization: Wires
Change-Id: I69f8351394262a2a9b691422592741bfb40a8e38
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
ci/build.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1,7 +1,7 @@
From ec8673126929b6459fcd99c84a79993a725b40e1 Mon Sep 17 00:00:00 2001
From 8c441795f1050412fc953518917f3d494edd6be1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Fri, 13 Jun 2025 10:47:55 +0200
Subject: [PATCH 04/38] restconf: crash instead of a deadlock when the handler
Subject: [PATCH 04/42] restconf: crash instead of a deadlock when the handler
throws
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -38,6 +38,7 @@ Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Bug: https://github.com/CESNET/rousette/issues/19
Change-Id: I2c090b9a76b062101ba422a7d50e8e699779e203
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 28 ++++++++++++++++++++++++++++
src/restconf/Server.h | 4 ++++
@@ -1,7 +1,7 @@
From 37ca95c387d76c3f296a4e44b211772a1ca155ab Mon Sep 17 00:00:00 2001
From 130a5f43c3cb06e0a97e8eb580f97a526c8c9d8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Wed, 18 Jun 2025 12:01:04 +0200
Subject: [PATCH 05/38] doc: let's stop calling this "an almost-RESTCONF
Subject: [PATCH 05/42] doc: let's stop calling this "an almost-RESTCONF
server"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -10,6 +10,7 @@ Organization: Wires
Change-Id: If55ace481c78d838a811ded76a564f8fb59f9233
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1,7 +1,7 @@
From 4eae6200aa812950ebbac1660a1899f4edf41e11 Mon Sep 17 00:00:00 2001
From 7b8c1d90594dbc65eeb0ea767e3a50b92db8aea3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Wed, 7 Aug 2024 19:07:35 +0200
Subject: [PATCH 06/38] close long-lived connections on SIGTERM
Subject: [PATCH 06/42] close long-lived connections on SIGTERM
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -24,6 +24,7 @@ hope it is).
Change-Id: If442134783ba1d699de47c51a9068378f53e8339
Co-authored-by: Tomas Pecka <tomas.pecka@cesnet.cz>
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 1 +
src/clock.cpp | 7 +--
@@ -1,7 +1,7 @@
From ca2894d4888c673d227fc196a25f83ded20e8f04 Mon Sep 17 00:00:00 2001
From be28d13811e617d9cdb74bd6d27f4c8634fe4d02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 30 Jun 2025 15:38:02 +0200
Subject: [PATCH 07/38] restconf: refactor server stop
Subject: [PATCH 07/42] restconf: refactor server stop
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -21,6 +21,7 @@ does not seem like it should be called from *every* io_service.)
Change-Id: I2f33c38a78dce4081a03326c9a9bb25817fc9d2f
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
@@ -1,7 +1,7 @@
From 9961430bacdd8dbac64a01b2a2ffb6a4b7e806b6 Mon Sep 17 00:00:00 2001
From edc6f47fe49d9873f9c7257d66fbf8b362a6c7ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 13 May 2025 13:48:35 +0200
Subject: [PATCH 08/38] tests: use std::string::starts_with
Subject: [PATCH 08/42] tests: use std::string::starts_with
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -11,6 +11,7 @@ We are C++20, so we can use line, which is more readable.
Change-Id: I40d4038b421f6bc1fcf320f609b50d5ce7018a45
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
tests/restconf_utils.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1,7 +1,7 @@
From 746c0cdfef6808f393be7946630b8acbb0636706 Mon Sep 17 00:00:00 2001
From 8f6ce5d8efd7e5ce4adb6e188dbec14ad86fa0e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 22 Jul 2025 17:47:50 +0200
Subject: [PATCH 09/38] tests: add SSE event watcher for comments
Subject: [PATCH 09/42] tests: add SSE event watcher for comments
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -12,6 +12,7 @@ which should be ignored, i.e., lines starting with colon.
Change-Id: If54f0af05b4884aab01325f12fd0a6859791b41b
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
tests/event_watchers.cpp | 7 ++++++-
tests/event_watchers.h | 4 +++-
@@ -1,7 +1,7 @@
From 5becffe8a1dd47c8836ce1800a1b72acdf86021f Mon Sep 17 00:00:00 2001
From fc240be374f70b0f006bb83152364678ffdbfa86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 12 May 2025 14:56:54 +0200
Subject: [PATCH 10/38] http: send keep-alive pings from EventStream
Subject: [PATCH 10/42] http: send keep-alive pings from EventStream
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -32,6 +32,7 @@ to the server when the server sends these "keep-alive comments".
Change-Id: I57e510d0b61ac7ed032c582779780c64768b7d53
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/clock.cpp | 4 +-
src/http/EventStream.cpp | 44 +++++++++++++--
@@ -1,7 +1,7 @@
From ff4ff1c193083feca76d9f0f4485e4b175c373c2 Mon Sep 17 00:00:00 2001
From 1375ecb15ef534ca2856f46f957686ccc23ab7fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Wed, 23 Jul 2025 14:27:26 +0200
Subject: [PATCH 11/38] refactor: event streams use named constructors
Subject: [PATCH 11/42] refactor: event streams use named constructors
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -18,6 +18,7 @@ This way, the code is more readable and the intention should be clearer.
Change-Id: Iac96c49c20670dfe924d7c8db33328ed9c2fc9dd
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/clock.cpp | 3 +--
src/http/EventStream.cpp | 20 ++++++++++++++++++++
@@ -1,7 +1,7 @@
From f4602a03adc9134a9b7a9d338e900b40557da6c4 Mon Sep 17 00:00:00 2001
From fd0dbd116f249cd8a4d00b677ed2976b19a28b1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Thu, 7 Aug 2025 12:14:02 +0200
Subject: [PATCH 12/38] refactor: a better convention for weak_from_this->lock
Subject: [PATCH 12/42] refactor: a better convention for weak_from_this->lock
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -11,6 +11,7 @@ It is not a "client", so let's stop calling it a "client". My bad.
Change-Id: Id8dc4d92c3ade8d86697366d0102e84bd466f504
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/http/EventStream.cpp | 44 ++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 22 deletions(-)
@@ -1,7 +1,7 @@
From 4e9b535a59861f25c0602eaa1fc39126d7cd9899 Mon Sep 17 00:00:00 2001
From cb0c00ceba7ac4b225382ffacef919f2573dc5cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Thu, 7 Aug 2025 12:21:54 +0200
Subject: [PATCH 13/38] fix a possible bad_weak_ptr exception
Subject: [PATCH 13/42] fix a possible bad_weak_ptr exception
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -10,6 +10,7 @@ Organization: Wires
Change-Id: I8c7f7a943a1d848f15527988cb76c2a0a10089e6
Fixes: 4eae6200 (close long-lived connections on SIGTERM)
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/http/EventStream.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1,7 +1,7 @@
From 6bca750f866b5b14c4d9c3da68e5c8f1e4eee36c Mon Sep 17 00:00:00 2001
From 91e8e41b5f22629820799b48977a90f57f01f424 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 19 May 2025 12:11:09 +0200
Subject: [PATCH 14/38] http: add optional callbacks to EventStream
Subject: [PATCH 14/42] http: add optional callbacks to EventStream
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -15,6 +15,7 @@ disconnects.
Change-Id: Icfc2959e38b812b7c18f45976415209b29151c7b
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/http/EventStream.cpp | 18 +++++++++++++++---
src/http/EventStream.h | 10 ++++++++--
@@ -1,7 +1,7 @@
From f6ee629de8abef42a24c42b185052b0c8e78bd6b Mon Sep 17 00:00:00 2001
From 39f43493339984e3a3c256bc818f11aee71375f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 19 May 2025 12:23:16 +0200
Subject: [PATCH 15/38] restconf: add internal RPC handler dispatcher
Subject: [PATCH 15/42] restconf: add internal RPC handler dispatcher
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -15,6 +15,7 @@ ietf-subscribed-notifications:establish-subscription RPC is coming soon.
Change-Id: I99121a511011229e4098f95e91601b39d333444a
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 24 ++++++++++++++++++++----
tests/restconf-rpc.cpp | 18 ++++++++++++++++++
@@ -1,7 +1,7 @@
From b7966613b43b01402c9f0af286a0b3237161779d Mon Sep 17 00:00:00 2001
From fe57a9ac8024e4115c45d9c256d5048e17fe9fdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 2 Sep 2025 15:33:43 +0200
Subject: [PATCH 16/38] tests: processing incomplete events in SSE client
Subject: [PATCH 16/42] tests: processing incomplete events in SSE client
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -14,6 +14,7 @@ a complete event, once available.
Change-Id: Ied07e69e8b518f20fcc82134a4c041e7ec3a06d6
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
tests/restconf_utils.cpp | 53 +++++++++++++++++++++++-----------------
tests/restconf_utils.h | 3 ++-
@@ -1,7 +1,7 @@
From 1067e05674633b97d64b428686aff44822230c5f Mon Sep 17 00:00:00 2001
From 5686bf2fcf351e999043fe3e6e788e1ed502116a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 8 Sep 2025 20:24:15 +0200
Subject: [PATCH 17/38] EventStream: fix possible heap-use-after-free
Subject: [PATCH 17/42] EventStream: fix possible heap-use-after-free
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -65,6 +65,7 @@ before actually resuming the response.
Change-Id: Ifdb1f8610cacffca3bb49da17aa9b1d267cdd472
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/http/EventStream.cpp | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
@@ -1,7 +1,7 @@
From fff342945eb3c8deb6f7aa67aca54f9c9f87f3ec Mon Sep 17 00:00:00 2001
From 07131a39ca9c5a27fe7b1a5c628f3519c2efc0e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Thu, 11 Sep 2025 18:56:31 +0200
Subject: [PATCH 18/38] Use a working version of nghttp2-asio
Subject: [PATCH 18/42] Use a working version of nghttp2-asio
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -15,6 +15,7 @@ Link: https://github.com/nghttp2/nghttp2-asio/pull/9
Link: https://github.com/nghttp2/nghttp2-asio/pull/25
Change-Id: Iec9619ce45e7e76f0781d39966d0b6c7cc6fa778
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
.zuul.yaml | 2 +-
README.md | 3 ++-
@@ -1,7 +1,7 @@
From ffc52b2e454ae4ac4fa1948cb76a9469026d453e Mon Sep 17 00:00:00 2001
From f71d4467409885078395c8d59c4390ddc1782d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Mon, 6 Oct 2025 22:35:27 +0200
Subject: [PATCH 19/38] ping: use a monotonic timer
Subject: [PATCH 19/42] ping: use a monotonic timer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -16,6 +16,7 @@ deprecated, use the other function.
Change-Id: I40383721ecb0f12bfcb3f638124a32150a29bf48
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/http/EventStream.cpp | 2 +-
src/http/EventStream.h | 4 ++--
@@ -1,7 +1,7 @@
From 4493316404f31354ea18bc92a1706a3834ad972b Mon Sep 17 00:00:00 2001
From f842f027aa462486c1cc5cb9c47e0398b3242fe7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Mon, 6 Oct 2025 22:50:11 +0200
Subject: [PATCH 20/38] tests: use a monotonic timer
Subject: [PATCH 20/42] tests: use a monotonic timer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -9,6 +9,7 @@ Organization: Wires
Change-Id: I89cdd08082b025643dac81788ca174d3c2177089
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
tests/restconf-eventstream.cpp | 2 +-
tests/restconf_utils.cpp | 6 +++---
@@ -1,7 +1,7 @@
From 8077a63ac97529d56782d2315f23c44f6036b85f Mon Sep 17 00:00:00 2001
From 462dca24ef3cb3ae8bb5c6f7a349b94308281f9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Thu, 23 Oct 2025 18:17:37 +0200
Subject: [PATCH 21/38] port to libyang v4
Subject: [PATCH 21/42] port to libyang v4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -41,6 +41,7 @@ Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/8990
Bug: https://github.com/CESNET/libyang/pull/2448
Depends-on: https://github.com/sysrepo/sysrepo/commit/6dc5641762962b93d54a54443e2fd43aa319a7a6
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 6 +++---
src/restconf/Server.cpp | 2 +-
@@ -1,7 +1,7 @@
From b4bf655502d949a5f351e6acd313f47eecefb062 Mon Sep 17 00:00:00 2001
From 4b08c23436972e80760abe397806867a1d4d486c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 13 Oct 2025 12:26:46 +0200
Subject: [PATCH 22/38] restconf: prevent lock order inversion
Subject: [PATCH 22/42] restconf: prevent lock order inversion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -29,6 +29,7 @@ callbacks to EventStream"), I am not sure.
See-also: 6bca750f866b5b14c4d9c3da68e5c8f1e4eee36c ("http: add optional callbacks to EventStream")
Change-Id: Ib6626c127ff2eb5feb1d17dece28e70265749df4
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/http/EventStream.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
@@ -1,7 +1,7 @@
From 27cbe6750bdfc9f346421e55ebe555b8c036d77c Mon Sep 17 00:00:00 2001
From 24a35b1f1424826202ecaebf7aa04dccdf6ad2f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 11 Nov 2025 15:01:21 +0100
Subject: [PATCH 23/38] refactor: do not pollute scope with unnecessary
Subject: [PATCH 23/42] refactor: do not pollute scope with unnecessary
variables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -13,6 +13,7 @@ nothing.
Change-Id: I5b9b1a077d44d088084c3b2b93359ab7464ec8aa
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -1,7 +1,7 @@
From 5592ae49cd7607fdcb2c9e554a521b53545e761b Mon Sep 17 00:00:00 2001
From 228aa9ea848d437565b5f90972a0c4b23b279337 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 21 Oct 2025 17:23:44 +0200
Subject: [PATCH 24/38] restconf: validate input for internal rpcs
Subject: [PATCH 24/42] restconf: validate input for internal rpcs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -23,6 +23,7 @@ the RPC.
Change-Id: I55296895e6993b4ca27d21ce2a64ec2d159a35fc
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
@@ -1,7 +1,7 @@
From c2413237501eea3125fe31a9701919d14402737f Mon Sep 17 00:00:00 2001
From 163ebff977aff8fea8e342f35314697f89e5bb82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 11 Nov 2025 17:30:33 +0100
Subject: [PATCH 25/38] tests: allow read from parts
Subject: [PATCH 25/42] tests: allow read from parts
ietf-subscribed-notifications for anonymous user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -16,6 +16,7 @@ access for users.
Change-Id: I50e49c8c60b7e6be47c51f3d8cd546fbb6f49294
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
tests/restconf-reading.cpp | 5 ++++-
tests/restconf_utils.cpp | 4 ++++
@@ -1,7 +1,7 @@
From aa04b0a99fb51aed998aa9f1ab0a527cc09e647f Mon Sep 17 00:00:00 2001
From 0f13a7262ddf58f400a53cfedb038344abb929f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 19 May 2025 12:11:09 +0200
Subject: [PATCH 26/38] restconf: establish-subscription RPC for subscribed
Subject: [PATCH 26/42] restconf: establish-subscription RPC for subscribed
notifications
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -21,6 +21,7 @@ the follow-up patch.
Change-Id: I0217e5abc56cfd73859dbcc610fb1f342dc33a10
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 8 +-
src/restconf/DynamicSubscriptions.cpp | 177 ++++++++++++++
@@ -1,7 +1,7 @@
From e2c8036130a2265476579ffa9f4354741b54bbd5 Mon Sep 17 00:00:00 2001
From b2be7b3b43cb95b5bfc1e0b774de7dbac4376809 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 13 Oct 2025 16:10:51 +0200
Subject: [PATCH 27/38] refactor: restconf stream request types
Subject: [PATCH 27/42] refactor: restconf stream request types
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -21,6 +21,7 @@ will not have it.
See-also: 97ceef119c900c37bbaa27860c3b43cfa6d69f95 ("restconf: refactor uri parser for stream URIs")
Change-Id: Idc1e05f7ff05cea84b5806f60e217605f75e7a9f
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 2 +-
src/restconf/uri.cpp | 15 ++++++++-------
@@ -1,7 +1,7 @@
From b3a55ae0a1ef9e092b0c8f0d7c3dbd7baa708cc8 Mon Sep 17 00:00:00 2001
From 5f4c781728d888d3e1c8db9c1c78c545caae824c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 29 Jul 2025 11:39:21 +0200
Subject: [PATCH 28/38] restconf: endpoint for subscribed notifications
Subject: [PATCH 28/42] restconf: endpoint for subscribed notifications
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -27,6 +27,7 @@ of boost::asio is not enough.
Change-Id: I07dcdd3fb9ef4f05f93ae6dda0e0d71094a0bbfc
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 1 +
src/restconf/DynamicSubscriptions.cpp | 127 ++++++++++++-
@@ -1,7 +1,7 @@
From 9c39cdd8a8a6bb8fb94d4f943313ec8c4a1823d7 Mon Sep 17 00:00:00 2001
From dc462f432a2360f4ed9c7b5e2a17051074674f01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 10 Nov 2025 19:58:36 +0100
Subject: [PATCH 29/38] restconf: dynamic subscriptions shutdown method
Subject: [PATCH 29/42] restconf: dynamic subscriptions shutdown method
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -13,6 +13,7 @@ cannot call its terminate() method.
Change-Id: I4532bbafff7c7386a18ed0636f1102842d2749fa
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/DynamicSubscriptions.cpp | 10 ++++++++++
src/restconf/DynamicSubscriptions.h | 1 +
@@ -1,7 +1,7 @@
From 3154d9209dc876fee43d9e83907ab44e06008c65 Mon Sep 17 00:00:00 2001
From ac1097419badcee117d5c90331db9fa5771bb842 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 14 Oct 2025 12:25:20 +0200
Subject: [PATCH 30/38] restconf: terminate subsc. notification streams after
Subject: [PATCH 30/42] restconf: terminate subsc. notification streams after
60s with no client
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -18,6 +18,7 @@ is 60 seconds.
Change-Id: Id399d108069704fa8ab79b9ef6ab855dd62cfc8d
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/DynamicSubscriptions.cpp | 72 ++++++++++++++++++---
src/restconf/DynamicSubscriptions.h | 22 ++++++-
@@ -1,7 +1,7 @@
From 22cfcbf52be604afe0caafc892f4b7befe03b9db Mon Sep 17 00:00:00 2001
From f8d6053c6777476384d9c32564e5faf355edbafa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 8 Apr 2025 17:00:59 +0200
Subject: [PATCH 31/38] restconf: add {kill,delete}-subscription RPCs
Subject: [PATCH 31/42] restconf: add {kill,delete}-subscription RPCs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -21,6 +21,7 @@ disconnects.
Change-Id: I443d6fd88f2797045b5ae0a7d7e1a761fe74e7cb
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/DynamicSubscriptions.cpp | 44 +++++
src/restconf/DynamicSubscriptions.h | 2 +
@@ -1,7 +1,7 @@
From c5558b12ee67280b6281b639c3d8652cec3c7fa6 Mon Sep 17 00:00:00 2001
From da35875a545a4709da0662bb6ea104dcdba85582 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Wed, 19 Mar 2025 14:39:05 +0100
Subject: [PATCH 32/38] restconf: add subscribed notifications filtering
Subject: [PATCH 32/42] restconf: add subscribed notifications filtering
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -12,6 +12,7 @@ filters.
Change-Id: Iee973a6a2d03b4a0d90f952afe5436ce701787ae
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 2 +-
src/restconf/DynamicSubscriptions.cpp | 13 ++++-
@@ -1,7 +1,7 @@
From fe91af1eb38888d7eacb36cb5a299bd3163f7c60 Mon Sep 17 00:00:00 2001
From 36b8ec2f65a456bf97b97ed4b3d74bb323cf85b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 14 Oct 2025 17:22:00 +0200
Subject: [PATCH 33/38] cmake: wrap long line
Subject: [PATCH 33/42] cmake: wrap long line
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -9,6 +9,7 @@ Organization: Wires
Change-Id: Id94e18d581dbfbe2e6d386be6a232544f9344eec
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1,7 +1,7 @@
From 817debab72d10f2f30e83f1630bebdcdf3ec9455 Mon Sep 17 00:00:00 2001
From f633e7ffd39955051d886b7977e8a8ecfffda2b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Mon, 10 Mar 2025 15:33:08 +0100
Subject: [PATCH 34/38] restconf: support replays in subscribed notifications
Subject: [PATCH 34/42] restconf: support replays in subscribed notifications
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -9,6 +9,7 @@ Organization: Wires
Change-Id: Idfc3ceb99c8111c5575c1c8b94d539f234fa43be
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 1 +
src/restconf/DynamicSubscriptions.cpp | 24 ++++-
@@ -1,7 +1,7 @@
From 7d6b1a463fdacefaf7a7057564f6f4d4a8cb4632 Mon Sep 17 00:00:00 2001
From f58dc52c4e7445a06484bce0bbfeac831004ce02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <tomas.pecka@cesnet.cz>
Date: Tue, 25 Mar 2025 11:06:26 +0100
Subject: [PATCH 35/38] restconf: refactor getting datastore from string
Subject: [PATCH 35/42] restconf: refactor getting datastore from string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -11,6 +11,7 @@ This will be useful when processing YANG push requests.
Change-Id: I1e76335c8d674e81890d6cd1e973adaf521eb205
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/uri.cpp | 19 +++++--------------
src/restconf/utils/sysrepo.cpp | 16 ++++++++++++++++
@@ -1,7 +1,7 @@
From c1d5d143020ddc51c3886b82e87d463cf3211fca Mon Sep 17 00:00:00 2001
From 8a541a83176eb44fbe501a91b7a4ef0576f60ba3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Fri, 21 Nov 2025 10:44:47 +0100
Subject: [PATCH 36/38] build: remove duplicate line
Subject: [PATCH 36/42] build: remove duplicate line
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -10,6 +10,7 @@ Organization: Wires
Fixes: 817debab restconf: support replays in subscribed notifications
Change-Id: I4d2ea8429a4cb7b77f8739aff7a26a03cf535756
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
@@ -1,7 +1,7 @@
From ed62a496744de0e0dc31171167d5d6f69f54af93 Mon Sep 17 00:00:00 2001
From 538dbbff9604c00fd3875c88d0ed19074dfa0bfb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Fri, 21 Nov 2025 12:54:44 +0100
Subject: [PATCH 37/38] remove obsolete targets
Subject: [PATCH 37/42] remove obsolete targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -9,6 +9,7 @@ Organization: Wires
Change-Id: Idde217a4ae1bc6f03657d9609e0ec1b0a47a9747
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 9 --------
src/clock.cpp | 62 --------------------------------------------------
@@ -1,7 +1,7 @@
From 5a1d0dac28c1a78e90d3906693228584adcf3ab1 Mon Sep 17 00:00:00 2001
From 6adfafa9324ee0bfd50d0dab7c7657138a4a55a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
Date: Thu, 20 Nov 2025 16:13:43 +0100
Subject: [PATCH 38/38] port to libyang v4.2
Subject: [PATCH 38/42] port to libyang v4.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -10,6 +10,7 @@ Organization: Wires
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/9012
Change-Id: I1ac6b25a3c1034f06917594732f066fd77d4b26b
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
CMakeLists.txt | 2 +-
src/restconf/Server.cpp | 10 +++++-----
@@ -0,0 +1,88 @@
From c617503c76dcfe75e73c5f1af3dd6c17c2ca3fd4 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sun, 28 Sep 2025 06:04:12 +0200
Subject: [PATCH 39/42] Add '--log-level LEVEL' command line option
Organization: Wires
The default 'trace' log level is quite verbose for production systems.
This commit changes the default to 'info' and adds a command line option
to control the log level.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/main.cpp | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/restconf/main.cpp b/src/restconf/main.cpp
index b1e2bc6..66c782d 100644
--- a/src/restconf/main.cpp
+++ b/src/restconf/main.cpp
@@ -19,6 +19,7 @@
#include <spdlog/sinks/ansicolor_sink.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <iostream>
#include <docopt.h>
#include <spdlog/spdlog.h>
#include <sysrepo-cpp/Session.hpp>
@@ -27,11 +28,12 @@
static const char usage[] =
R"(Rousette - RESTCONF server
Usage:
- rousette [--syslog] [--timeout <SECONDS>] [--help]
+ rousette [--syslog] [--timeout <SECONDS>] [--log-level <LEVEL>] [--help]
Options:
-h --help Show this screen.
-t --timeout <SECONDS> Change default timeout in sysrepo (if not set, use sysrepo internal).
--syslog Log to syslog.
+ --log-level <LEVEL> Set log level (trace, debug, info, warn, error, critical, off) [default: info].
)";
#ifdef HAVE_SYSTEMD
@@ -76,10 +78,34 @@ int main(int argc, char* argv [])
{
auto args = docopt::docopt(usage, {argv + 1, argv + argc}, true,""/* version */, true);
auto timeout = std::chrono::milliseconds{0};
+ auto logLevel = spdlog::level::info;
if (args["--timeout"]) {
timeout = std::chrono::milliseconds{args["--timeout"].asLong() * 1000};
}
+
+ if (args["--log-level"]) {
+ auto levelStr = args["--log-level"].asString();
+ if (levelStr == "trace") {
+ logLevel = spdlog::level::trace;
+ } else if (levelStr == "debug") {
+ logLevel = spdlog::level::debug;
+ } else if (levelStr == "info") {
+ logLevel = spdlog::level::info;
+ } else if (levelStr == "warn" || levelStr == "warning") {
+ logLevel = spdlog::level::warn;
+ } else if (levelStr == "error" || levelStr == "err") {
+ logLevel = spdlog::level::err;
+ } else if (levelStr == "critical") {
+ logLevel = spdlog::level::critical;
+ } else if (levelStr == "off") {
+ logLevel = spdlog::level::off;
+ } else {
+ std::cerr << "Invalid log level: " << levelStr << std::endl;
+ std::cerr << "Valid levels: trace, debug, info, warn, error, critical, off" << std::endl;
+ return 1;
+ }
+ }
if (args["--syslog"].asBool()) {
auto syslog_sink = std::make_shared<spdlog::sinks::syslog_sink_mt>("rousette", LOG_PID, LOG_USER, true);
auto logger = std::make_shared<spdlog::logger>("rousette", syslog_sink);
@@ -95,7 +121,7 @@ int main(int argc, char* argv [])
auto logger = std::make_shared<spdlog::logger>("rousette", stdout_sink);
spdlog::set_default_logger(logger);
}
- spdlog::set_level(spdlog::level::trace);
+ spdlog::set_level(logLevel);
/* We will parse URIs using boost::spirit's alnum/alpha/... matchers which are locale-dependent.
* Let's use something stable no matter what the system is using
--
2.43.0
@@ -0,0 +1,46 @@
From 3d4262c6c2e334fa6577a69e0483a19f638e43fd Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Thu, 19 Mar 2026 17:21:20 +0100
Subject: [PATCH 40/42] sr: lower log message severity to debug
Organization: Wires
On non-CzechLight hardware this message fires on every startup. It is
not a warning condition, and at debug level it won't clutter the log at
the default info level. Also lower the NACM startup diagnostic from
info to debug for the same reason.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/auth/Nacm.cpp | 2 +-
src/sr/OpticalEvents.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/auth/Nacm.cpp b/src/auth/Nacm.cpp
index 284fa85..a4cc8cc 100644
--- a/src/auth/Nacm.cpp
+++ b/src/auth/Nacm.cpp
@@ -98,7 +98,7 @@ Nacm::Nacm(sysrepo::Connection conn)
m_srSub.onModuleChange(
"ietf-netconf-acm", [&](auto session, auto, auto, auto, auto, auto) {
m_anonymousEnabled = validAnonymousNacmRules(session, ANONYMOUS_USER_GROUP);
- spdlog::info("NACM config validation: Anonymous user access {}", m_anonymousEnabled ? "enabled" : "disabled");
+ spdlog::debug("NACM config validation: Anonymous user access {}", m_anonymousEnabled ? "enabled" : "disabled");
return sysrepo::ErrorCode::Ok;
},
std::nullopt,
diff --git a/src/sr/OpticalEvents.cpp b/src/sr/OpticalEvents.cpp
index 3f78ddc..a2cefe7 100644
--- a/src/sr/OpticalEvents.cpp
+++ b/src/sr/OpticalEvents.cpp
@@ -47,7 +47,7 @@ OpticalEvents::OpticalEvents(sysrepo::Session session)
}
}
- spdlog::warn("Telemetry disabled. No CzechLight YANG modules found.");
+ spdlog::debug("Telemetry disabled. No CzechLight YANG modules found.");
}
sysrepo::ErrorCode OpticalEvents::onChange(sysrepo::Session session, const std::string& module)
--
2.43.0
@@ -0,0 +1,134 @@
From 2877c5a6a139b15e42f99c5aba4127b427154707 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Thu, 19 Mar 2026 17:21:25 +0100
Subject: [PATCH 41/42] restconf: add audit trail for datastore write
operations
Organization: Wires
Log an info message before and after committing changes to sysrepo,
matching the style of netopeer2's audit trail.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/Server.cpp | 14 ++++++++++++++
src/restconf/utils/sysrepo.cpp | 17 +++++++++++++++++
src/restconf/utils/sysrepo.h | 1 +
3 files changed, 32 insertions(+)
diff --git a/src/restconf/Server.cpp b/src/restconf/Server.cpp
index 3c7c3c7..15eec92 100644
--- a/src/restconf/Server.cpp
+++ b/src/restconf/Server.cpp
@@ -17,10 +17,12 @@
#include "restconf/Exceptions.h"
#include "restconf/NotificationStream.h"
#include "auth/Http.h"
+#include "NacmIdentities.h"
#include "restconf/Server.h"
#include "restconf/YangSchemaLocations.h"
#include "restconf/uri.h"
#include "restconf/utils/dataformat.h"
+#include "restconf/utils/sysrepo.h"
#include "restconf/utils/yang.h"
#include "sr/OpticalEvents.h"
@@ -594,8 +596,10 @@ void processPost(std::shared_ptr<RequestContext> requestCtx, const std::chrono::
createdNodes.begin()->newMeta(*modNetconf, "operation", "create");
yangInsert(*requestCtx, *createdNodes.begin());
+ spdlog::info("user \"{}\" committing changes to {} ...", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->sess.editBatch(*edit, sysrepo::DefaultOperation::Merge);
requestCtx->sess.applyChanges(timeout);
+ spdlog::info("user \"{}\" committed changes to {}.", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->res.write_head(201,
{
@@ -682,8 +686,10 @@ void processYangPatchImpl(const std::shared_ptr<RequestContext>& requestCtx, con
}
if (mergedEdits) {
+ spdlog::info("user \"{}\" committing changes to {} ...", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->sess.editBatch(*mergedEdits, sysrepo::DefaultOperation::Merge);
requestCtx->sess.applyChanges(timeout);
+ spdlog::info("user \"{}\" committed changes to {}.", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
}
}
@@ -726,12 +732,16 @@ void processPutOrPlainPatch(std::shared_ptr<RequestContext> requestCtx, const st
validateInputMetaAttributes(ctx, *edit);
if (requestCtx->req.method() == "PUT") {
+ spdlog::info("user \"{}\" committing changes to {} ...", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->sess.replaceConfig(edit, std::nullopt, timeout);
+ spdlog::info("user \"{}\" committed changes to {}.", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->res.write_head(edit ? 201 : 204, {CORS});
} else {
+ spdlog::info("user \"{}\" committing changes to {} ...", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->sess.editBatch(*edit, sysrepo::DefaultOperation::Merge);
requestCtx->sess.applyChanges(timeout);
+ spdlog::info("user \"{}\" committed changes to {}.", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->res.write_head(204, {CORS});
}
requestCtx->res.end();
@@ -763,8 +773,10 @@ void processPutOrPlainPatch(std::shared_ptr<RequestContext> requestCtx, const st
yangInsert(*requestCtx, *replacementNode);
}
+ spdlog::info("user \"{}\" committing changes to {} ...", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
requestCtx->sess.editBatch(*edit, sysrepo::DefaultOperation::Merge);
requestCtx->sess.applyChanges(timeout);
+ spdlog::info("user \"{}\" committed changes to {}.", requestCtx->sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(requestCtx->sess.activeDatastore()));
if (requestCtx->req.method() == "PUT") {
requestCtx->res.write_head(nodeExisted ? 204 : 201, {CORS});
@@ -1219,8 +1231,10 @@ Server::Server(
deletedNode->newMeta(*netconf, "operation", "delete");
}
+ spdlog::info("user \"{}\" committing changes to {} ...", sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(sess.activeDatastore()));
sess.editBatch(*edit, sysrepo::DefaultOperation::Merge);
sess.applyChanges(timeout);
+ spdlog::info("user \"{}\" committed changes to {}.", sess.getNacmUser().value_or(ANONYMOUS_USER), datastoreToString(sess.activeDatastore()));
} catch (const sysrepo::ErrorWithCode& e) {
if (e.code() == sysrepo::ErrorCode::Unauthorized) {
throw ErrorResponse(403, "application", "access-denied", "Access denied.", restconfRequest.path);
diff --git a/src/restconf/utils/sysrepo.cpp b/src/restconf/utils/sysrepo.cpp
index 9f14cc7..d3bcc39 100644
--- a/src/restconf/utils/sysrepo.cpp
+++ b/src/restconf/utils/sysrepo.cpp
@@ -38,4 +38,21 @@ sysrepo::Datastore datastoreFromString(const std::string& datastore)
throw std::runtime_error("Unknown datastore '" + datastore + "'");
}
+
+std::string datastoreToString(sysrepo::Datastore datastore)
+{
+ switch (datastore) {
+ case sysrepo::Datastore::Running:
+ return "running";
+ case sysrepo::Datastore::Operational:
+ return "operational";
+ case sysrepo::Datastore::Candidate:
+ return "candidate";
+ case sysrepo::Datastore::Startup:
+ return "startup";
+ case sysrepo::Datastore::FactoryDefault:
+ return "factory-default";
+ }
+ throw std::runtime_error("Unknown datastore");
+}
}
diff --git a/src/restconf/utils/sysrepo.h b/src/restconf/utils/sysrepo.h
index 0eced9e..b8dd399 100644
--- a/src/restconf/utils/sysrepo.h
+++ b/src/restconf/utils/sysrepo.h
@@ -27,4 +27,5 @@ public:
};
sysrepo::Datastore datastoreFromString(const std::string& datastore);
+std::string datastoreToString(sysrepo::Datastore datastore);
}
--
2.43.0
@@ -0,0 +1,37 @@
From 87f1984ea8d07d7e55c0ad08e24ba9adeefd6aca Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Thu, 19 Mar 2026 17:54:11 +0100
Subject: [PATCH 42/42] restconf: strip redundant fields from syslog/journald
log messages
Organization: Wires
When logging to syslog or journald, the timestamp, program name, and log
level are all provided by the logging infrastructure itself. Use a bare
message-only pattern to avoid the duplication.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/restconf/main.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/restconf/main.cpp b/src/restconf/main.cpp
index 66c782d..63f8760 100644
--- a/src/restconf/main.cpp
+++ b/src/restconf/main.cpp
@@ -110,11 +110,13 @@ int main(int argc, char* argv [])
auto syslog_sink = std::make_shared<spdlog::sinks::syslog_sink_mt>("rousette", LOG_PID, LOG_USER, true);
auto logger = std::make_shared<spdlog::logger>("rousette", syslog_sink);
spdlog::set_default_logger(logger);
+ spdlog::set_pattern("%v");
#ifdef HAVE_SYSTEMD
} else if (is_journald_active()) {
auto sink = std::make_shared<journald_sink<std::mutex>>();
auto logger = std::make_shared<spdlog::logger>("rousette", sink);
spdlog::set_default_logger(logger);
+ spdlog::set_pattern("%v");
#endif
} else {
auto stdout_sink = std::make_shared<spdlog::sinks::ansicolor_stdout_sink_mt>();
--
2.43.0