fix: add MEALIE_INTERNAL_URL env var for Docker-to-Docker API calls
When deployed behind Cloudflare Tunnel, requests from the container to the external Mealie URL fail with 530 (hairpin). MEALIE_INTERNAL_URL lets the container use the Docker-internal address (e.g. http://mealie:9000) for API calls while keeping the external URL for browser links. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -56,7 +56,7 @@ def settings_test():
|
||||
if not url or not key:
|
||||
return jsonify({"ok": False, "error": "Nincs megadva Mealie URL vagy API kulcs."})
|
||||
try:
|
||||
client = MealieClient(url, key)
|
||||
client = MealieClient(url, key, api_url=config.MEALIE_INTERNAL_URL)
|
||||
info = client.test_connection()
|
||||
return jsonify({"ok": True, "data": info})
|
||||
except Exception as exc:
|
||||
@@ -98,7 +98,8 @@ def send_to_mealie():
|
||||
return jsonify({"ok": False, "error": "Érvénytelen kérés."})
|
||||
|
||||
try:
|
||||
client = MealieClient(cfg["mealie_url"], cfg["mealie_api_key"])
|
||||
client = MealieClient(cfg["mealie_url"], cfg["mealie_api_key"],
|
||||
api_url=config.MEALIE_INTERNAL_URL)
|
||||
slug = client.create_recipe(payload)
|
||||
recipe_url = f"{cfg['mealie_url']}/g/home/r/{slug}"
|
||||
return jsonify({"ok": True, "slug": slug, "url": recipe_url})
|
||||
|
||||
Reference in New Issue
Block a user