Skip to content

Commit

Permalink
netdata: 1.46.1 -> 1.47.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoriguchi committed Aug 29, 2024
1 parent f02fa2f commit ffb1e9c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 38 deletions.
8 changes: 0 additions & 8 deletions nixos/modules/services/monitoring/netdata.nix
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,6 @@ in {
permissions = "u+rx,g+x,o-rwx";
};

"logs-management.plugin" = {
source = "${cfg.package}/libexec/netdata/plugins.d/logs-management.plugin.org";
capabilities = "cap_dac_read_search,cap_syslog+ep";
owner = cfg.user;
group = cfg.group;
permissions = "u+rx,g+x,o-rwx";
};

"slabinfo.plugin" = {
source = "${cfg.package}/libexec/netdata/plugins.d/slabinfo.plugin.org";
capabilities = "cap_dac_override+ep";
Expand Down
53 changes: 26 additions & 27 deletions pkgs/tools/system/netdata/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
}:

stdenv.mkDerivation rec {
version = "1.46.1";
version = "1.47.0";
pname = "netdata";

src = fetchFromGitHub {
owner = "netdata";
repo = "netdata";
rev = "v${version}";
hash = if withCloudUi
then "sha256-tFjczhJ7bIEUDZx3MxYBu4tGkJhoQn5V79D4sLV2o8U="
then "sha256-eMapy4HQaEblDfZt2uVSfBWRlkstX7TxZDBgSv5bW/I="
# we delete the v2 GUI after fetching
else "sha256-uW3jRiJjFIFSfmmavM3KVF985F8nMKa+lQAgNBZvKyE=";
else "sha256-Gx7u3Owh/fVAnSw91xfdcmyx4m+bvQAvDaUxzXQ36/0=";
fetchSubmodules = true;

# Remove v2 dashboard distributed under NCUL1. Make sure an empty
Expand All @@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkg-config makeWrapper go ninja ]
++ lib.optionals withCups [ cups.dev ];
# bash is only used to rewrite shebangs
buildInputs = [ bash curl jemalloc json_c libuv zlib libyaml ]
buildInputs = [ bash curl jemalloc json_c libuv zlib libyaml lm_sensors ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ]
++ lib.optionals (!stdenv.isDarwin) [ libcap libuuid ]
++ lib.optionals withCups [ cups ]
Expand All @@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
./dashboard-v2-removal.patch
];

# Guard against unused buld-time development inputs in closure. Without
# Guard against unused build-time development inputs in closure. Without
# the ./skip-CONFIGURE_COMMAND.patch patch the closure retains inputs up
# to bootstrap tools:
# https://github.com/NixOS/nixpkgs/pull/175719
Expand All @@ -94,8 +94,6 @@ stdenv.mkDerivation rec {
$out/libexec/netdata/plugins.d/slabinfo.plugin.org
mv $out/libexec/netdata/plugins.d/debugfs.plugin \
$out/libexec/netdata/plugins.d/debugfs.plugin.org
mv $out/libexec/netdata/plugins.d/logs-management.plugin \
$out/libexec/netdata/plugins.d/logs-management.plugin.org
${lib.optionalString withSystemdJournal ''
mv $out/libexec/netdata/plugins.d/systemd-journal.plugin \
$out/libexec/netdata/plugins.d/systemd-journal.plugin.org
Expand All @@ -115,30 +113,31 @@ stdenv.mkDerivation rec {
'';

preConfigure = lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace src/collectors/python.d.plugin/python_modules/third_party/lm_sensors.py \
--replace-fail 'ctypes.util.find_library("sensors")' '"${lm_sensors.out}/lib/libsensors${stdenv.hostPlatform.extensions.sharedLibrary}"'
'' + ''
export GOCACHE=$TMPDIR/go-cache
export GOPATH=$TMPDIR/go
export GOPROXY=file://${passthru.netdata-go-modules}
export GOSUMDB=off
substituteInPlace packaging/cmake/Modules/NetdataGoTools.cmake \
--replace-fail \
'GOPROXY=https://proxy.golang.org' \
'GOPROXY=file://${passthru.netdata-go-modules}'
# Prevent the path to be caught into the Nix store path.
substituteInPlace CMakeLists.txt \
--replace-fail 'set(CACHE_DIR "''${CMAKE_INSTALL_PREFIX}/var/cache/netdata")' 'set(CACHE_DIR "/var/cache/netdata")' \
--replace-fail 'set(CONFIG_DIR "''${CMAKE_INSTALL_PREFIX}/etc/netdata")' 'set(CONFIG_DIR "/etc/netdata")' \
--replace-fail 'set(LIBCONFIG_DIR "''${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")' 'set(LIBCONFIG_DIR "${placeholder "out"}/share/netdata/conf.d")' \
--replace-fail 'set(LOG_DIR "''${CMAKE_INSTALL_PREFIX}/var/log/netdata")' 'set(LOG_DIR "/var/log/netdata")' \
--replace-fail 'set(PLUGINS_DIR "''${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata/plugins.d")' 'set(PLUGINS_DIR "${placeholder "out"}/libexec/netdata/plugins.d")' \
--replace-fail 'set(VARLIB_DIR "''${CMAKE_INSTALL_PREFIX}/var/lib/netdata")' 'set(VARLIB_DIR "/var/lib/netdata")' \
--replace-fail 'set(pkglibexecdir_POST "''${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata")' 'set(pkglibexecdir_POST "${placeholder "out"}/libexec/netdata")' \
--replace-fail 'set(localstatedir_POST "''${CMAKE_INSTALL_PREFIX}/var")' 'set(localstatedir_POST "/var")' \
--replace-fail 'set(sbindir_POST "''${CMAKE_INSTALL_PREFIX}/usr/sbin")' 'set(sbindir_POST "${placeholder "out"}/bin")' \
--replace-fail 'set(configdir_POST "''${CMAKE_INSTALL_PREFIX}/etc/netdata")' 'set(configdir_POST "/etc/netdata")' \
--replace-fail 'set(libconfigdir_POST "''${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")' 'set(libconfigdir_POST "${placeholder "out"}/share/netdata/conf.d")' \
--replace-fail 'set(cachedir_POST "''${CMAKE_INSTALL_PREFIX}/var/cache/netdata")' 'set(libconfigdir_POST "/var/cache/netdata")' \
--replace-fail 'set(registrydir_POST "''${CMAKE_INSTALL_PREFIX}/var/lib/netdata/registry")' 'set(registrydir_POST "/var/lib/netdata/registry")' \
--replace-fail 'set(varlibdir_POST "''${CMAKE_INSTALL_PREFIX}/var/lib/netdata")' 'set(varlibdir_POST "/var/lib/netdata")'
--replace-fail 'set(CACHE_DIR "''${NETDATA_RUNTIME_PREFIX}/var/cache/netdata")' 'set(CACHE_DIR "/var/cache/netdata")' \
--replace-fail 'set(CONFIG_DIR "''${NETDATA_RUNTIME_PREFIX}/etc/netdata")' 'set(CONFIG_DIR "/etc/netdata")' \
--replace-fail 'set(LIBCONFIG_DIR "''${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/conf.d")' 'set(LIBCONFIG_DIR "${placeholder "out"}/share/netdata/conf.d")' \
--replace-fail 'set(LOG_DIR "''${NETDATA_RUNTIME_PREFIX}/var/log/netdata")' 'set(LOG_DIR "/var/log/netdata")' \
--replace-fail 'set(PLUGINS_DIR "''${NETDATA_RUNTIME_PREFIX}/usr/libexec/netdata/plugins.d")' 'set(PLUGINS_DIR "${placeholder "out"}/libexec/netdata/plugins.d")' \
--replace-fail 'set(VARLIB_DIR "''${NETDATA_RUNTIME_PREFIX}/var/lib/netdata")' 'set(VARLIB_DIR "/var/lib/netdata")' \
--replace-fail 'set(pkglibexecdir_POST "''${NETDATA_RUNTIME_PREFIX}/usr/libexec/netdata")' 'set(pkglibexecdir_POST "${placeholder "out"}/libexec/netdata")' \
--replace-fail 'set(localstatedir_POST "''${NETDATA_RUNTIME_PREFIX}/var")' 'set(localstatedir_POST "/var")' \
--replace-fail 'set(sbindir_POST "''${NETDATA_RUNTIME_PREFIX}/''${BINDIR}")' 'set(sbindir_POST "${placeholder "out"}/bin")' \
--replace-fail 'set(configdir_POST "''${NETDATA_RUNTIME_PREFIX}/etc/netdata")' 'set(configdir_POST "/etc/netdata")' \
--replace-fail 'set(libconfigdir_POST "''${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/conf.d")' 'set(libconfigdir_POST "${placeholder "out"}/share/netdata/conf.d")' \
--replace-fail 'set(cachedir_POST "''${NETDATA_RUNTIME_PREFIX}/var/cache/netdata")' 'set(libconfigdir_POST "/var/cache/netdata")' \
--replace-fail 'set(registrydir_POST "''${NETDATA_RUNTIME_PREFIX}/var/lib/netdata/registry")' 'set(registrydir_POST "/var/lib/netdata/registry")' \
--replace-fail 'set(varlibdir_POST "''${NETDATA_RUNTIME_PREFIX}/var/lib/netdata")' 'set(varlibdir_POST "/var/lib/netdata")'
'';

cmakeFlags = [
Expand Down Expand Up @@ -179,9 +178,9 @@ stdenv.mkDerivation rec {
pname = "netdata-go-plugins";
inherit version src;

sourceRoot = "${src.name}/src/go/collectors/go.d.plugin";
sourceRoot = "${src.name}/src/go/plugin/go.d";

vendorHash = "sha256-fK6pboXgJom77iakb+CJvNuweQjLIrpS7suWRNY/KM4=";
vendorHash = "sha256-NZ1tg+lvXNgypqmjjb5f7dHH6DIA9VOa4PMM4eq11n0=";
doCheck = false;
proxyVendor = true;

Expand Down
7 changes: 4 additions & 3 deletions pkgs/tools/system/netdata/ndsudo-fix-path.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/netdata/netdata/security/advisories/GHSA-pmhq-4cxq-wj93

diff --git a/src/collectors/plugins.d/ndsudo.c b/src/collectors/plugins.d/ndsudo.c
index 8b4d76f46..68fa52d38 100644
index d53ca9f28..b42a121bf 100644
--- a/src/collectors/plugins.d/ndsudo.c
+++ b/src/collectors/plugins.d/ndsudo.c
@@ -357,9 +357,6 @@ int main(int argc, char *argv[]) {
Expand All @@ -12,5 +12,6 @@ index 8b4d76f46..68fa52d38 100644
- char new_path[] = "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
- putenv(new_path);
-
bool found = false;
char filename[FILENAME_MAX];
setuid(0);
setgid(0);
setegid(0);

0 comments on commit ffb1e9c

Please sign in to comment.