Skip to content

Commit

Permalink
Merge pull request #18 from Thom-x/beast-tcp
Browse files Browse the repository at this point in the history
Major update
  • Loading branch information
Thom-x committed Mar 9, 2020
2 parents aab5bd4 + c435e33 commit 1625f36
Show file tree
Hide file tree
Showing 25 changed files with 406 additions and 197 deletions.
153 changes: 114 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,109 @@
FROM debian:buster
FROM debian:buster as dump1090

ENV DEBIAN_VERSION buster
ENV TINI_VERSION v0.18.0
ENV RTL_SDR_VERSION 0.6.0
ENV DUMP1090_VERSION v3.8.0

# DUMP1090
RUN apt-get update && \
apt-get install -y \
sudo \
git-core \
build-essential \
debhelper \
librtlsdr-dev \
pkg-config \
dh-systemd \
libncurses5-dev \
libbladerf-dev && \
rm -rf /var/lib/apt/lists/*

WORKDIR /tmp
RUN git clone -b ${DUMP1090_VERSION} --depth 1 https://github.com/flightaware/dump1090 && \
cd dump1090 && \
make

FROM debian:buster as piaware

ENV DEBIAN_VERSION buster
ENV PIAWARE_VERSION v3.8.0

MAINTAINER maugin.thomas@gmail.com
# PIAWARE
WORKDIR /tmp
RUN apt-get update && \
apt-get install -y \
sudo \
git-core \
wget \
build-essential \
debhelper \
tcl8.6-dev \
autoconf \
python3-dev \
python-virtualenv \
libz-dev \
dh-systemd \
net-tools \
tclx8.4 \
tcllib \
tcl-tls \
itcl3 \
python3-venv \
dh-systemd \
init-system-helpers \
libboost-system-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-filesystem-dev && \
rm -rf /var/lib/apt/lists/*

RUN git clone -b ${PIAWARE_VERSION} --depth 1 https://github.com/flightaware/piaware_builder.git piaware_builder
WORKDIR /tmp/piaware_builder
RUN ./sensible-build.sh ${DEBIAN_VERSION} && \
cd package-${DEBIAN_VERSION} && \
dpkg-buildpackage -b

FROM debian:buster-slim as serve

ENV RTL_SDR_VERSION 0.6.0
ENV FR24FEED_VERSION 1.0.18-5

MAINTAINER maugin.thomas@gmail.com

RUN apt-get update && \
apt-get install -y wget devscripts libusb-1.0-0-dev pkg-config ca-certificates git-core cmake build-essential --no-install-recommends && \
apt-get clean && \
# rtl-sdr
apt-get install -y \
wget \
devscripts \
libusb-1.0-0-dev \
pkg-config \
ca-certificates \
git-core \
cmake \
build-essential \
# piaware
libboost-system-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-filesystem-dev \
libtcl \
net-tools \
tclx \
tcl \
tcllib \
tcl-tls \
itcl3 \
librtlsdr-dev \
pkg-config \
libncurses5-dev \
libbladerf-dev && \
rm -rf /var/lib/apt/lists/*

# RTL-SDR
WORKDIR /tmp
RUN mkdir /etc/modprobe.d && echo 'blacklist r820t' >> /etc/modprobe.d/raspi-blacklist.conf && echo 'blacklist rtl2832' >> /etc/modprobe.d/raspi-blacklist.conf && echo 'blacklist rtl2830' >> /etc/modprobe.d/raspi-blacklist.conf && echo 'blacklist dvb_usb_rtl28xxu' >> /etc/modprobe.d/raspi-blacklist.conf && \
RUN mkdir -p /etc/modprobe.d && \
echo 'blacklist r820t' >> /etc/modprobe.d/raspi-blacklist.conf && \
echo 'blacklist rtl2832' >> /etc/modprobe.d/raspi-blacklist.conf && \
echo 'blacklist rtl2830' >> /etc/modprobe.d/raspi-blacklist.conf && \
echo 'blacklist dvb_usb_rtl28xxu' >> /etc/modprobe.d/raspi-blacklist.conf && \
git clone -b ${RTL_SDR_VERSION} --depth 1 https://github.com/osmocom/rtl-sdr.git && \
mkdir rtl-sdr/build && \
cd rtl-sdr/build && \
Expand All @@ -26,44 +114,31 @@ RUN mkdir /etc/modprobe.d && echo 'blacklist r820t' >> /etc/modprobe.d/raspi-bla
rm -rf /tmp/rtl-sdr

# DUMP1090
WORKDIR /tmp
RUN apt-get update && \
apt-get install sudo build-essential debhelper librtlsdr-dev pkg-config dh-systemd libncurses5-dev libbladerf-dev -y
RUN git clone -b ${DUMP1090_VERSION} --depth 1 https://github.com/flightaware/dump1090 && \
cd dump1090 && \
make && mkdir /usr/lib/fr24 && cp dump1090 /usr/lib/fr24/ && cp -r public_html /usr/lib/fr24/
COPY config.js /usr/lib/fr24/public_html/
RUN mkdir /usr/lib/fr24/public_html/data

# Uncomment if you want to add your upintheair.json file
#COPY upintheair.json /usr/lib/fr24/public_html/
RUN mkdir -p /usr/lib/fr24/public_html/data
COPY --from=dump1090 /tmp/dump1090/dump1090 /usr/lib/fr24/
COPY --from=dump1090 /tmp/dump1090/public_html /usr/lib/fr24/public_html
RUN rm /usr/lib/fr24/public_html/config.js

# PIAWARE
WORKDIR /tmp
RUN apt-get update && \
apt-get install sudo build-essential debhelper tcl8.6-dev autoconf python3-dev python-virtualenv libz-dev dh-systemd net-tools tclx8.4 tcllib tcl-tls itcl3 python3-venv dh-systemd init-system-helpers libboost-system-dev libboost-program-options-dev libboost-regex-dev libboost-filesystem-dev -y
RUN git clone -b ${PIAWARE_VERSION} --depth 1 https://github.com/flightaware/piaware_builder.git piaware_builder
WORKDIR /tmp/piaware_builder
RUN ./sensible-build.sh ${DEBIAN_VERSION} && cd package-${DEBIAN_VERSION} && dpkg-buildpackage -b && cd .. && dpkg -i piaware_*_*.deb
COPY piaware.conf /etc/
COPY --from=piaware /tmp/piaware_builder /tmp/piaware_builder
RUN cd /tmp/piaware_builder && dpkg -i piaware_*_*.deb && rm -rf /tmp/piaware && rm /etc/piaware.conf

# FR24FEED
WORKDIR /fr24feed
RUN wget https://repo-feed.flightradar24.com/linux_x86_64_binaries/fr24feed_1.0.18-5_amd64.tgz \
&& tar -xvzf *amd64.tgz
COPY fr24feed.ini /etc/

RUN apt-get update && apt-get install -y supervisor
COPY manage-supervisord /usr/local/bin/manage-supervisord
RUN chmod +x /usr/local/bin/manage-supervisord
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD https://repo-feed.flightradar24.com/linux_x86_64_binaries/fr24feed_${FR24FEED_VERSION}_amd64.tgz /fr24feed
RUN tar -xzf *amd64.tgz && rm *amd64.tgz

# Add Tini
# CONFD
ADD https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64 /tmp/
RUN mkdir -p /opt/confd/bin && \
mv /tmp/confd-0.16.0-linux-amd64 /opt/confd/bin/confd && \
chmod +x /opt/confd/bin/confd

ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
# S6 OVERLAY
ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz /tmp/
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && rm /tmp/s6-overlay-amd64.tar.gz
COPY /root /

EXPOSE 8754 8080 30001 30002 30003 30004 30005 30104

CMD ["/usr/bin/supervisord"]
ENTRYPOINT ["/init"]
173 changes: 112 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,95 +16,146 @@ Feed FlightRadar24 and FlightAware, allow you to see the positions of aircrafts

![Image of dump1090 webapp](https://raw.githubusercontent.com/Thom-x/docker-fr24feed-piaware-dump1090/master/screenshot.png)

## Requirements
# Requirements
- Docker
- RTL-SDR DVBT USB Dongle (RTL2832)

## Install from image
# Getting started

### FlightAware
Register to https://flightaware.com/account/join/.
Run :
```
docker run -d -p 8080:8080 -p 8754:8754 \
--device=/dev/bus/usb:/dev/bus/usb \
-e "FR24FEED_FR24KEY=MY_SHARING_KEY" \
-e "PIAWARE_FEEDER_DASH_ID=MY_FEEDER_ID" \
-e "HTML_SITE_LAT=MY_SITE_LAT" \
-e "HTML_SITE_LON=MY_SITE_LON" \
-e "HTML_SITE_NAME=MY_SITE_NAME" \
-e "PANORAMA_ID=MY_PANORAMA_ID" \
thomx/fr24feed-piaware
```

Go to http://dockerhost:8080 to view a map of reveived data.
Go to http://dockerhost:8754 to view fr24feed configuration panel.

*Note : remove `-e "PANORAMA_ID=MY_PANORAMA_ID"` from the command line if you don't want to use this feature.*

# Configuration

Download and edit [`piaware.conf`](https://raw.githubusercontent.com/Thom-x/docker-fr24feed-piaware-dump1090/master/piaware.conf)
## Common

Replace `feeder-id YOUR_FEEDER_ID` with your feeder id (ex: `feeder-id ffffffff-ffff-ffff-ffff-ffffffffffff`).
To disable starting a service you can add an environement variable :

And claim it on https://fr.flightaware.com/adsb/piaware/claim.
| Environment Variable | Value | Description |
|---------------------------------------|--------------------------|---------------------------|
| `SERVICE_ENABLE_DUMP1090` | `false` | Disable dump1090 service |
| `SERVICE_ENABLE_PIAWARE` | `false` | Disable piaware service |
| `SERVICE_ENABLE_FR24FEED` | `false` | Disable fr24feed service |
| `SERVICE_ENABLE_HTTP` | `false` | Disable http service |

### FlightRadar24
Register to https://www.flightradar24.com/share-your-data and get a sharing key.
Ex : `-e "SERVICE_ENABLE_HTTP=false"`

Download and edit [`fr24feed.ini`](https://raw.githubusercontent.com/Thom-x/docker-fr24feed-piaware-dump1090/master/fr24feed.ini)
Replace `fr24key="YOUR_KEY_HERE"` with your key (ex: `fr24key="a23165za4za56"`).

### Dump1090
#### Receiver location
Download and edit [`config.js`](https://raw.githubusercontent.com/Thom-x/docker-fr24feed-piaware-dump1090/master/config.js) to suite your receiver location and name:
```javascript
SiteShow = true; // true to show a center marker
SiteLat = 47; // position of the marker
SiteLon = 2.5;
SiteName = "Home"; // tooltip of the marker
## FlightAware

Resgister on https://flightaware.com/account/join/.

Run :
```
#### Terrain-limit rings (optional):
If you don't need this feature ignore this.
docker run -it --rm \
-e "SERVICE_ENABLE_DUMP1090=false" \
-e "SERVICE_ENABLE_HTTP=false" \
-e "SERVICE_ENABLE_FR24FEED=false" \
thomx/fr24feed-piaware /bin/bash
```
When the container starts you should see the feeder id, note it. Wait 5 minutes and you should see a new receiver at https://fr.flightaware.com/adsb/piaware/claim (use the same IP as your docker host), claim it and exit the container.

Create a panorama for your receiver location on http://www.heywhatsthat.com.
Add the environment variable `PIAWARE_FEEDER_DASH_ID` with your feeder id.

Download http://www.heywhatsthat.com/api/upintheair.json?id=XXXX&refraction=0.25&alts=1000,10000 as upintheair.json.
| Environment Variable | Configuration property | Default value |
|---------------------------------------|--------------------------|-------------------|
| `PIAWARE_FEEDER_DASH_ID` | `feeder-id` | `YOUR_FEEDER_ID` |
| `PIAWARE_RECEIVER_DASH_TYPE` | `receiver-type` | `other` |
| `PIAWARE_RECEIVER_DASH_HOST` | `receiver-host` | `127.0.0.1` |
| `PIAWARE_RECEIVER_DASH_PORT` | `receiver-port` | `30005` |

*Note : the "id" value XXXX correspond to the URL at the top of the panorama http://www.heywhatsthat.com/?view=XXXX, altitudes are in meters, you can specify a list of altitudes.*
### Installation

Run :
Ex : `-e "PIAWARE_RECEIVER_DASH_TYPE=other"`

## FlightRadar24

Run :
```
docker run -d -p 8080:8080 -p 8754:8754 \
--device=/dev/bus/usb:/dev/bus/usb \
-v /path/to/your/upintheair.json:/usr/lib/fr24/public_html/upintheair.json \
-v /path/to/your/piaware.conf:/etc/piaware.conf \
-v /path/to/your/config.js:/usr/lib/fr24/public_html/config.js \
-v /path/to/your/fr24feed.ini:/etc/fr24feed.ini \
thomx/fr24feed-piaware
docker run -it --rm \
-e "SERVICE_ENABLE_DUMP1090=false" \
-e "SERVICE_ENABLE_HTTP=false" \
-e "SERVICE_ENABLE_PIAWARE=false" \
-e "SERVICE_ENABLE_FR24FEED=false" \
thomx/fr24feed-piaware /bin/bash
```
*Note : remove `-v /path/to/your/upintheair.json:/usr/lib/fr24/public_html/upintheair.json` from the command line if you don't want to use this feature.*
## Build it yourself

Clone this repo.
Then : `/fr24feed/fr24feed_amd64/fr24feed --signup` and follow the instructions, for technical steps, your answer doesn't matter we just need the sharing key at the end.

### FlightAware
Finally to see the sharing key run `cat /etc/fr24feed.ini`, you can now exit the container.

Register to https://flightaware.com/account/join/.
Add the environment variable `FR24FEED_FR24KEY` with your sharing key.

Edit [`piaware.conf`](https://raw.githubusercontent.com/Thom-x/docker-fr24feed-piaware-dump1090/master/piaware.conf)

Replace `feeder-id YOUR_FEEDER_ID` with your feeder id (ex: `feeder-id ffffffff-ffff-ffff-ffff-ffffffffffff`).
| Environment Variable | Configuration property | Default value |
|---------------------------------------|--------------------------|-------------------|
| `FR24FEED_RECEIVER` | `receiver` | `beast-tcp` |
| `FR24FEED_FR24KEY` | `fr24key` | `YOUR_KEY_HERE` |
| `FR24FEED_HOST` | `host` | `127.0.0.1:30005` |
| `FR24FEED_BS` | `bs` | `no` |
| `FR24FEED_RAW` | `raw` | `no` |
| `FR24FEED_LOGMODE` | `logmode` | `1` |
| `FR24FEED_LOGPATH` | `logpath` | `/tmp` |
| `FR24FEED_MLAT` | `mlat` | `yes` |
| `FR24FEED_MLAT_DASH_WITHOUT_DASH_GPS` | `mlat-without-gps` | `yes` |

And claim it on https://fr.flightaware.com/adsb/piaware/claim.
### FlightRadar24
Register to https://www.flightradar24.com/share-your-data and get a sharing key.
Ex : `-e "FR24FEED_FR24KEY=0123456789"`

Edit `fr24feed.ini` and replace `fr24key="YOUR_KEY_HERE"` with your key (ex: `fr24key="a23165za4za56"`).
### Dump1090
#### Receiver location
Edit `config.js` to suite your receiver location and name:
```javascript
SiteShow = true; // true to show a center marker
SiteLat = 47; // position of the marker
SiteLon = 2.5;
SiteName = "Home"; // tooltip of the marker
```
#### Terrain-limit rings (optional):
## Add custom properties

**Note** : you can add any property to either fr24feed or piaware configuration file by adding an environment variable starting with `PIAWARE_...` or `FR24FEED_...`.

Example :

| Environment Variable | Configuration property | value | Configuration file |
|---------------------------------------|--------------------------|-------------------|-------------------------|
| `FR24FEED_TEST=value` | `test` | `value` | `fr24feed.init` |
| `FR24FEED_TEST_DASH_TEST=value` | `test-test` | `value2` | `fr24feed.init` |
| `PIAWARE_TEST=value` | `test` | `value` | `piaware.conf` |

## Dump1090
### Receiver location

| Environment Variable | Default value |
|---------------------------------------|--------------------------|
| `HTML_SITE_LAT` | `45.0` |
| `HTML_SITE_LON` | `9.0` |
| `HTML_SITE_NAME` | `My Radar Site` |

Ex : `-e "HTML_SITE_NAME=My site"`

### Terrain-limit rings (optional):
If you don't need this feature ignore this.

Create a panorama for your receiver location on http://www.heywhatsthat.com.

Download http://www.heywhatsthat.com/api/upintheair.json?id=XXXX&refraction=0.25&alts=1000,10000 place the file upintheair.json in this directory and uncomment `#COPY upintheair.json /usr/lib/fr24/...` from Dockerfile.
| Environment Variable | Default value | Description |
|---------------------------------------|--------------------------|---------------------------------------------|
| `PANORAMA_ID` | | Panorama id |
| `PANORAMA_ALTS` | `1000,10000` | Comma seperated list of altitudes in meter |

*Note : the "id" value XXXX correspond to the URL at the top of the panorama http://www.heywhatsthat.com/?view=XXXX, altitudes are in meters, you can specify a list of altitudes.*
### Installation
Run : `docker-compose up`
*Note : the panorama id value correspond to the URL at the top of the panorama http://www.heywhatsthat.com/?view=XXXX, altitudes are in meters, you can specify a list of altitudes.*

## Usage
Go to http://dockerhost:8080 to view a map of reveived data.
Ex : `-e "PANORAMA_ID=FRUXK2G7"`

Go to http://dockerhost:8754 to view fr24feed configuration panel.
If you don't want to download the limit every time you bring up the container you can download `http://www.heywhatsthat.com/api/upintheair.json?id=${PANORAMA_ID}&refraction=0.25&alts=${PANORAMA_ALTS}` as upintheair.json and mount it in `/usr/lib/fr24/public_html/upintheair.json`.

# Build it yourself

Clone this repo.

```docker build . ```
Loading

0 comments on commit 1625f36

Please sign in to comment.