Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
455 commits
Select commit Hold shift + click to select a range
f90e746
incrementing version: 3.14.1663
wiedehopf Apr 26, 2025
1a7b5d4
typo
wiedehopf Apr 26, 2025
be6d87b
beast dump timestamp handling: better defaults
wiedehopf Apr 26, 2025
3b6eab5
reduce trace memory usage
wiedehopf Apr 26, 2025
9fce129
comment on extening zstd data
wiedehopf Apr 26, 2025
a42b149
debug output
wiedehopf Apr 26, 2025
b66f00c
more consistently extend traceChunks
wiedehopf Apr 26, 2025
60ee906
recompress trace chunks for a bit of memory saving
wiedehopf Apr 26, 2025
b0865e9
traceChunk logic: better deal with inactive timespans in traces
wiedehopf Apr 26, 2025
0ae0a51
recompressStateChunk: more statistics
wiedehopf Apr 27, 2025
1a68226
trace heuristic: more resolution for altitude changes
wiedehopf Apr 27, 2025
72b20df
incrementing version: 3.14.1664
wiedehopf Apr 27, 2025
6b04939
minor tracechunk logic improvement
wiedehopf Apr 28, 2025
de41103
stateChunk: specify int size
wiedehopf Apr 28, 2025
3dbbe4a
fix rare occurrence of recent trace missing after initial trace write
wiedehopf Apr 28, 2025
86533e8
traceLastNext shuffle
wiedehopf Apr 28, 2025
f7c66f4
incrementing version: 3.14.1665
wiedehopf Apr 28, 2025
f3ceb3d
cleanup trace dir creation a little bit
wiedehopf Apr 28, 2025
ff6da7c
conditional deactivation of recompression
wiedehopf Apr 29, 2025
cc3f1fc
debug cleanup
wiedehopf Apr 29, 2025
327fd6f
reduce frequency of permanent trace writes
wiedehopf Apr 30, 2025
cac81e7
proper receiver count for aircraft without position
wiedehopf Apr 30, 2025
ee9f940
incrementing version: 3.14.1666
wiedehopf Apr 30, 2025
9705fc6
trace writing: make it easier to see different trace writes in flame …
wiedehopf Apr 30, 2025
abc0201
makefile add LTO option
wiedehopf Apr 30, 2025
bbf446a
improve help for --device-type ifile
wiedehopf May 1, 2025
cb2f04a
incrementing version: 3.14.1667
wiedehopf May 1, 2025
89de90c
add example for simple webserver to MacOS instructions
wiedehopf May 1, 2025
a22572a
trace stuff cleanup / soften midnight IOPS spike
wiedehopf May 1, 2025
1ac8489
api buffer minor tweak
wiedehopf May 1, 2025
38be34f
make api hash automatically resize to save 4MB of memory for most ins…
wiedehopf May 1, 2025
8311b53
fixup filter_callsign API / cleanup some bad constants in api code
wiedehopf May 1, 2025
0b495c5
incrementing version: 3.14.1668
wiedehopf May 2, 2025
8cac43b
getUptime: never use synthetic timestamp
wiedehopf May 2, 2025
3df53b3
use mmap to take advantage of 2MB (or multiple) mappings that are aut…
wiedehopf May 2, 2025
a59431f
only write permanent traces near the end of the day
wiedehopf May 4, 2025
4e320be
use mmap for aircraft object storage under certain conditions
wiedehopf May 4, 2025
d76bf09
keep track of memory used for aircraft structs
wiedehopf May 4, 2025
61d5566
parallel state loading aircraftCreate: explain why we don't need a mu…
wiedehopf May 5, 2025
cdf22bb
better maintain quickGet
wiedehopf May 5, 2025
b43a43d
add spinlock, don't use it though
wiedehopf May 5, 2025
46ad2fc
readme / help: use file instead filepath
wiedehopf May 5, 2025
301aa03
incrementing version: 3.14.1669
wiedehopf May 5, 2025
3edb4e7
use aircraftBack to reduce memory fragmentation even without thp
wiedehopf May 6, 2025
50b2a29
incrementing version: 3.14.1670
wiedehopf May 6, 2025
7423fcc
add free on exit for valgrind
wiedehopf May 6, 2025
9e5d95f
save 4 MB of memory when using --db-file
wiedehopf May 6, 2025
266ce73
fix minor memory stat issue
wiedehopf May 6, 2025
33cd3b4
work around global data with ground positions while a receiver locati…
wiedehopf May 7, 2025
601d52b
better logging when using ModeS Beast
wiedehopf May 10, 2025
af09824
reset aircraft message count when it's been inactive for 15 minutes
wiedehopf May 11, 2025
09a1f5b
fixup global message rate calculation
wiedehopf May 11, 2025
d280b54
incrementing version: 3.14.1671
wiedehopf May 11, 2025
5bf3030
thread pool buffers: release regularly
wiedehopf May 11, 2025
d63f888
remove unused minilzo dependency
wiedehopf May 11, 2025
940d7ff
remove minizlo dependency: code folder
wiedehopf May 11, 2025
9ee3e11
netDrainMessageBuffers: drain all of them
wiedehopf May 12, 2025
6a9f643
add baudrate, cosmetics
wiedehopf May 12, 2025
ece7883
mode-s beast: hopefully fix baud setting
wiedehopf May 12, 2025
1db5691
incrementing version: 3.14.1672
wiedehopf May 12, 2025
f7c4216
some unused code to print bar graph on console for message rate
wiedehopf May 22, 2025
9d95f40
--full-trace-dir option to reduce memory usage of --write-globe-index…
wiedehopf May 22, 2025
7ecb58d
incrementing version: 3.14.1673
wiedehopf May 23, 2025
c677ad2
docker jemalloc: slight memory savings
wiedehopf May 23, 2025
aff96e8
incrementing version: 3.14.1674
wiedehopf May 23, 2025
2002728
don't mess with trace_next_perm on load
wiedehopf May 23, 2025
94ac38d
try and spread out perm writes better
wiedehopf May 23, 2025
a065009
better update receiverlist for receivers that are not quite as low la…
wiedehopf May 24, 2025
05408c5
add some thread count limits
wiedehopf May 24, 2025
7153cbe
incrementing version: 3.14.1675
wiedehopf May 24, 2025
d3eb567
better way to set priority for trace pool
wiedehopf May 24, 2025
669cdca
traces: add version string
wiedehopf May 24, 2025
eb117e3
fine grained ground positions if speed changes
wiedehopf May 26, 2025
aa7a40f
add 30 seconds of max resolution before landing
wiedehopf May 26, 2025
c9780a5
higher resolution for 30 seconds after airground change
wiedehopf May 25, 2025
a470d60
Revert "better update receiverlist for receivers that are not quite a…
wiedehopf May 26, 2025
86d5998
fine grained ground positions if speed changes not that great remove
wiedehopf May 26, 2025
688111f
incrementing version: 3.14.1676
wiedehopf May 26, 2025
ffd36f5
improve non position data reduce forwarding for --net-ingest instances
wiedehopf May 27, 2025
4a77ba1
incrementing version: 3.14.1677
wiedehopf May 27, 2025
a2856a1
regularly reallocate certain buffers
wiedehopf May 27, 2025
d0df62f
better debugging / allow more compressCurrent passes
wiedehopf May 27, 2025
e5a4fe9
autogain: recover gain much quicker
wiedehopf May 27, 2025
3862d1d
autogain: much quicker rebound for closeby passing aircraft
wiedehopf May 27, 2025
ecdf45f
incrementing version: 3.14.1678
wiedehopf May 27, 2025
a28302c
writing fulltrace: always mark legs
wiedehopf May 27, 2025
1ecee57
autogain loud rebound: not quite as fast
wiedehopf May 28, 2025
65dfd86
incrementing version: 3.14.1679
wiedehopf May 28, 2025
9f6e870
add lock around some trace handling
wiedehopf May 28, 2025
a2e98af
some more traceLock
wiedehopf May 28, 2025
e77bb4e
remove incorrect comment
wiedehopf May 28, 2025
1a9629f
removestale: iterate all aircraft less often
wiedehopf May 28, 2025
3bf279d
no traceMaintenance calls unless needed
wiedehopf May 28, 2025
60bb6ec
debug stuff
wiedehopf May 28, 2025
605e0aa
fixup some trace logic things
wiedehopf May 30, 2025
cd775cb
increase traceLast default to 96
wiedehopf May 30, 2025
0445484
after landing / takeoff: up to 60 seconds of data every second
wiedehopf May 30, 2025
4e4c61f
incrementing version: 3.14.1680
wiedehopf May 30, 2025
5faf096
binCraft: better switching between message rate and message count
wiedehopf Jun 2, 2025
f2b6d3f
incrementing version: 3.14.1681
wiedehopf Jun 2, 2025
67614a2
binCraft messagerate fixup
wiedehopf Jun 2, 2025
04b69df
incrementing version: 3.14.1682
wiedehopf Jun 2, 2025
554a17d
reference homebrew recipe
wiedehopf Jun 2, 2025
c7a309b
when using an SDR only forward first message from a plane when no fix…
wiedehopf Jun 18, 2025
6007722
incrementing version: 3.14.1683
wiedehopf Jun 18, 2025
75decb5
don't delay using jaero positions when low jaero timeout set
wiedehopf Jun 19, 2025
f583afe
write full traces less often
wiedehopf Jun 27, 2025
85d4347
tweak autogain: make single loudEvent sufficient to reduce gain
wiedehopf Jul 1, 2025
452cb97
incrementing version: 3.14.1684
wiedehopf Jul 1, 2025
5073f10
improve altitude reliability check
wiedehopf Jul 10, 2025
60f2967
incrementing version: 3.14.1685
wiedehopf Jul 10, 2025
554fd75
minor fixup for altitude reliability check
wiedehopf Jul 10, 2025
12edce9
don't disrupt alt_reliable due to disagreeing lower quality data
wiedehopf Jul 10, 2025
92be770
accept alt from mlat sbs input
wiedehopf Jul 10, 2025
62e6cb2
minor alt update stuff
wiedehopf Jul 10, 2025
8740084
incrementing version: 3.14.1686
wiedehopf Jul 10, 2025
81f5293
debug stuff
wiedehopf Jul 10, 2025
8b495eb
alt update minor
wiedehopf Jul 10, 2025
8087d37
json mlat / tisb flags array: add alt_baro
wiedehopf Jul 11, 2025
ac891f8
incrementing version: 3.14.1687
wiedehopf Jul 11, 2025
6d4bb73
altitude update debugging stuff
wiedehopf Jul 12, 2025
e6ed994
readme
wiedehopf Jul 12, 2025
b1487ac
--gain=auto: increase default noiseLowThreshold a bit
wiedehopf Jul 15, 2025
3b501c1
incrementing version: 3.14.1688
wiedehopf Jul 15, 2025
451221d
autogain: debounce loudRebound a bit
wiedehopf Jul 15, 2025
bf82d5c
incrementing version: 3.14.1689
wiedehopf Jul 15, 2025
9cb37df
incrementing version: 3.14.1690
wiedehopf Jul 15, 2025
77296c9
net_io: use global ais_charset definition
g7 Jul 20, 2025
f743b90
ais_charset, uat2esnt: ensure ais_charset is a NUL-terminated string
g7 Jul 20, 2025
dab71ee
interactive, uat2esnt: use __nonstring__ attribute for byte arrays
g7 Jul 20, 2025
21d399d
extend char arrays to avoid unterminated strings
wiedehopf Jul 21, 2025
58040bf
parse SBS receive timestamp
wiedehopf Jul 28, 2025
71e4a7d
incrementing version: 3.14.1691
wiedehopf Jul 28, 2025
b8250c4
readme: link some projects using this software
wiedehopf Jul 28, 2025
86f2be0
sbs input: prevent parsing timestamps from the future
wiedehopf Jul 28, 2025
45b6ec3
clear range outline as expected when no data is coming in
wiedehopf Aug 1, 2025
48449b0
incrementing version: 3.14.1692
wiedehopf Aug 1, 2025
28f6646
fixup SBS time parsing
wiedehopf Aug 2, 2025
c42e66d
incrementing version: 3.14.1693
wiedehopf Aug 2, 2025
2fac602
traces: fix roll overflow by reducing accuracy
wiedehopf Aug 10, 2025
3a91797
incrementing version: 3.14.1694
wiedehopf Aug 10, 2025
5a3d6f2
make json location accuracy work more reliably on indirect data
wiedehopf Aug 14, 2025
3c33732
incrementing version: 3.14.1695
wiedehopf Aug 14, 2025
25eb72f
viewadsb: improve altitude sorting stability
wiedehopf Aug 15, 2025
4493ff4
viewadsb: only sort every 3 seconds
wiedehopf Aug 15, 2025
f4d29c8
reduce viewadsb refresh from 0.25 to 0.5 seconds
wiedehopf Aug 15, 2025
74f2d9d
viewadsb: only clear errors every 10 seconds
wiedehopf Aug 15, 2025
0867262
add support for uat messages encapsulated in the beast stream
wiedehopf Aug 15, 2025
130c6f4
read_uuid in beast stream: handle partial buffer correctly
wiedehopf Aug 15, 2025
2ff826d
incrementing version: 3.14.1696
wiedehopf Aug 15, 2025
234dad5
fixup encapsulated UAT
wiedehopf Aug 15, 2025
de952d8
interactive: speed 4 wide for --metric
wiedehopf Aug 15, 2025
b6c9674
interactive: consistently sort ground
wiedehopf Aug 15, 2025
eaa4085
interactive: when lat lon specified, show distance / direction and so…
wiedehopf Aug 15, 2025
c77b062
interactive minor readability changes
wiedehopf Aug 15, 2025
539e11d
interactive sort stability for aircraft on ground
wiedehopf Aug 15, 2025
9c55bcd
debian rules
wiedehopf Aug 17, 2025
63acbde
incrementing version: 3.14.1697
wiedehopf Aug 17, 2025
e702928
big version jump: 3.15
wiedehopf Aug 17, 2025
b60583a
incrementing version: 3.15.1
wiedehopf Aug 17, 2025
32c0ced
specify build dep libsoapysdr-dev in readme
wiedehopf Aug 17, 2025
e1ec52c
build with all the SDR support
wiedehopf Aug 18, 2025
5b1e05c
update debian copyright at least partially
wiedehopf Aug 18, 2025
ea1e279
debian package: build faster with make -j $(nprocs)
wiedehopf Aug 18, 2025
ce09d1a
cleanup readsb.service / readsb.default
wiedehopf Aug 18, 2025
8787632
update debian package description
wiedehopf Aug 18, 2025
548ecb2
readme: add some credits / history
wiedehopf Aug 18, 2025
dd59d1d
autogenerate manpages using help2man
wiedehopf Aug 18, 2025
26d725d
print some credits in help
wiedehopf Aug 18, 2025
798f32f
incrementing version: 3.15.2
wiedehopf Aug 18, 2025
604042f
readme: update build instructions
wiedehopf Aug 18, 2025
4e38f31
more flexible tag.sh
wiedehopf Aug 18, 2025
7ef806a
tag.sh: add notes for releasing a version
wiedehopf Aug 18, 2025
1a51ad7
fixup tag.sh to include changelog from main directory
wiedehopf Aug 18, 2025
9a962dc
tag.sh add newline after unreleased changelog entry
wiedehopf Aug 18, 2025
b0e673b
add with_sdrs build profile
wiedehopf Aug 18, 2025
6927c35
release 3.16
wiedehopf Aug 18, 2025
41bde73
readme: fixup missing help2man dependency
wiedehopf Aug 18, 2025
57e1c0b
load_state: somewhat better handling of broken state data
wiedehopf Aug 27, 2025
5d6ce7a
aircraft loading: can't rely on blob association staying the same
wiedehopf Aug 27, 2025
05c70f9
dealing with messed up state is tricky
wiedehopf Aug 27, 2025
0cea2aa
incrementing version: 3.16.1
wiedehopf Aug 27, 2025
e4bf340
remove unnecessarly newlines from ownOp/year details in json
wiedehopf Aug 31, 2025
5950f74
increase output buffer for uat2esnt conversion
wiedehopf Sep 6, 2025
44daf02
add ugly way to process specially beast encapsulated UAT messages
wiedehopf Sep 6, 2025
990bafb
minor stuff to more obviously guarantee progress processing beast
wiedehopf Sep 6, 2025
7335e0c
distance approximation: go back to elliptical earth
wiedehopf Sep 8, 2025
460c9fc
distance approximations aren't that good, less noisy when checking ap…
wiedehopf Sep 8, 2025
3852ad2
less noisy checking degree approx
wiedehopf Sep 8, 2025
786c1ac
prevent traceLast data from the previous day in history traces
wiedehopf Sep 9, 2025
4c1459a
incrementing version: 3.16.2
wiedehopf Sep 10, 2025
6ee71cf
debug for decodeEncapsulatedUAT
wiedehopf Sep 23, 2025
3623c68
decodeEncapsulatedUat: fix, this should work now
wiedehopf Sep 25, 2025
03a2bf5
incrementing version: 3.16.3
wiedehopf Sep 25, 2025
ec69dc1
receiver position logic: fix for receivers near dateline
wiedehopf Oct 6, 2025
14ef156
prepare defines for api filtering by uuid
wiedehopf Oct 6, 2025
e213c05
api: add &filter_uuid filter
wiedehopf Oct 6, 2025
55b026b
only show planes with filter_uuid if received very recently by uuid
wiedehopf Oct 7, 2025
b530dd3
comment on dropHalfUntil
wiedehopf Oct 14, 2025
83cfa54
adjust help for TCP client / server terminology
wiedehopf Oct 17, 2025
9b80d72
update --help in github readme
wiedehopf Oct 17, 2025
af4d2d6
incrementing version: 3.16.4
wiedehopf Oct 17, 2025
b53e58c
stop counting invalid decodes from network for message rate
wiedehopf Oct 20, 2025
3e095b1
incrementing version: 3.16.5
wiedehopf Oct 20, 2025
7b78f77
readme: fixup a link
wiedehopf Nov 7, 2025
81b5d26
ifile: exit promptly
wiedehopf Nov 10, 2025
0797687
improve handling of synthetic clock / priority tasks
wiedehopf Nov 10, 2025
2d007af
interactive: clean up seen column formatting a bit
wiedehopf Nov 10, 2025
97ba5e6
modify default USB buffer size to 128 kibibytes
wiedehopf Nov 15, 2025
aa0bc62
SDR: unexpected size: avoid spamming the log too much
wiedehopf Nov 15, 2025
b985831
incrementing version: 3.16.6
wiedehopf Nov 15, 2025
ba29158
add option --json-separate-alt-ground
wiedehopf Nov 20, 2025
feee930
make --net-beast-reduce-filter-dist more versatile
wiedehopf Dec 14, 2025
6946bda
fix / make obvious: recentReceiverId overwrite logic
wiedehopf Dec 18, 2025
cd7b07e
set recentReceiverIds for aircraft without position
wiedehopf Dec 18, 2025
f4f7648
incrementing version: 3.16.7
wiedehopf Dec 18, 2025
25b1409
less noise about trackremovestale taking a bit of time
wiedehopf Dec 20, 2025
71b4390
api: fix out of bounds read
wiedehopf Dec 21, 2025
130c143
net_io: fix null deref when with proxy strings
wiedehopf Dec 21, 2025
5141685
net_io: fix asterix decoding fspec
wiedehopf Dec 21, 2025
91346cb
net_io: fix readAsterix length validation failure
wiedehopf Dec 21, 2025
b05ebda
incrementing version: 3.16.8
wiedehopf Dec 21, 2025
4295f84
ensure decodePlanefinder does not read past buffer
wiedehopf Dec 22, 2025
26d7e09
api: filter_uuid: emit planes for a bit longer
wiedehopf Dec 22, 2025
69d4538
docker: use zstd compression
wiedehopf Dec 24, 2025
14881d2
add macro to print current line
wiedehopf Dec 31, 2025
f0e2ed9
add debug mechanism for garbage counter incrementing
wiedehopf Dec 31, 2025
1e3ba48
beast: don't assume garbage for long messages
wiedehopf Dec 31, 2025
d85add5
fixup encapsulated UAT msg length check
wiedehopf Jan 1, 2026
ba52568
beast: default disabled debugging for sender not flushing whole messages
wiedehopf Jan 1, 2026
800aca0
Fix early return in decodeBDS44 pressure scoring
nandortoth Jan 10, 2026
bd95a8a
detect bad tuners and log / make available in json
wiedehopf Jan 17, 2026
7824553
incrementing version: 3.16.9
wiedehopf Jan 17, 2026
5831f91
change default autogain parameters
wiedehopf Feb 3, 2026
a88e53b
fix up tat / oat missing from traces
wiedehopf Feb 28, 2026
f31032a
incrementing version: 3.16.10
wiedehopf Feb 28, 2026
7d341c6
Fix addrtype_t out of bounds
Huusky Feb 28, 2026
7daf436
ingest: limit position rate
wiedehopf Apr 4, 2026
c2af854
docker: add with_uuids build
wiedehopf Apr 4, 2026
9f7071c
non transponder: lower priority
wiedehopf Apr 4, 2026
9a9da7a
threadpool: add ifdef dependent debug prints
wiedehopf Apr 5, 2026
eb63596
threadpool: add busy loop counting
wiedehopf Apr 5, 2026
ba2fae1
threadpool: improve variable naming
wiedehopf Apr 5, 2026
0dfa2aa
threadpool: use fetch_sub instead of compare exchange
wiedehopf Apr 6, 2026
5425345
use madvise just in case for transparent hugepages
wiedehopf Apr 6, 2026
15917d7
remove spurious unused declaration
wiedehopf Apr 6, 2026
4da537f
incrementing version: 3.16.11
wiedehopf Apr 6, 2026
6ecea84
Fix: wind assignment & duplicate check
Huusky Apr 8, 2026
6d31c98
make hugepage handling better
wiedehopf Apr 9, 2026
4d6c614
Refactor: update hugepage definitions and usage in memory allocation
billmcilhargey Apr 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: docker build

on:
schedule:
- cron: "0 10 * * *"
- cron: "0 5 * * 1"
push:
branches:
- "**"
- "dev"
- "sid"
tags:
- "v*.*.*"
- "v*.*.*"
pull_request:
branches:
- "dev"
- "dev"

jobs:
docker:
Expand All @@ -21,8 +22,8 @@ jobs:
- name: Set variables useful for later
id: useful_vars
run: |-
echo "::set-output name=timestamp::$(date +%s)"
echo "::set-output name=short_sha::${GITHUB_SHA::8}"
echo "name=timestamp::$(date +%s)" >> $GITHUB_OUTPUT
echo "name=short_sha::${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
Expand Down Expand Up @@ -52,13 +53,6 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v4
with:
Expand All @@ -67,5 +61,6 @@ jobs:
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
49 changes: 22 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
FROM debian:bookworm-20240311 AS builder
RUN apt-get update && \
apt-get install -y git wget pkg-config autoconf gcc make libusb-1.0-0-dev librtlsdr-dev librtlsdr0 libncurses-dev zlib1g-dev zlib1g libzstd-dev libzstd1
FROM ghcr.io/wiedehopf/readsb-builder:latest AS builder

# install jemalloc
RUN JEMALLOC_BDIR=$(mktemp -d) && \
git clone --depth 1 https://github.com/jemalloc/jemalloc $JEMALLOC_BDIR && \
cd $JEMALLOC_BDIR && \
./autogen.sh && \
./configure --with-lg-page=14 && \
make -j$(nproc) && \
make install && \
rm -rf $JEMALLOC_BDIR

# install readsb
RUN mkdir -p /app/git
COPY . /app/git
RUN cd /app/git && \
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
RUN --mount=type=bind,source=.,target=/app/git \
cd /app/git && \
READSB_BUILD_DIR=$(mktemp -d) && \
cp -r /app/git/* $READSB_BUILD_DIR && \
cp -aT /app/git $READSB_BUILD_DIR && \
cd $READSB_BUILD_DIR && \
make -j$(nproc) RTLSDR=yes OPTIMIZE="-O2" && \
[[ $(uname -m) == x86_64 ]] && MARCH=" -march=nehalem" || MARCH="" && \
make -j$(nproc) RTLSDR=yes OPTIMIZE="-O2 $MARCH" && \
mv readsb /usr/local/bin && \
mv viewadsb /usr/local/bin && \
chmod +x /usr/local/bin/viewadsb /usr/local/bin/readsb && \
make clean && \
make -j$(nproc) PRINT_UUIDS=yes TRACKS_UUID=yes OPTIMIZE="-O2" && \
make -j$(nproc) WITH_UUIDS=yes OPTIMIZE="-O2 $MARCH" && \
mv readsb /usr/local/bin/readsb-with-uuids && \
make clean && \
make -j$(nproc) PRINT_UUIDS=yes TRACKS_UUID=yes OPTIMIZE="-O2 $MARCH" && \
mv readsb /usr/local/bin/readsb-uuid && \
mv viewadsb /usr/local/bin/viewadsb-uuid && \
chmod +x /usr/local/bin/viewadsb-uuid && \
Expand All @@ -35,18 +26,22 @@ RUN cd /app/git && \
true

FROM debian:bookworm-slim
RUN apt-get update && \
RUN \
--mount=type=bind,from=builder,source=/,target=/builder/ \
apt-get update && \
apt-get -y install --no-install-recommends \
wget \
librtlsdr0 libncurses6 zlib1g libzstd1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
mkdir -p /run/readsb
mkdir -p /run/readsb && \
cp /builder/usr/local/bin/readsb* /usr/local/bin/ && \
cp /builder/usr/local/bin/viewadsb* /usr/local/bin/ && \
mkdir -p /usr/local/share/tar1090 && \
cp /builder/usr/local/share/tar1090/aircraft.csv.gz /usr/local/share/tar1090/aircraft.csv.gz && \
cp /builder/usr/local/lib/libjemalloc.so.2 /usr/local/lib/libjemalloc.so.2 && \
true

ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2
COPY --from=builder /usr/local/bin/readsb* /usr/local/bin/
COPY --from=builder /usr/local/bin/viewadsb* /usr/local/bin/
COPY --from=builder /usr/local/share/tar1090/aircraft.csv.gz /usr/local/share/tar1090/aircraft.csv.gz
COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/libjemalloc.so.2
ENV MALLOC_CONF=narenas:1,tcache:false

ENTRYPOINT ["/usr/local/bin/readsb"]
153 changes: 98 additions & 55 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,114 +8,155 @@ PLUTOSDR ?= no
SOAPYSDR ?= no
AGGRESSIVE ?= no
HAVE_BIASTEE ?= no
# TRACKS_UUID saves the uuid for each position to historic / current traces (often multiple uuids will send the
# same position, in this case the first uuid to contribute the position will be noted as only one
# uuid is saved)
# this will invalidate your persistent state so changing this option will mean you lose up to 24h of historic
# traces
TRACKS_UUID ?= no
# WITH_UUIDS saves the last up to RECENT_RECEICER_IDS (default 32) with each aircraft
# this increase memory usage a bit but allows filtering the API by uuid (&filter_uuid)
WITH_UUIDS ?= no
# PRINT_UUIDS implies WITH_UUIDS and also prints all uuids an aircraft is heard from into
# aircraft.json and other json output
PRINT_UUIDS ?= no

DIALECT = -std=c11
CFLAGS = $(DIALECT) -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2
CFLAGS = $(DIALECT) -W -Wall -Werror -fno-common -O2
CFLAGS += -DMODES_READSB_VERSION=\"$(READSB_VERSION)\"
CFLAGS += -Wdate-time -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security

LIBS = -pthread -lpthread -lm -lrt -lzstd
CFLAGS += -DREADSB_SHORT_VERSION=\"$(shell cat version)\"
CFLAGS += -DREADSB_SHORT_COMMIT=\"$(shell git describe --abbrev --dirty --always || echo nogit)\"
CFLAGS += -Wdate-time -fstack-protector-strong -Wformat -Werror=format-security

# Platform-specific settings
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
CFLAGS += -D_GNU_SOURCE -D_DEFAULT_SOURCE
CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
LIBS = -pthread -lpthread -lm -lrt -lzstd
else ifeq ($(UNAME), Darwin)
CFLAGS += -D_DARWIN_C_SOURCE
CFLAGS += -I./compat/apple # For epoll_shim.h
CFLAGS += -I/opt/homebrew/include # For zstd.h
LDFLAGS += -L/opt/homebrew/lib
LIBS = -pthread -lpthread -lm -lzstd
COMPAT += compat/apple/epoll_shim.o
else
LIBS = -pthread -lpthread -lm -lrt -lzstd
endif

ifeq ($(ZLIB_STATIC), yes)
LIBS += -l:libz.a
else
LIBS += -lz
LIBS += -lz
endif

ifeq ($(shell $(CC) -c feature_test.c -o feature_test.o -Wno-format-truncation -Werror >/dev/null 2>&1 && echo 1 || echo 0), 1)
CFLAGS += -Wno-format-truncation
CFLAGS += -Wno-format-truncation
endif

ifeq ($(shell uname -m | grep -qs -e arm -e aarch64 >/dev/null 2>&1 && echo 1 || echo 0), 1)
CFLAGS += -DSC16Q11_TABLE_BITS=8
CFLAGS += -DSC16Q11_TABLE_BITS=8
endif

ifeq ($(DISABLE_INTERACTIVE), yes)
CFLAGS += -DDISABLE_INTERACTIVE
CFLAGS += -DDISABLE_INTERACTIVE
else
LIBS += $(shell pkg-config --libs ncurses)
ifeq ($(UNAME), Darwin)
LIBS += $(shell pkg-config --libs ncurses 2>/dev/null || echo -lncurses)
else
LIBS += $(shell pkg-config --libs ncurses)
endif
endif

# only disable workaround if zerocopy is disabled in librtlsdr, otherwise expect significantly increased CPU use
ifeq ($(DISABLE_RTLSDR_ZEROCOPY_WORKAROUND), yes)
CFLAGS += -DDISABLE_RTLSDR_ZEROCOPY_WORKAROUND
CFLAGS += -DDISABLE_RTLSDR_ZEROCOPY_WORKAROUND
endif

ifeq ($(HISTORY), yes)
CFLAGS += -DALL_JSON=1
ifeq ($(LTO), yes)
CFLAGS += -flto
LDFLAGS += -flto
endif

ifneq ($(PREAMBLE_THRESHOLD_DEFAULT),)
CFLAGS += -DPREAMBLE_THRESHOLD_DEFAULT=$(PREAMBLE_THRESHOLD_DEFAULT)
ifeq ($(HISTORY), yes)
CFLAGS += -DALL_JSON=1
endif

ifneq ($(GLOBE_PERM_IVAL),)
CFLAGS += -DGLOBE_PERM_IVAL=$(GLOBE_PERM_IVAL)
ifneq ($(PREAMBLE_THRESHOLD_DEFAULT),)
CFLAGS += -DPREAMBLE_THRESHOLD_DEFAULT=$(PREAMBLE_THRESHOLD_DEFAULT)
endif

ifneq ($(TRACE_THREADS),)
CFLAGS += -DTRACE_THREADS=$(TRACE_THREADS)
CFLAGS += -DTRACE_THREADS=$(TRACE_THREADS)
endif

ifneq ($(TRACE_RECENT_POINTS),)
CFLAGS += -DTRACE_RECENT_POINTS=$(TRACE_RECENT_POINTS)
CFLAGS += -DTRACE_RECENT_POINTS=$(TRACE_RECENT_POINTS)
endif

ifneq ($(AIRCRAFT_HASH_BITS),)
CFLAGS += -DAIRCRAFT_HASH_BITS=$(AIRCRAFT_HASH_BITS)
CFLAGS += -DAIRCRAFT_HASH_BITS=$(AIRCRAFT_HASH_BITS)
endif

ifeq ($(STATS_PHASE),yes)
CFLAGS += -DSTATS_PHASE
CFLAGS += -DSTATS_PHASE
endif

ifeq ($(TRACKS_UUID), yes)
CFLAGS += -DTRACKS_UUID
CFLAGS += -DTRACKS_UUID
endif

ifeq ($(WITH_UUIDS), yes)
CFLAGS += -DWITH_UUIDS
endif

ifneq ($(RECENT_RECEIVER_IDS),)
CFLAGS += -DRECENT_RECEIVER_IDS=$(RECENT_RECEIVER_IDS)
endif

ifeq ($(PRINT_UUIDS), yes)
CFLAGS += -DPRINT_UUIDS
CFLAGS += -DPRINT_UUIDS
endif

ifneq ($(RECENT_RECEIVER_IDS),)
CFLAGS += -DRECENT_RECEIVER_IDS=$(RECENT_RECEIVER_IDS)
CFLAGS += -DRECENT_RECEIVER_IDS=$(RECENT_RECEIVER_IDS)
endif

ifeq ($(RTLSDR), yes)
SDR_OBJ += sdr_rtlsdr.o
CFLAGS += -DENABLE_RTLSDR
SDR_OBJ += sdr_rtlsdr.o
CFLAGS += -DENABLE_RTLSDR

ifeq ($(HAVE_BIASTEE), yes)
CFLAGS += -DENABLE_RTLSDR_BIASTEE
endif
ifeq ($(HAVE_BIASTEE), yes)
CFLAGS += -DENABLE_RTLSDR_BIASTEE
endif

ifdef RTLSDR_PREFIX
CFLAGS += -I$(RTLSDR_PREFIX)/include
LDFLAGS += -L$(RTLSDR_PREFIX)/lib
else
CFLAGS += $(shell pkg-config --cflags librtlsdr)
LDFLAGS += $(shell pkg-config --libs-only-L librtlsdr)
endif
ifdef RTLSDR_PREFIX
CFLAGS += -I$(RTLSDR_PREFIX)/include
LDFLAGS += -L$(RTLSDR_PREFIX)/lib
else
CFLAGS += $(shell pkg-config --cflags librtlsdr)
LDFLAGS += $(shell pkg-config --libs-only-L librtlsdr)
endif

ifeq ($(STATIC), yes)
LIBS_SDR += -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
else
LIBS_SDR += -lrtlsdr -lusb-1.0
endif
# static linking not well supported, use at own risk
ifeq ($(STATIC), yes)
LIBS_SDR += -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
else
LIBS_SDR += -lrtlsdr -lusb-1.0
endif
endif

ifeq ($(BLADERF), yes)
SDR_OBJ += sdr_bladerf.o sdr_ubladerf.o
CFLAGS += $(shell pkg-config --cflags libbladeRF) -DENABLE_BLADERF
LIBS_SDR += $(shell pkg-config --libs libbladeRF)
SDR_OBJ += sdr_bladerf.o sdr_ubladerf.o
CFLAGS += $(shell pkg-config --cflags libbladeRF) -DENABLE_BLADERF
LIBS_SDR += $(shell pkg-config --libs libbladeRF)
endif

ifeq ($(HACKRF), yes)
SDR_OBJ += sdr_hackrf.o
CFLAGS += $(shell pkg-config --cflags libhackrf) -DENABLE_HACKRF
LIBS_SDR += $(shell pkg-config --libs libhackrf)
SDR_OBJ += sdr_hackrf.o
CFLAGS += $(shell pkg-config --cflags libhackrf) -DENABLE_HACKRF
LIBS_SDR += $(shell pkg-config --libs libhackrf)
endif

ifeq ($(PLUTOSDR), yes)
Expand All @@ -125,9 +166,9 @@ ifeq ($(PLUTOSDR), yes)
endif

ifeq ($(SOAPYSDR), yes)
SDR_OBJ += sdr_soapy.o
CFLAGS += $(shell pkg-config --cflags SoapySDR) -DENABLE_SOAPYSDR
LIBS_SDR += $(shell pkg-config --libs SoapySDR)
SDR_OBJ += sdr_soapy.o
CFLAGS += $(shell pkg-config --cflags SoapySDR) -DENABLE_SOAPYSDR
LIBS_SDR += $(shell pkg-config --libs SoapySDR)
endif

# add custom overrides if user defines them
Expand All @@ -147,13 +188,10 @@ readsb.o: readsb.c *.h .version
%.o: %.c *.h
$(CC) $(CFLAGS) -c $< -o $@

minilzo.o: minilzo/minilzo.c minilzo/minilzo.h
$(CC) $(CFLAGS) -c $< -o $@

readsb: readsb.o argp.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o json_out.o net_io.o crc.o demod_2400.o \
uat2esnt/uat2esnt.o uat2esnt/uat_decode.o \
stats.o cpr.o icao_filter.o track.o util.o fasthash.o convert.o sdr_ifile.o sdr_beast.o sdr.o ais_charset.o \
globe_index.o geomag.o receiver.o aircraft.o api.o minilzo.o threadpool.o \
globe_index.o geomag.o receiver.o aircraft.o api.o threadpool.o \
$(SDR_OBJ) $(COMPAT)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_SDR) $(OPTIMIZE)

Expand All @@ -162,18 +200,23 @@ viewadsb: readsb
cp readsb viewadsb

clean:
rm -f *.o uat2esnt/*.o compat/clock_gettime/*.o compat/clock_nanosleep/*.o readsb viewadsb cprtests crctests convert_benchmark
rm -f *.o uat2esnt/*.o compat/clock_gettime/*.o compat/clock_nanosleep/*.o compat/apple/*.o readsb viewadsb cprtests crctests convert_benchmark

test: cprtest crctest

cprtest: cprtests
./cprtests

crctest: cprtests
./cprtests

cprtests: cpr.o cprtests.o
$(CC) $(CFLAGS) -o $@ $^ -lm

crctests: crc.c crc.h
$(CC) $(CFLAGS) -DCRCDEBUG -o $@ $<

benchmarks: convert_benchmark
benchmarks: oneoff/convert_benchmark
./convert_benchmark

oneoff/convert_benchmark: oneoff/convert_benchmark.o convert.o util.o
Expand Down
Loading