diff --git a/backend/main.py b/backend/main.py index 598438a..cfd6cc7 100644 --- a/backend/main.py +++ b/backend/main.py @@ -327,7 +327,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media") os.makedirs(MEDIA_DIR, exist_ok=True) app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media") -APP_VER = "780" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "781" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/routes/ki.py b/backend/routes/ki.py index f43f87e..708d571 100644 --- a/backend/routes/ki.py +++ b/backend/routes/ki.py @@ -195,9 +195,6 @@ async def ki_geburtstag(req: BirthdayRequest, request: Request, if cached: return {"answer": cached["content"], "cached": True} - # Rate-Limit: 1 Generierung pro Tag pro User - rl_check(request, max_requests=1, window_seconds=86400, key=f"ki_bday_{req.dog_id}_{mode}") - name = req.name.strip()[:40] or "deinen Hund" rasse = req.rasse or None alter = req.alter diff --git a/backend/static/index.html b/backend/static/index.html index 66698b5..1ed294a 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -575,10 +575,10 @@ - - - - + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 2c57217..639ec6c 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '780'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '781'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen diff --git a/backend/static/js/worlds.js b/backend/static/js/worlds.js index 71018a3..12f0deb 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -1471,9 +1471,14 @@ window.Worlds = (() => { .replace(/\n/g, '
'); body.innerHTML = `
${html}
`; } - } catch { + } catch (err) { const body = ov.querySelector('#bday-ki-body'); - if (body) body.innerHTML = '
KI momentan nicht verfügbar 🐾
'; + if (body) { + const msg = err?.status === 429 + ? 'Heute bereits abgerufen — morgen gibt es neue Ideen 🐾' + : 'KI momentan nicht verfügbar. Versuch es später nochmal 🐾'; + body.innerHTML = `
${msg}
`; + } } } diff --git a/backend/static/sw.js b/backend/static/sw.js index d0b1bf3..96eaace 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v780'; +const CACHE_VERSION = 'by-v781'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index 800d3f0..f61395a 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -14,6 +14,7 @@ services: - DB_PATH=/data/banyaro.db - MEDIA_DIR=/prod-media - STAGING=true + - KI_MODE=cloud - VAPID_PUBLIC_KEY=BMKbFAmpsqJ-eFef_4XJcYpuxPWqBNAoy9buMNnMSa6ijcPzltboHi_YccPKJrUD0isBez-vJIzAgjnLTWkzcC0 - VAPID_PRIVATE_KEY=8PWa9vvwMqtqsJEJGcwmiLhR0_Yl7duVX3wmWiKS878 - VAPID_CONTACT=mailto:admin@banyaro.app