Skip to content

Commit

Permalink
fix: Add support for HTTPS in healthcheck (#4538)
Browse files Browse the repository at this point in the history
  • Loading branch information
Caligatio authored Nov 11, 2024
1 parent 365d77e commit ea4adfa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mealie/scripts/healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ def main():
if port is None:
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"

url = f"{proto}://127.0.0.1:{port}/api/app/about"

r = requests.get(url)
# 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:
sys.exit(0)
Expand Down

0 comments on commit ea4adfa

Please sign in to comment.