Switch to building tar1090 from source with lighttpd#13
Conversation
Replace SDR Enthusiasts nginx-based image with lightweight from-scratch build using lighttpd + Node.js proxy. Removes redundant internal readsb process - now relies on external readsb container or adsb.lol fallback.
Required for tar1090 to use JSON format instead of binCraft binary. Served at /data/receiver.json via lighttpd alias.
Change proxy default port from 3000 to 3005 to match docker-compose. Update .env.example with SF coordinates.
Previously fallback only triggered when local readsb fetch failed. Now also falls back to adsb.lol when local returns 0 aircraft.
PR Review: Switch to building tar1090 from source with lighttpdSummaryThis PR successfully addresses multiple issues by migrating from the pre-built SDR Enthusiasts Docker image to a from-scratch build. The changes are well-motivated and the implementation is generally solid. Positive AspectsProblem Solving
Code Quality
Issues & Recommendations1. Critical: Signal Handling Race Condition (Dockerfile:44-50)The current signal trap implementation has a potential issue: cleanup() {
echo "Shutting down..."
kill $PROXY_PID 2>/dev/null || true
exit 0
}
trap cleanup SIGTERM SIGINTProblem: Recommendation: Use #!/bin/bash
set -e
cleanup() {
echo "Shutting down..."
kill $PROXY_PID 2>/dev/null || true
kill $LIGHTTPD_PID 2>/dev/null || true
exit 0
}
trap cleanup SIGTERM SIGINT
echo "Starting aircraft data proxy on port ${PROXY_PORT:-3005}..."
node /opt/proxy/server.js &
PROXY_PID=$!
sleep 1
echo "Starting tar1090 web interface on port 80..."
lighttpd -D -f /etc/lighttpd/lighttpd.conf &
LIGHTTPD_PID=$!
wait -n
exit_code=$?
cleanup
exit $exit_code2. Moderate: Port Hardcoding (docker/lighttpd-proxy.conf:5)Issue: The proxy port is hardcoded but can be changed via Recommendation: Either:
3. Minor: Missing Error Handling (proxy/server.js:4)The Recommendation: Update the default or add validation: const READSB_URL = process.env.READSB_URL || 'http://readsb:80/data/aircraft.json';4. Minor: Incomplete Cleanup (Dockerfile)The removed Recommendation: Consider removing 5. Test Coverage GapNo tests exist for the proxy server logic or the new fallback behavior. Recommendations:
6. Documentation: Missing Migration NotesUsers upgrading from the old setup might experience issues. Recommendation: Add migration notes covering:
Security Considerations✅ Good:
Performance Considerations
Overall AssessmentQuality: Good Recommendation: Approve with request to fix the critical signal handling issue. Other items can be addressed in follow-up PRs. Action ItemsMust fix before merge:
Should fix (can be follow-up PR):
Nice to have:
|
Pull Request Review: Switch to building tar1090 from source with lighttpdSummaryThis PR successfully addresses the root causes of aircraft not displaying when using the adsb.lol fallback by replacing the pre-built SDR Enthusiasts Docker image with a from-scratch build using lighttpd. The changes are well-motivated and resolve issues #11 and #12. Strengths
Code Quality IssuesCritical Issues
Major Issues
Positive Observations
Security Concerns
Test CoverageNo tests added for:
RecommendationsCritical (fix before merge):
High Priority:
Medium Priority:
ConclusionOverall Assessment: Approve with minor changes requested This PR successfully solves the core issues and is a significant improvement. Main concerns are hardcoded config values and lack of tests. Great work identifying the root cause! |
|
Closing in favour of modifying: https://github.com/sdr-enthusiasts/docker-tar1090 |
Summary
This PR replaces the pre-built SDR Enthusiasts tar1090 Docker image with a from-scratch build using lighttpd. This resolves aircraft not appearing when using the adsb.lol fallback and gives us full control over the image configuration.
Issues Resolved
1. Aircraft not displaying with adsb.lol fallback
lighttpd-proxy.conf) was never being applied2. binCraft/zstd format incompatibility
data/receiver.jsonwithbinCraft: falseandzstd: false3. Fallback logic never triggering
4. Proxy port conflict with blah2-api
close #11
close #12