commit f106c86bb00e26837733bea5013e44cf39c7c0881b253b8318a8c0d5c6179493 Author: Christian Goll Date: Wed Nov 6 14:22:19 2024 +0000 - Add /srv/www directories to filelist [bsc#1231027] OBS-URL: https://build.opensuse.org/package/show/network:cluster/ganglia-web?expand=0&rev=24 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-added-of-download_js.patch b/0001-added-of-download_js.patch new file mode 100644 index 0000000..df80276 --- /dev/null +++ b/0001-added-of-download_js.patch @@ -0,0 +1,145 @@ +From 3d5c9c2e308123a9d37e7cbab33b854a304bb381 Mon Sep 17 00:00:00 2001 +From: Christian Goll +Date: Fri, 6 Dec 2019 16:42:28 +0100 +Subject: [PATCH 1/2] added of download_js + +--- + download_js.sh | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 126 insertions(+) + create mode 100755 download_js.sh + +diff --git a/download_js.sh b/download_js.sh +new file mode 100755 +index 0000000..67e26fd +--- /dev/null ++++ b/download_js.sh +@@ -0,0 +1,126 @@ ++#!/bin/bash ++CONFFILE="/srv/www/htdocs/ganglia-web/conf_default.php" ++SAVEDIR='/srv/www/htdocs/ganglia-web' ++PHPCONFDIR='/etc/apache2/conf.d/' ++PHPCONFNAME='conf.php' ++TARBALL='/tmp/ajax_ganglia.tar.gz' ++RESCRIPT='/tmp/download_js.sh' ++SUFFIX='ajax_libs' ++TMPDIR='/tmp' ++ ++function get_conf() { ++declare -f -F conf_stor > /dev/null ++if [ $? -eq 0 ] ; then ++ conf_stor ++else ++ cat ${CONFFILE} ++fi ++} ++ ++function usage() { ++cat < /dev/null ++ if [ $? -eq 0 ] ; then ++ echo "This script was recreated so could not recreate it." ++ exit 1 ++ fi ++ cat << EOF > $RESCRIPT ++#!/bin/bash ++# this file was recreated on $(uname -n) at $(date) ++function conf_stor() { ++cat <> $RESCRIPT ++ cat << EOF >> $RESCRIPT ++ ++ENDCONF ++} ++EOF ++ cat $0 | sed -e 's@#!/bin/bash@@' \ ++ -e 's@usage_set=1@usage_set=0@' \ ++ -e 's@tarball=0@tarball=1@' >> $RESCRIPT ++ echo "wrote $RESCRIPT" ++ exit 0 ++fi ++ ++ ++which curl &> /dev/null || echo "need curl to download ajax libraries" ++which curl &> /dev/null || exit 1 ++ ++if [ $tarball -eq 1 ] ; then ++ test -d ${TMPDIR}/${SUFFIX} || mkdir -vp ${TMPDIR}/${SUFFIX} ++ PHPCONFFILELOC=${TMPDIR}/${SUFFIX}/${PHPCONFNAME} ++ cd ${TMPDIR} ++else ++ test -d ${SAVEDIR}/${SUFFIX} || mkdir -vp ${SAVEDIR}/${SUFFIX} ++ PHPCONFFILELOC=${PHPCONFDIR}/${PHPCONFNAME} ++ cd ${SAVEDIR} ++fi ++ ++for lib_line in $(get_conf | grep -e '^$conf.* = \"https://cdnjs' | tr ' ' '@') ; do ++ conf_line=$(echo $lib_line | cut -f 1 -d '@') ++ url=$(echo $lib_line | cut -f 3 -d '@' |tr -d '"' | tr -d ';') ++ file_name=$(basename $url) ++ echo -n "getting ${file_name}: " ++ curl -# $url -o ${SUFFIX}/$file_name ++ echo "$conf_line = \"${SAVEDIR}/${SUFFIX}/${file_name}\";" >> ${PHPCONFFILELOC} ++done ++if [ $tarball -eq 1 ] ; then ++ tar czf ${TARBALL} ${SUFFIX} ++ echo "created ${TARBALL} , which also contains ${PHPCONFNAME}" ++fi ++cd - > /dev/null ++ +-- +2.16.4 + diff --git a/0002-looking-for-systemwide-user-config.patch b/0002-looking-for-systemwide-user-config.patch new file mode 100644 index 0000000..ca2c5db --- /dev/null +++ b/0002-looking-for-systemwide-user-config.patch @@ -0,0 +1,28 @@ +From b88b085b67e48ec5baf1bc66a973beb31b737360 Mon Sep 17 00:00:00 2001 +From: Christian Goll +Date: Mon, 9 Dec 2019 11:52:48 +0100 +Subject: [PATCH 2/2] looking for systemwide user config + +--- + eval_conf.php | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/eval_conf.php b/eval_conf.php +index b39fb2e..5e3d884 100644 +--- a/eval_conf.php ++++ b/eval_conf.php +@@ -12,6 +12,11 @@ require_once $base_dir . "/conf_default.php"; + require_once 'lib/GangliaAcl.php'; + require_once 'lib/GangliaAuth.php'; + ++# Include system-wide overrides if they exist. ++if( file_exists( "/etc/ganglia/conf.d/conf.php" ) ) { ++ include_once "/etc/ganglia/conf.d/conf.php"; ++} ++ + # Include user-defined overrides if they exist. + if( file_exists( $base_dir . "/conf.php" ) ) { + include_once $base_dir . "/conf.php"; +-- +2.16.4 + diff --git a/README.SUSE b/README.SUSE new file mode 100644 index 0000000..29247af --- /dev/null +++ b/README.SUSE @@ -0,0 +1,10 @@ +* The apache2 php7 or php5 module must be enabled , before ganglia-web works. + SLE-12* is shipped with php5 and SLE-15* is shipped with php7, for this + products you also have to add the "Web and Scripting Module". This can be done + with a2enmod php7 or a2enmod php5 + apache2 must be restarted after this +* The web interface uses some external java script libraries for a better user + experience. The script download_js.sh can be used to download this libraries + from a host with internet connection. + +-- cgoll@suse.de diff --git a/ganglia-httpd24.conf.d b/ganglia-httpd24.conf.d new file mode 100644 index 0000000..03406c7 --- /dev/null +++ b/ganglia-httpd24.conf.d @@ -0,0 +1,12 @@ +# +# Ganglia monitoring system php web frontend +# +# Make sure to enable PHP. Depending on the version used. +# For php5 execute "a2enmod php5", +# for php7 execute "a2enmod php7". +Alias /ganglia WEBPATH + + + Require all granted + # Require host example.org + diff --git a/ganglia-web-3.7.5.tar.gz b/ganglia-web-3.7.5.tar.gz new file mode 100644 index 0000000..e53ab3d --- /dev/null +++ b/ganglia-web-3.7.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64b5eb6c196e1a6b67614a873b5ab914f64b9a182d3d0024ff56abe73e5006eb +size 712659 diff --git a/ganglia-web.changes b/ganglia-web.changes new file mode 100644 index 0000000..c670d0b --- /dev/null +++ b/ganglia-web.changes @@ -0,0 +1,58 @@ +------------------------------------------------------------------- +Sat Sep 28 07:03:17 UTC 2024 - Thorsten Kukuk + +- Add /srv/www directories to filelist [bsc#1231027] + +------------------------------------------------------------------- +Fri Jan 29 14:53:55 UTC 2021 - Christian Goll + +- updated to 3.7.5 which fixes bsc#1179835 +- various bugfixes and enhancements, highlights are: + * heatmap coloring enhanced + * Fix XSS from OBB#1005024 (https://www.openbugbounty.org/reports/1005024/) + * uses `httponly` and `secure` flags in setcookie calls + * add the available memory to the graph, if present +- Possible XSS via ce & cs parameters in header.php are no longer present + in this version (bsc#1160761, CVE-2019-20378). + +------------------------------------------------------------------- +Wed Dec 4 12:54:20 UTC 2019 - Christian Goll + +- updated to version 3.7.4 +- added patches for a global user config under /etc/ganglia/conf.d/ + and added download_js.sh which can download the external java + script libararies. + * new file: 0001-added-of-download_js.patch which adds download_js.sh + * new file: 0002-looking-for-systemwide-user-config.patch which + makes ganglia-web to serach for config in /etc/ganglia/conf.d/ + +------------------------------------------------------------------- +Mon Apr 16 21:24:26 UTC 2018 - eich@suse.com + +- Fix comment in config file to cover both php5 and php7 + (bsc#1088887). + +------------------------------------------------------------------- +Tue Apr 10 14:53:10 UTC 2018 - cgoll@suse.com + +- Removed all explicit php dependencies (bsc#1088887) + * updated README.SUSE + +------------------------------------------------------------------- +Mon Oct 16 11:20:02 UTC 2017 - cgoll@suse.com + +- update to version 3.7.2 + +------------------------------------------------------------------- +Tue Oct 27 20:52:53 UTC 2015 - scorot@free.fr + +- version 3.6.2 + * Performance improvements + * New clearer heatmaps + * Other minor improvements and fixes + +------------------------------------------------------------------- +Wed May 1 12:03:10 UTC 2013 - scorot@free.fr + +- first package + diff --git a/ganglia-web.spec b/ganglia-web.spec new file mode 100644 index 0000000..4ab256f --- /dev/null +++ b/ganglia-web.spec @@ -0,0 +1,95 @@ +# +# spec file for package ganglia-web +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define web_prefixdir /srv/www/htdocs/ganglia-web +%define gittag f5bdfca75f9f5d701c8f8e9310f7801cd2e62799 + +Name: ganglia-web +Version: 3.7.5 +Release: 0 +Summary: Ganglia web frontend +License: BSD-3-Clause +Group: System/Monitoring +URL: http://ganglia.info/ +Source0: https://github.com/ganglia/ganglia-web/archive/%{gittag}.tar.gz#/ganglia-web-%{version}.tar.gz +Source1: ganglia-httpd24.conf.d +Source2: README.SUSE +Patch1: 0001-added-of-download_js.patch +Patch2: 0002-looking-for-systemwide-user-config.patch +BuildRequires: apache2 +BuildRequires: fdupes +BuildRequires: rsync +Requires: apache2 +Requires: mod_php_any +Requires: php +Requires: php-gd +Requires: php-xml +Requires: rrdtool +Recommends: ganglia-gmetad +BuildArch: noarch + +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +This package provides a web frontend to display the XML tree published by +ganglia, and to provide historical graphs of collected metrics. This website is +written in the PHP5/7 language and uses the Dwoo templating engine. + +%prep +%setup -q -n %{name}-%{gittag} +%autopatch -p1 + +%build +cp %SOURCE2 . + +%install +%{__sed} -i 's,www-data,abuild,' Makefile +%{__sed} -i 's,/usr/share/ganglia-webfrontend,%{buildroot}%{web_prefixdir},' Makefile +%{__sed} -i 's,WEBPATH,%{web_prefixdir},' %SOURCE1 +%{__sed} -i 's,/etc/ganglia-web,%{buildroot}/etc/apache2/conf.d,' Makefile +%{__sed} -i 's,/var/lib/ganglia,%{buildroot}/var/lib/ganglia,' Makefile + +make install +install -d %{buildroot}/etc/apache2/conf.d +install -m 644 %SOURCE1 %{buildroot}/etc/apache2/conf.d/%{name}.conf +mkdir -pv %{buildroot}%{_docdir}/%{name}/ +cp -v download_js.sh %{buildroot}%{_docdir}/%{name}/download_js.sh +# fix suprious buildroot in config +%{__sed} -i 's@%{buildroot}@@' %{buildroot}/%{web_prefixdir}/conf_default.php + +%fdupes %{buildroot}%{web_prefixdir} +%fdupes %{buildroot}%{_localstatedir}/lib/ganglia-web + +%files +%defattr(-,root,root) +%doc AUTHORS TODO README README.SUSE +%{_docdir}/%{name}/download_js.sh +%license COPYING +%dir /srv/www +%dir /srv/www/htdocs +%dir %{web_prefixdir}/ +%dir %{web_prefixdir}/dwoo +%{web_prefixdir}/* +%config(noreplace) /etc/apache2/conf.d/%{name}.conf +%dir %{_localstatedir}/lib/ganglia-web +%{_localstatedir}/lib/ganglia-web/conf +%attr(0755,wwwrun,www)%{_localstatedir}/lib/%{name}/dwoo +%attr(0755,wwwrun,www)%{_localstatedir}/lib/%{name}/dwoo/compiled +%attr(0755,wwwrun,www)%{_localstatedir}/lib/%{name}/dwoo/cache + +%changelog