Add adsb.lol fallback support for dual-source aircraft feed#7
Conversation
Implements issue #2: Configure dual-source feed with local and adsb.lol data. Changes: - Add Node.js proxy service that prefers local readsb data and falls back to adsb.lol - Create custom tar1090 container with integrated proxy service - Configure lighttpd to proxy /data/aircraft.json through fallback service - Add ADSBLOL_ENABLED and ADSBLOL_RADIUS environment variables - Fix RECEIVER_LON variable name (was RECEIVER_LONG) Architecture: - Proxy service tries local readsb first (http://127.0.0.1:80/data/aircraft.json) - On failure, fetches from adsb.lol API within configured radius - Converts adsb.lol format to readsb-compatible JSON - Adds X-Data-Source header to indicate active source The system maintains full compatibility with existing setup while adding automatic failover to adsb.lol when local feed is unavailable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
bdcfe52 to
a40c3ac
Compare
Pull Request Review: Add adsb.lol fallback supportI've conducted a thorough review of PR #7. Overall, this is a solid implementation that successfully addresses issue #2. Below are my findings organized by category. ✅ Strengths
🐛 Potential Bugs & IssuesCritical
High Priority
Medium Priority
🔒 Security ConcernsMedium Severity
Low Severity
⚡ Performance Considerations
🧪 Test CoverageStatus: ❌ No tests present Recommendations:
📝 Code Quality & Best PracticesGood Practices ✅
Suggestions for Improvement
🔄 Suggested Changes SummaryMust Fix (Blocking Issues)
Should Fix (Important)
Nice to Have
✨ Overall AssessmentVerdict: ✅ Approve with recommendations This PR successfully implements the requested fallback functionality and is deployable as-is for development/testing environments. The architecture is sound and the code is generally well-written. However, I recommend addressing at least the "Must Fix" items before deploying to production, particularly:
The code would also benefit greatly from basic test coverage to prevent regressions. Risk Level: Medium-Low (for dev), Medium (for production without fixes) Great work on the implementation! The fallback mechanism is exactly what was needed. 🚀 |
Summary
Implements issue #2: Configure dual-source feed with local and adsb.lol data.
This PR adds automatic fallback to adsb.lol when the local ADS-B feed is unavailable, providing resilient aircraft data coverage.
Changes
New Components
proxy/server.js): Node.js service that handles data source fallback logicDockerfile.tar1090): Extends official tar1090 with integrated proxydocker/lighttpd-proxy.conf): Routes/data/aircraft.jsonthrough proxydocker/entrypoint.sh): Manages both proxy and tar1090 servicesModified Files
docker-compose.yml: Updated tar1090 to use custom build with environment variables.env.example: FixedRECEIVER_LONnaming and added fallback documentationHow It Works
http://127.0.0.1:80/data/aircraft.jsonADSBLOL_ENABLED=true, fetches from adsb.lol APIX-Data-Sourceheader indicatinglocaloradsb.lolConfiguration
Enable fallback in
.env:Testing
Verify normal operation:
docker logs tar1090 -f # Should show: "✓ Local readsb: N aircraft"Test fallback:
docker stop readsb curl -I http://localhost:80/data/aircraft.json # Should show: X-Data-Source: adsb.lol docker start readsbDeployment
cd /opt/tar1090-node git pull docker compose down docker compose build --no-cache tar1090 docker compose up -dCloses #2
🤖 Generated with Claude Code