-
Notifications
You must be signed in to change notification settings - Fork 6
Administration
Starting with v3.2, RAIS has a rudimentary web-based administration API. It defaults to listen on port 12416, rather than the main port, to allow easier prevention of undesired usage. The S3 Demo exposes the administrative functionality via an nginx rule so that you can see how it works in a safe environment.
It currently has two endpoints: statistics and cache-purging.
Primarily for debugging or validating the application is doing what you expect, this endpoint is read-only and provides basic information about RAIS itself, including whether the info/tile caches are enabled, how well they're performing, what plugins are configured, what version and build of RAIS is running, and how long RAIS has been up.
To help automate RAIS when it's used on a site that has more than occasional image churn, this endpoint makes it trivial to purge all assets or just a single asset's ID. This comes in very handy when an image is uploaded and then replaced sometime later. And this is especially useful for caches with a long lifespan, as may be the case when RAIS is run for an exhibit that only has a handful of images.
An example form that posts a purge to RAIS can be seen in the S3 demo: https://github.com/uoregon-libraries/rais-image-server/blob/main/docker/s3demo/admin.go.html#L13-L34