mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4227
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2712
Author: @wszhoho
Created: 10/16/2026
Status: ❌ Closed
Base:
main← Head:fix/issue-1847-auth-ip-log📝 Commits (1)
9ea563alog unauthorized API-key attempts with the client IP (issue #1847)📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
serve/server.py(+4 -0)📄 Description
What this does
Adds a log line on API-key authentication failure that includes the client source IP, so fail2ban (or any log-based rate limiter) can match it and ban brute-force attempts. Closes #1847.
Before this change,
_authorized()inserve/server.pyreplied with a silent 401 JSON body — nothing landed in the journal, so there was nothing for a filter to match on.The wording deliberately mirrors llama.cpp's
unauthorized: Invalid API Key from <ip>verbatim (as requested in #1847), so an existing fail2ban filter written for llama.cpp works against Strata's logs unchanged.Notes:
stderr, consistent with other warnings in this file (e.g. the AMD line at L2845);flush=Truekeeps journald real-time so fail2ban doesn't miss events.[strata]prefix on purpose, to keep the line byte-compatible with the stock llama.cpp filter regex.sysis already imported at module level; no new dependencies.Verification
python3 -m py_compile serve/server.pypasses.unauthorized: Invalid API Key from 203.0.113.7on stderr.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.