HOW TO SETUP
------------

0. Install requirements
-----------------------

This build process requires perl-doc, otherwise the scripts will fail silently.
Additionally rsync is used.


1. Building the gallery
-----------------------

Checkout the munin repository.
Only the data below contrib/plugin-gallery is required.

The gallery is created as a static HTML export.
You may want to run the script "gallery-build.sh" regularly.

Simply run "gallery-build.sh" with a target directory of your choice.
BEWARE: the previous content of the target directory is removed.

The script retrieves the current state of the remote repositories while building the gallery.
The local checkout directory is only used for the build scripts. Thus you will rarely need to
update it.


2. Webserver DocumentRoot
-------------------------

The "gallery-build.sh" script requires only a single parameter: the target directory of the build
process.
You need to configure your webserver to publish this directory.
Take care for file permissions: the directory needs to be accessible by the user running the
webserver.

Setup a vhost for the gallery in your webservers configuration, e.g. for Apache2:

  <VirtualHost *>
      ServerName munin-gallery.example.org
      DocumentRoot /some/path/gallery-html
      <Directory /some/path/gallery-html>
          Require all granted
      </Directory>
  </VirtualHost>

Media links within the templates are absolute (e.g. /static/...) - thus you need a separate domain
(vhost) for the munin gallery.


3. Setup a daily cronjob
------------------------

Place a file with content like this under /etc/cron.d/

------ 8< ------
# Create fresh build of the Munin Plugin Gallery
10 22 * * *   johndoe   chronic /home/johndoe/projects/munin/contrib/plugin-gallery/gallery-build.sh /home/johndoe/gallery-html
------ >8 ------

"chronic" (from "moreutils") is useful here: it will suppress output, as long as the script exited
successfully.
