summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatharina Drexel <katharina.drexel@bfh.ch>2019-08-14 09:52:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-14 09:53:56 +0000
commit1fd5e7bce7c99083f31454b48190cb42227e5394 (patch)
tree0023ff0101e9aa7c6cc0b74a296a13c8b948b75c
parenttypo fix in debian/rules: s/init/systemd/ (diff)
downloadnetdata-1fd5e7bce7c99083f31454b48190cb42227e5394.tar.xz
netdata-1fd5e7bce7c99083f31454b48190cb42227e5394.zip
adding package netdata-apache2
Signed-off-by: Katharina Drexel <katharina.drexel@bfh.ch> Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/control22
-rw-r--r--debian/local/apache2/netdata.conf21
-rw-r--r--debian/netdata-apache2.install1
-rw-r--r--debian/netdata-apache2.postinst39
-rw-r--r--debian/netdata-apache2.postrm28
-rw-r--r--debian/netdata.TODO4
6 files changed, 111 insertions, 4 deletions
diff --git a/debian/control b/debian/control
index 6a0d968cb..1c0ef4e9a 100644
--- a/debian/control
+++ b/debian/control
@@ -178,3 +178,25 @@ Description: real-time performance monitoring (web)
systems it runs using interactive web dashboards.
.
This package contains the web frontend.
+
+Package: netdata-apache2
+Section: net
+Architecture: all
+Depends:
+ netdata-core (>= ${source:Version}) | netdata-core-no-sse (>= ${source:Version}),
+ netdata-web (>= ${source:Version}),
+ apache2
+Enhances:
+ netdata-core,
+ netdata-core-no-sse,
+Description: real-time performance monitoring (apache integration)
+ Netdata is distributed, real-time, performance and health monitoring for
+ systems and applications. It provides insights of everything happening on the
+ systems it runs using interactive web dashboards.
+ .
+ Although the package comports a generic web server, it is recommended to run the
+ service through a "real" web server, let alone for security reasons
+ (encryption, authentication, ...).
+ .
+ This package contains some basic configuration for apache and enables the
+ necessary modules.
diff --git a/debian/local/apache2/netdata.conf b/debian/local/apache2/netdata.conf
new file mode 100644
index 000000000..23080de6a
--- /dev/null
+++ b/debian/local/apache2/netdata.conf
@@ -0,0 +1,21 @@
+<IfModule mod_proxy.c>
+ ProxyRequests Off
+ ProxyPreserveHost On
+
+ ProxyPass /netdata http://localhost:19999 connectiontimeout=5 timeout=30 keepalive=on
+ ProxyPassReverse /netdata http://localhost:19999
+</IfModule>
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ ProxyRequests Off
+ ProxyPreserveHost On
+
+ RewriteRule ^/netdata$ %{HTTP_HOST}/netdata/ [L,R=301]
+</IfModule>
+
+<Location /netdata>
+ <IfModule mod_headers.c>
+ Header always set Content-Security-Policy "default-src 'unsafe-inline' http: 'self' 'unsafe-eval'; script-src 'unsafe-inline' http: 'self' 'unsafe-eval'; style-src http: 'self' 'unsafe-inline'"
+ </IfModule>
+</Location>
diff --git a/debian/netdata-apache2.install b/debian/netdata-apache2.install
new file mode 100644
index 000000000..4338e0a70
--- /dev/null
+++ b/debian/netdata-apache2.install
@@ -0,0 +1 @@
+debian/local/apache2/*.conf etc/apache2/conf-available
diff --git a/debian/netdata-apache2.postinst b/debian/netdata-apache2.postinst
new file mode 100644
index 000000000..565006d0c
--- /dev/null
+++ b/debian/netdata-apache2.postinst
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+ configure)
+ if [ -x "$(which a2enmod)" ]
+ then
+ a2enmod proxy proxy_http rewrite
+ fi
+
+ if [ -x "$(which a2enconf)" ]
+ then
+ a2enconf netdata
+ fi
+
+ if [ -x "/etc/init.d/apache2" ]; then
+ if [ -n "$2" ]; then
+ _dh_action=restart
+ else
+ _dh_action=start
+ fi
+ invoke-rc.d apache2 $_dh_action || true
+ fi
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/netdata-apache2.postrm b/debian/netdata-apache2.postrm
new file mode 100644
index 000000000..ba3104845
--- /dev/null
+++ b/debian/netdata-apache2.postrm
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+ remove)
+ a2disconf netdata > /dev/null 2>&1 || true
+
+ if [ -x /etc/init.d/apache2 ] && [ -e /run/apache2/apache2.pid ]
+ then
+ invoke-rc.d apache2 restart || true
+ fi
+
+ ;;
+
+ purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/netdata.TODO b/debian/netdata.TODO
index 5081ead1f..1ba448d86 100644
--- a/debian/netdata.TODO
+++ b/debian/netdata.TODO
@@ -11,10 +11,6 @@
* migrate from user 'netdata' to '_netdata'.
-* add multiselect preseeding for netdata-web (as if it's netdata-apache2,
- containing apache2 conf snipped to enable netdata via reverse proxy
- and (optional) basic auth)
-
* finish ucf handling for netdata.conf
* keep depends minimal and put everything to recommends/suggests