Fix healthcheck when user:pass are set.
This commit is contained in:
parent
8c308c1ce9
commit
bba03702a1
3 changed files with 11 additions and 4 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
|
@ -24,6 +24,7 @@
|
||||||
"cronsim",
|
"cronsim",
|
||||||
"daterange",
|
"daterange",
|
||||||
"dotenv",
|
"dotenv",
|
||||||
|
"euuo",
|
||||||
"finaldir",
|
"finaldir",
|
||||||
"flac",
|
"flac",
|
||||||
"forcejson",
|
"forcejson",
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,6 @@ class Config:
|
||||||
pictures_backends: list[str] = [
|
pictures_backends: list[str] = [
|
||||||
"https://unsplash.it/1920/1080?random",
|
"https://unsplash.it/1920/1080?random",
|
||||||
"https://picsum.photos/1920/1080",
|
"https://picsum.photos/1920/1080",
|
||||||
"https://spaceholder.cc/i/1920x1080",
|
|
||||||
"https://placedog.net/1920/1080",
|
"https://placedog.net/1920/1080",
|
||||||
]
|
]
|
||||||
"The list of picture backends to use for the background."
|
"The list of picture backends to use for the background."
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,14 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -euuo pipefail
|
||||||
set -eu pipefail
|
|
||||||
|
|
||||||
LOCAL_PORT="${YTP_PORT:-8081}"
|
LOCAL_PORT="${YTP_PORT:-8081}"
|
||||||
|
|
||||||
/usr/bin/curl -f "http://localhost:${LOCAL_PORT}/api/ping"
|
curl_args=(-f)
|
||||||
|
|
||||||
|
if [[ -n "${YTP_AUTH_USERNAME:-}" && -n "${YTP_AUTH_PASSWORD:-}" ]]; then
|
||||||
|
cred=$(printf '%s:%s' "${YTP_AUTH_USERNAME}" "${YTP_AUTH_PASSWORD}" | base64 | tr -d '\n')
|
||||||
|
curl_args+=(-H "Authorization: Basic ${cred}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl_args+=("http://localhost:${LOCAL_PORT}/api/ping")
|
||||||
|
/usr/bin/curl "${curl_args[@]}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue