From 9b9b792a217a8e446852753981318b2d43566e3d Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Fri, 27 Jan 2017 16:30:38 -0600 Subject: [PATCH] netdata: permissions fix and default config resolves #5623 Closes: #5624 [via git-merge-pr] --- srcpkgs/netdata/INSTALL | 1 - srcpkgs/netdata/files/netdata.conf | 14 ++++++++++++++ srcpkgs/netdata/files/netdata/run | 2 +- srcpkgs/netdata/template | 5 ++++- 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/netdata/files/netdata.conf diff --git a/srcpkgs/netdata/INSTALL b/srcpkgs/netdata/INSTALL index 14db8493d3..a0b2db750b 100644 --- a/srcpkgs/netdata/INSTALL +++ b/srcpkgs/netdata/INSTALL @@ -1,7 +1,6 @@ case ${ACTION} in post) chown _netdata:root var/lib/netdata/registry/ - chown -R _netdata:_netdata usr/share/netdata/web chown root usr/libexec/netdata/plugins.d/apps.plugin chmod 0755 usr/libexec/netdata/plugins.d/apps.plugin setcap cap_dac_read_search,cap_sys_ptrace+ep usr/libexec/netdata/plugins.d/apps.plugin diff --git a/srcpkgs/netdata/files/netdata.conf b/srcpkgs/netdata/files/netdata.conf new file mode 100644 index 0000000000..e6fd450449 --- /dev/null +++ b/srcpkgs/netdata/files/netdata.conf @@ -0,0 +1,14 @@ +# NetData Configuration +# +# To see defaults, grab one from your instance: +# http://localhost:19999/netdata.conf + +# global netdata configuration + +[global] + run as user = _netdata + web files owner = root + web files group = root + # Netdata is not designed to be exposed to potentially hostile networks + # See https://github.com/firehol/netdata/issues/164 + bind to = localhost diff --git a/srcpkgs/netdata/files/netdata/run b/srcpkgs/netdata/files/netdata/run index 75411c9746..cc14c38aed 100755 --- a/srcpkgs/netdata/files/netdata/run +++ b/srcpkgs/netdata/files/netdata/run @@ -5,4 +5,4 @@ for f in cache log; do chown -R _netdata:_netdata /var/${f}/netdata done -exec netdata -u _netdata -D +exec chpst -u _netdata:_netdata netdata -D diff --git a/srcpkgs/netdata/template b/srcpkgs/netdata/template index e103953606..b9c9452985 100644 --- a/srcpkgs/netdata/template +++ b/srcpkgs/netdata/template @@ -1,7 +1,7 @@ # Template file for 'netdata' pkgname=netdata version=1.5.0 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="pkg-config" makedepends="zlib-devel" @@ -18,11 +18,13 @@ checksum=764212e1c71dbf5cbcd0cc391b7be0ffd4fcfd5e3b603b4fdb4e0b21a9286dd8 post_install() { vsv netdata + vcopy ${FILESDIR}/netdata.conf etc/$pkgname/ } netdata-plugins-nodejs_package() { short_desc+=" - NodeJS Plugins" depends="${sourcepkg}>=${version}_${revision} nodejs" + noarch=yes pkg_install() { vmove usr/libexec/netdata/plugins.d/node.d.plugin vmove usr/libexec/netdata/node.d @@ -32,6 +34,7 @@ netdata-plugins-nodejs_package() { netdata-plugins-python_package() { short_desc+=" - Python Plugins" depends="${sourcepkg}>=${version}_${revision} python" + noarch=yes pkg_install() { vmove usr/libexec/netdata/plugins.d/python.d.plugin vmove usr/libexec/netdata/python.d