Skip to content

Instantly share code, notes, and snippets.

@David-Lor
Last active April 20, 2024 09:36
Show Gist options
  • Save David-Lor/1792b2b04d54c62b094e27eb024ef66a to your computer and use it in GitHub Desktop.
Save David-Lor/1792b2b04d54c62b094e27eb024ef66a to your computer and use it in GitHub Desktop.
Navidrome Docker Healthcheck
#!/bin/sh
USER="healthcheck"
PASSWORD="abc123.."
SONG_ID="9bd84601b155f2ffea51f3340e63886d"
EXPECTED_MD5="1525ba8e3a84c7a87ad4c6ee3998bcd5"
CLIENT_ID="healthcheck.sh"
set -e
URL="http://localhost:4533/rest/download?u=$USER&p=$PASSWORD&f=json&v=1.8.0&c=$CLIENT_ID&id=$SONG_ID&format=raw&bitrate=0"
output=$(/usr/bin/curl -fsS "$URL" | md5sum)
test "$output" == "$EXPECTED_MD5 -" || (echo "Healthcheck failed. Output: \"$output\"; expected hash: $EXPECTED_MD5"; exit 1)

This script validates Navidrome is running, by downloading a certain song and validating its MD5 checksum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment