The dashboard stores, categorizes, and
displays errors and warnings from the
[inspectors-general](https://github.com/unitedstates/inspectors-general)
scrapers. Where relevant, URLs are provided as links. The dashboard displays
errors ahead of warnings, which simplifies triage.
To set up the dashboard, you will need to configure another index in Elasticsearch, provide the scrapers with a URL to which results can be uploaded, and configure a shared authentication token between the web app and the scrapers.
-
Run
rake elasticsearch:init_dashboard
to create the index. Later, if you need to re-create the index to make schema changes, you can do so withrake elasticsearch:init_dashboard force=true
. If it isn't set already, you will need to specify an index name for this inconfig/config.yaml
. See the example configuration file for details. -
In the
inspectors-general
directory, add adashboard
section toadmin.yml
, following the structure shown inadmin.yml.example
. In theurl
field, enter "https://<your_server_here>/dashboard/upload", substituting in the hostname of the web server. -
To avoid confusion from multiple scrapers uploading results to the same server, the upload endpoint requires authentication. The scraper must include a shared secret in the query string when uploading dashboard results to the web server. Otherwise, the results are not accepted. First, create a random string of characters for this purpose. Then, in the
inspectors-general
directory, enter this inadmin.yml
in thedashboard
section under the keysecret
. In theoversight.garden
directory, do the same withconfig/config.yaml
. Here too, the same string should be placed in thedashboard
section, under the keysecret
.
Once the above configuration is done, you should be able to restart the web server, run a scraper, and see the results appear on the dashboard. Note that results are only uploaded to the server right before Python exits; no incremental results will be visible partway through.