Fix Grafana on Linux: named volume for data; re-sync password on login
This commit is contained in:
@@ -151,8 +151,10 @@ def login():
|
|||||||
if not _has_password():
|
if not _has_password():
|
||||||
return redirect(url_for("setup"))
|
return redirect(url_for("setup"))
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
if _check_password(request.form.get("password", "")):
|
pw = request.form.get("password", "")
|
||||||
|
if _check_password(pw):
|
||||||
session["authed"] = True
|
session["authed"] = True
|
||||||
|
_sync_grafana_password(pw) # self-heal if the setup-time sync missed
|
||||||
return redirect(url_for("index"))
|
return redirect(url_for("index"))
|
||||||
flash("Wrong password.", "error")
|
flash("Wrong password.", "error")
|
||||||
return render_template("auth.html", mode="login")
|
return render_template("auth.html", mode="login")
|
||||||
|
|||||||
+6
-1
@@ -41,7 +41,9 @@ services:
|
|||||||
# the password you set on the AHDX setup screen. Don't pin it here or AHDX
|
# the password you set on the AHDX setup screen. Don't pin it here or AHDX
|
||||||
# can't bootstrap it.
|
# can't bootstrap it.
|
||||||
volumes:
|
volumes:
|
||||||
- ./grafana-data:/var/lib/grafana
|
# Named volume (not a host bind mount) so Grafana's user can write to it
|
||||||
|
# on any host — a bind-mounted dir trips file-permission errors on Linux.
|
||||||
|
- grafana-data:/var/lib/grafana
|
||||||
# Auto-adds the "AHDX" datasource + the Apple Health dashboard.
|
# Auto-adds the "AHDX" datasource + the Apple Health dashboard.
|
||||||
- ./grafana/provisioning:/etc/grafana/provisioning
|
- ./grafana/provisioning:/etc/grafana/provisioning
|
||||||
- ./grafana/dashboards:/etc/dashboards
|
- ./grafana/dashboards:/etc/dashboards
|
||||||
@@ -49,3 +51,6 @@ services:
|
|||||||
ahdx:
|
ahdx:
|
||||||
condition: service_healthy # Grafana waits until AHDX is up
|
condition: service_healthy # Grafana waits until AHDX is up
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
grafana-data:
|
||||||
|
|||||||
Reference in New Issue
Block a user