Add heatpump compressor cycle analysis web app
Static page that plots Home Assistant on/off history of the heatpump compressor with pan/zoom, per-phase hover durations and statistics (min/max/mean/median, total on-time, duty cycle) for the visible range. English/German UI. Served by nginx in Docker with basic auth, CSP and a healthcheck; Plotly is vendored locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# Creates nginx/.htpasswd for HTTP basic auth.
|
||||
# Usage: ./set-password.sh <user> [password] (prompts for the password if omitted)
|
||||
set -eu
|
||||
|
||||
user="${1:?usage: $0 <user> [password]}"
|
||||
case "$user" in *:*) echo "user name must not contain ':'" >&2; exit 1 ;; esac
|
||||
|
||||
if [ $# -ge 2 ]; then
|
||||
hash=$(openssl passwd -apr1 "$2")
|
||||
else
|
||||
hash=$(openssl passwd -apr1)
|
||||
fi
|
||||
|
||||
file="$(dirname "$0")/nginx/.htpasswd"
|
||||
[ -d "$file" ] && rmdir "$file" # docker creates a directory if the file was missing on first start
|
||||
umask 077
|
||||
printf '%s:%s\n' "$user" "$hash" > "$file"
|
||||
chmod 644 "$file" # nginx workers must be able to read it
|
||||
echo "Wrote $file for user '$user'. Run 'docker compose restart' if the container is already running."
|
||||
Reference in New Issue
Block a user