Move the rowing photo Claude call to the Python service

POST /rowing in the Go backend no longer calls the Anthropic SDK. It keeps
the admin gate, EXIF date, duplicate check, sanity bounds and insert, and
sends the image to a new internal Python route, POST /internal/rowing/read,
which makes the Claude call and returns the three numbers it read.

The route spends a paid call and has no auth of its own, so nginx 404s
/py/internal/ and the route refuses anything carrying the proxy headers
nginx adds. The python container now receives CLAUDE_API_KEY.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-09 11:46:17 +01:00
co-authored by Claude Opus 5.5
parent 8d7606bbe8
commit f8d48ba9af
19 changed files with 661 additions and 92 deletions
+9
View File
@@ -519,6 +519,15 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}
# /py/internal/: routes the Go backend calls directly over app-network
# (the rowing photo reader, which spends a paid Claude call and has no
# auth of its own). Never proxied. ^~ so no regex location can claim
# the path first. The Python side also refuses anything carrying the
# X-Real-IP / X-Forwarded-For headers set below, as a second layer.
location ^~ /py/internal/ {
return 404;
}
location /py/ {
limit_req zone=api burst=20 nodelay;
# Hotel search blocks for up to a few minutes while it calls Travelodge and TfL