From 6bd1b85732da6e25aa68d5e4bb8766d3a94ced52 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: May 27 2021 22:09:42 +0000 Subject: Put the JSON file in /var/www by default (#10) By popular request! Signed-off-by: Adam Williamson --- diff --git a/README.md b/README.md index 4ba9628..e349bca 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This tool generates JSON and HTML data on Fedora nightly compose images. For each image, it tracks successful composes and - if openQA or Autocloud tests the image - whether it passed all tests. It stores details of failed tests, and the HTML output includes links to them. The HTML file is intended to be served for users to be able to conveniently locate the most recent successful and/or tested compose of a given image for Rawhide and Branched. -`/var/lib/fedora_nightlies` and `/var/www/fedora_nightlies` must exist and allow the user running the tool to read and create files. The JSON file is `/var/lib/fedora_nightlies/nightlies.json`, and the HTML file is `/var/www/fedora_nightlies/nightlies.html`; these also must be readable and writeable by the user running the tool. You are expected to configure some kind of web server to serve out `nightlies.html`, so it must be allowed to read that file. +`/var/www/fedora_nightlies` must exist and allow the user running the tool to read and create files. The JSON file is `/var/www/fedora_nightlies/nightlies.json`, and the HTML file is `/var/www/fedora_nightlies/nightlies.html`; these also must be readable and writeable by the user running the tool. You are expected to configure some kind of web server to serve out `nightlies.html` (and optionally the JSON file also), so it must be allowed to read it/them. To initialize the data, run the script directly (or as `fedora_nightlies` after doing `python setup.py install`). To use the fedora-messaging consumer which updates the data automatically whenever a compose appears or testing for one completes, ensure `fedora-messaging` is installed, run `python setup.py install`, copy `fedora_nightlies.toml` to `/etc/fedora-messaging` and adjust it as necessary (at least change the queue name), and enable and start the systemd service: diff --git a/fedora_nightlies.py b/fedora_nightlies.py index 8dcb6fb..0b1dd70 100755 --- a/fedora_nightlies.py +++ b/fedora_nightlies.py @@ -377,7 +377,7 @@ class Nightlies(object): self.datafile = datafile self.htmlfile = htmlfile if not self.datafile: - self.datafile = '/var/lib/fedora_nightlies/nightlies.json' + self.datafile = '/var/www/fedora_nightlies/nightlies.json' if not self.htmlfile: self.htmlfile = '/var/www/fedora_nightlies/nightlies.html' logger.debug("Data file: %s", self.datafile) diff --git a/fedora_nightlies.toml b/fedora_nightlies.toml index 604df39..3e4d769 100644 --- a/fedora_nightlies.toml +++ b/fedora_nightlies.toml @@ -54,7 +54,7 @@ routing_keys = ["org.fedoraproject.prod.openqa.job.done", [consumer_config] # JSON data file location. If not set, default -# /var/lib/fedora_nightlies/nightlies.json will be used +# /var/www/fedora_nightlies/nightlies.json will be used #datafile = "/tmp/nightlies.json" # HTML output file location. If not set, default # /var/www/fedora_nightlies/nightlies.html will be used