A web service that shows you a random image
10K+
A web service that displays a random image, made primarily to show random pictures of Blåhaj on my website kaesebrot.eu/blahaj :)
The service is available as a container on Docker hub: https://hub.docker.com/r/daskaesebrot/randhaj
docker pull daskaesebrot/randhaj
You may configure the web service via environment variables.
| Variable name | Description | Default value | Required? |
|---|---|---|---|
RANDHAJ_IMAGE_DIR | Where to load the images to display from. Supperted file types: jpg and png | assets/images (in Docker: /var/assets) | No |
RANDHAJ_CACHE_DIR | Where to save the cached images (converted/resized) | cache | No |
RANDHAJ_CACHE_DB_FILE | File path for the cache SQLite database. Set this to :memory: to disable caching across service restarts. | <RANDHAJ_CACHE_DIR>/.randhaj-cache.db | No |
RANDHAJ_SUBMISSIONS_DIR | Where to save the submitted images (converted/resized) | submissions | No |
RANDHAJ_SUBMISSIONS_DIR_DISK_USAGE_LIMIT | Maximum disk usage, above which submissions are blocked (float value between 0.0 and 1.0) | 0.9 | No |
RANDHAJ_SITE_TITLE | The site title to use | Random image | No |
RANDHAJ_SITE_EMOJI | The site emoji (used for the favicon and title) | 🦈 | No |
RANDHAJ_DEFAULT_CARD_IMAGE | The image ID to use as the Open Graph thumbnail for the root view (/) | The (alphabetically) first ID | No |
RANDHAJ_LOG_LEVEL | The log level (uses UVICORN_LOG_LEVEL as fallback if unset, then uses default value) | INFO | No |
RANDHAJ_MAX_INITIAL_CACHE_GENERATOR_WORKERS | How many maximum workers to use for generating the initial image cache | 4 | No |
FORWARDED_ALLOW_IPS | Reverse proxies to trust (see Uvicorn docs) | 127.0.0.1 | No |
If you'd like to add additional tags in the <head> section or <footer> section of the rendered page, you may create the following files in the folder templates/custom:
| Tag | Filename | Remarks |
|---|---|---|
<head> | head.html | Inserted before closing <head> tag |
<footer> | footer.html | Inserted after opening <footer> tag |
The logo and favicon used in this project were created by Merlin, a very talented friend of mine! Thank you so much for the cute logo!
Follow him on Instagram: @itsjustmerlin
This application uses Open Source components. You can find the source code of their open source projects along with license information below. We acknowledge and are grateful to these developers for their contributions to open source.
Content type
Image
Digest
sha256:513340567…
Size
97.4 MB
Last updated
6 days ago
docker pull daskaesebrot/randhaj