From cbab290576e3f9cded8117553d0d54dd07a80458 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 21 Jun 2020 14:22:20 +0200 Subject: [PATCH] Set metrics doc and config --- CHANGELOG.md | 5 +++++ Dockerfile | 2 +- README.md | 9 ++++++++- files/lighttpd.conf | 3 +-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9540e89..a96e8b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog ## Unreleased +* Update BackupPC to 4.4.0 +* Update perl lib BackupPC::XS to 0.62 +* Update rsync-bpc to 3.1.2.2 +* Add JSON::RS perl dependency to allow BackupPC metrics in JSON format +* Update documentation about metrics ## [4.3.2-6 - 01/06/2020] ### Changed diff --git a/Dockerfile b/Dockerfile index 1cf8168..ada7f8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ENV PAR2_VERSION v0.8.1 RUN apk --no-cache --update add \ rsync tar bash shadow ca-certificates \ supervisor \ - perl perl-archive-zip perl-xml-rss perl-cgi perl-file-listing \ + perl perl-archive-zip perl-xml-rss perl-cgi perl-file-listing perl-json-xs \ expat samba-client iputils openssh openssl rrdtool ttf-dejavu \ msmtp lighttpd lighttpd-mod_auth gzip apache2-utils tzdata libstdc++ libgomp \ && apk --no-cache --update -X http://dl-cdn.alpinelinux.org/alpine/edge/testing add par2cmdline \ diff --git a/README.md b/README.md index 28b3451..4da0420 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ docker run \ ``` Latest BackupPC 4.x docker image will be downloaded if needed, and started. -After starting, browse http://YOUR_SERVER_IP:8080 to access the BackupPC web Admin UI. +After starting, browse http://YOUR_SERVER_IP:8080 to access the BackupPC Admin Web UI. The default credentials are: - **username:** backuppc @@ -278,6 +278,13 @@ docker run \ adferrand/backuppc ``` +### Metrics + +Metrics are available on a dedicated endpoint. For example, if the URL to access the BackupPC Admin Web UI is `http://YOUR_SERVER_IP:8080`, then use: +* `http://YOUR_SERVER_IP:8080/BackupPC_Admin?action=metrics&format=json` to get the metrics in JSON format +* `http://YOUR_SERVER_IP:8080/BackupPC_Admin?action=metrics&format=rss` to get the metrics in RSS format +* `http://YOUR_SERVER_IP:8080/BackupPC_Admin?action=metrics&format=prometheus` to get the metrics in Prometheus format + ### Timezone By default the timezone of this docker is set to UTC. To modify it, you can specify a tzdata-compatible timezone in the environment variable `TZ`. diff --git a/files/lighttpd.conf b/files/lighttpd.conf index 64bea97..2415db5 100644 --- a/files/lighttpd.conf +++ b/files/lighttpd.conf @@ -15,5 +15,4 @@ alias.url += ( "/BackupPC" => "/var/www/html/BackupPC" ) cgi.assign += ( ".cgi" => "/usr/bin/perl" ) cgi.assign += ( "BackupPC_Admin" => "/usr/bin/perl" ) -url.redirect = ("^/$" => "/BackupPC_Admin") - +url.redirect = ("^/(\?.*)?$" => "/BackupPC_Admin$1")