forked from wiedehopf/tar1090
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/extend docker tar1090 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5937a40
fix: extend docker-tar1090 with runtime nginx proxy injection
Sol455 41faa6d
fix: update workflow to use Dockerfile (not Dockerfile.tar1090)
Sol455 f2973ae
Change default port to 8078 for consistency
Sol455 d612d91
Address PR review feedback
Sol455 211468d
Convert proxy to proper s6-overlay service
Sol455 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,17 @@ | ||
| FROM debian:bullseye-slim | ||
| FROM ghcr.io/sdr-enthusiasts/docker-tar1090:latest | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| nginx \ | ||
| lighttpd \ | ||
| git \ | ||
| curl \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| # Install Node.js for our adsb.lol proxy | ||
| RUN apt-get update && apt-get install -y nodejs npm && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN mkdir -p /usr/local/share/tar1090/html | ||
| # Copy our proxy server (reads from file, avoids circular dependency) | ||
| COPY proxy/server.js /opt/proxy/server.js | ||
|
|
||
| COPY html/ /usr/local/share/tar1090/html/ | ||
| COPY *.conf /usr/local/share/tar1090/ | ||
| COPY *.sh /usr/local/share/tar1090/ | ||
| RUN chmod +x /usr/local/share/tar1090/*.sh | ||
| # Runtime nginx config injection - runs AFTER 07-nginx-configure regenerates config | ||
| # Must be numbered > 07 to run after nginx config is generated | ||
| # (Build-time sed doesn't persist because tar1090 regenerates nginx config at startup) | ||
| COPY docker/08-inject-proxy-config /etc/s6-overlay/startup.d/08-inject-proxy-config | ||
| RUN chmod +x /etc/s6-overlay/startup.d/08-inject-proxy-config | ||
|
|
||
| COPY docker/lighttpd-tar1090.conf /etc/lighttpd/conf-available/89-tar1090.conf | ||
| RUN lighttpd-enable-mod tar1090 | ||
|
|
||
| RUN sed -i 's/server.port\s*=.*/server.port = 8504/' /etc/lighttpd/lighttpd.conf && \ | ||
| sed -i 's|server.document-root\s*=.*|server.document-root = "/usr/local/share/tar1090/html/"|' /etc/lighttpd/lighttpd.conf | ||
|
|
||
| COPY <<'EOF' /usr/local/bin/start.sh | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "Starting tar1090 web interface on port 8504..." | ||
| lighttpd -D -f /etc/lighttpd/lighttpd.conf | ||
| EOF | ||
|
|
||
| RUN chmod +x /usr/local/bin/start.sh | ||
|
|
||
| EXPOSE 8504 | ||
|
|
||
| CMD ["/usr/local/bin/start.sh"] | ||
| # Run proxy as a proper s6-overlay service (auto-restart, logging, graceful shutdown) | ||
| COPY docker/services.d/proxy /etc/services.d/proxy | ||
| RUN chmod +x /etc/services.d/proxy/run |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,33 @@ | ||
| services: | ||
| readsb: | ||
| image: ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest | ||
| container_name: readsb | ||
| hostname: readsb | ||
| tar1090: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| container_name: tar1090 | ||
| hostname: tar1090 | ||
| restart: unless-stopped | ||
| network_mode: host | ||
| environment: | ||
| - TZ=UTC | ||
| # readsb config (built into docker-tar1090) | ||
| - READSB_DEVICE_TYPE=none | ||
| - READSB_NET_ENABLE=true | ||
| - READSB_NET_CONNECTOR=${READSB_NET_CONNECTOR:-} | ||
| - READSB_LAT=${RECEIVER_LAT:-0} | ||
| - READSB_LON=${RECEIVER_LON:-0} | ||
| - READSB_ALT=${RECEIVER_ALT:-0} | ||
| - READSB_RX_LOCATION_ACCURACY=2 | ||
| - READSB_STATS_RANGE=true | ||
| - READSB_NET_ENABLE=true | ||
| - DISABLE_WEBAPP=true | ||
| - READSB_NET_CONNECTOR=192.168.8.183,30005,beast_in | ||
| volumes: | ||
| - readsb-autogain:/run/autogain | ||
| - readsb-collectd:/run/collectd | ||
| tmpfs: | ||
| - /var/log:size=32M | ||
|
|
||
| tar1090: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.tar1090 | ||
| container_name: tar1090 | ||
| hostname: tar1090 | ||
| restart: unless-stopped | ||
| network_mode: host | ||
| depends_on: | ||
| - readsb | ||
| environment: | ||
| - TZ=UTC | ||
| - BEASTHOST=127.0.0.1 | ||
| - BEASTPORT=30005 | ||
| # tar1090 map config | ||
| - LAT=${RECEIVER_LAT:-0} | ||
| - LONG=${RECEIVER_LON:-0} | ||
| - TAR1090_DEFAULTCENTERLAT=${RECEIVER_LAT:-0} | ||
| - TAR1090_DEFAULTCENTERLON=${RECEIVER_LON:-0} | ||
| - READSB_URL=http://127.0.0.1:80/data/aircraft.json | ||
| # adsb.lol proxy config | ||
| - ADSBLOL_ENABLED=${ADSBLOL_ENABLED:-false} | ||
| - RECEIVER_LAT=${RECEIVER_LAT:-0} | ||
| - RECEIVER_LON=${RECEIVER_LON:-0} | ||
| - ADSBLOL_RADIUS=${ADSBLOL_RADIUS:-40} | ||
| - PROXY_PORT=3005 | ||
|
|
||
| volumes: | ||
| readsb-autogain: | ||
| readsb-collectd: | ||
| tmpfs: | ||
| - /var/log:size=32M |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/command/with-contenv bash | ||
| # Inject proxy location block AFTER tar1090's 07-nginx-configure runs | ||
| # This must run at startup (not build time) because 07-nginx-configure regenerates the config | ||
|
|
||
| echo "[08-inject-proxy-config] Injecting adsb.lol proxy config into nginx..." | ||
|
|
||
| # Add proxy location for aircraft.json | ||
| sed -i '/include \/etc\/nginx\/nginx-tar1090-webroot.conf;/i\ location = /data/aircraft.json { proxy_pass http://127.0.0.1:3005/data/aircraft.json; }' \ | ||
| /etc/nginx/sites-enabled/tar1090 | ||
|
|
||
| # Disable binCraft in receiver.json so frontend uses JSON format (required for adsb.lol) | ||
| # Uses nginx sub_filter to modify the response on-the-fly | ||
| sed -i '/include \/etc\/nginx\/nginx-tar1090-webroot.conf;/i\ location = /data/receiver.json { alias /run/readsb/receiver.json; sub_filter_types application/json; sub_filter '\''\"binCraft\": true'\'' '\''\"binCraft\": false'\''; sub_filter '\''\"zstd\": true'\'' '\''\"zstd\": false'\''; sub_filter_once off; }' \ | ||
| /etc/nginx/sites-enabled/tar1090 | ||
|
|
||
| # Verify the injection worked | ||
| if grep -q "proxy_pass" /etc/nginx/sites-enabled/tar1090; then | ||
| echo "[08-inject-proxy-config] Proxy config injected successfully" | ||
| else | ||
| echo "[08-inject-proxy-config] ERROR: Failed to inject proxy config" | ||
| exit 1 | ||
| fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #!/command/with-contenv bash | ||
| exec node /opt/proxy/server.js |
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
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.
Uh oh!
There was an error while loading. Please reload this page.