feat(upload): support Flight Review API keys and harden reachability - #31
Closed
dakejahl wants to merge 1 commit into
Closed
feat(upload): support Flight Review API keys and harden reachability#31dakejahl wants to merge 1 commit into
dakejahl wants to merge 1 commit into
Conversation
Add remote_api_key config for ARK Flight Review (Authorization: Bearer and X-API-Key per flight_review api_key.py). Empty key still attempts remote upload without auth headers for open servers. Treat any HTTP response as reachable so 302 home pages (review.arkelectron.com) are not marked dead. Improve 401/403 handling with response body and stop retry spam. Slightly longer connection timeouts for probe and upload. (cherry picked from commit adc72da)
This was referenced Jul 28, 2026
Collaborator
Author
|
Superseded by #32, which contains this branch's commits unchanged and with authorship intact — merging #32 merges this. Reviewing this stack turned up structural problems in the code underneath it, and fixing those meant rewriting the parts these PRs sit on. Keeping them open would have meant reviewing #29's Nothing here is dropped: the FTP transport, the reachability cooldown and the API-key headers are all in #32. The one deliberate change is that 401/403 no longer blacklist a log — see the note in #32. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third of three stacked PRs replacing #28. Based on #30, which is based on #29 — review those first; this diff will shrink to a single commit once they merge.
Carries over
adc72dafrom #28, rebased onto the FTP work, with one change: it no longer blacklists on 401/403 (see below). Authorship preserved.Problem
The ARK Flight Review fork authenticates automated uploads with a per-account API key (
app/tornado_handlers/api_key.py) and rejects unauthenticated uploads with 403. logloader has no way to present a key, so it cannot upload there at all.Separately,
server_reachable()required HTTP 200, but Flight Review's home page answers 302 — so a perfectly healthyreview.arkelectron.comwas treated as down.Solution
Optional
remote_api_keyin config.toml, sent as bothAuthorization: Bearer <key>andX-API-Key: <key>, matching what the server accepts. Unused by default: when the key is empty no auth headers are sent at all and open servers like logs.px4.io keep working exactly as before. Whitespace-only keys are trimmed to empty so a stray space cannot produce an emptyBearerheader. The local server interface never sends a key — flight-review on the companion is open.Reachability now accepts any HTTP response as proof the host is up, rather than only 200.
Change from #28
adc72daalso added 401 and 403 to the permanent blacklist. Dropped here: those statuses mean this account is not authorized yet, not this log is bad. The expected first-run state —upload_enabled = truebefore the key is configured — returns 403, so blacklisting would silently and permanently discard one pending log per cycle, and they would never upload after the key was set. The blacklist stays 400-only.The batch-stop on 401/403 in
upload_pending_logsis kept, which is the right mechanism: it stops the cycle without destroying state, and uploads resume on their own once the key is valid.