mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 04:55:21 +02:00
fix: Add support for HTTPS in healthcheck (#4538)
This commit is contained in:
parent
365d77e599
commit
ea4adfa335
1 changed files with 8 additions and 2 deletions
|
@ -10,9 +10,15 @@ def main():
|
||||||
if port is None:
|
if port is None:
|
||||||
port = 9000
|
port = 9000
|
||||||
|
|
||||||
url = f"http://127.0.0.1:{port}/api/app/about"
|
if all(os.getenv(x) for x in ["TLS_CERTIFICATE_PATH", "TLS_PRIVATE_KEY_PATH"]):
|
||||||
|
proto = "https"
|
||||||
|
else:
|
||||||
|
proto = "http"
|
||||||
|
|
||||||
r = requests.get(url)
|
url = f"{proto}://127.0.0.1:{port}/api/app/about"
|
||||||
|
|
||||||
|
# TLS certificate is likely not issued for 127.0.0.1 so don't verify
|
||||||
|
r = requests.get(url, verify=False)
|
||||||
|
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue