Skip to content

Commit

Permalink
add mt map server
Browse files Browse the repository at this point in the history
  • Loading branch information
rpatel3001 committed May 24, 2024
1 parent fdc528c commit 7f0e964
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ RUN set -x && \
git clone https://github.com/muccc/iridium-toolkit.git /opt/iridium-toolkit && \
pushd /opt/iridium-toolkit && \
mv html/map.html html/index.html && \
mkdir html2 && \
mv html/mtmap.html html2/index.html && \
rm html/example.sh && \
git apply /tmp/iridium-toolkit.patch && \
popd && \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
tty: true # actually needed, for iridium-parser.py
ports:
- 8888:8888 # for beam map
- 8889:8889 # for mt map
device_cgroup_rules:
- 'c 189:* rwm'
volumes:
Expand Down
16 changes: 11 additions & 5 deletions rootfs/etc/s6-overlay/s6-rc.d/iridium-reassembler-map/run
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/command/with-contenv bash
#shellcheck shell=bash

echo "Starting map reassembler"
cd /opt/iridium-toolkit/html
if [[ -n $ENABLE_BEAM_MAP ]]; then
echo "Starting beam map reassembler"
cd /opt/iridium-toolkit/html

if [[ -n $LOG_MAP ]]; then
pypy3 -u /opt/iridium-toolkit/reassembler.py -i zmq: -m live-map 2>&1 | stdbuf -o0 awk '{print "[iridium-reassembler-map] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
if [[ -n $LOG_MAP ]]; then
pypy3 -u /opt/iridium-toolkit/reassembler.py -i zmq: -m live-map 2>&1 | stdbuf -o0 awk '{print "[iridium-reassembler-map] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
else
pypy3 -u /opt/iridium-toolkit/reassembler.py -i zmq: -m live-map &> /dev/null
fi
else
pypy3 -u /opt/iridium-toolkit/reassembler.py -i zmq: -m live-map &> /dev/null
echo "beam map not enabled"
sleep infinity
exit 0
fi
6 changes: 3 additions & 3 deletions rootfs/etc/s6-overlay/s6-rc.d/iridium-reassembler-mtpos/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

if [[ -n $ENABLE_MTPOS_MAP ]]; then
echo "Starting mtpos map reassembler"
cd /opt/iridium-toolkit/html
cd /opt/iridium-toolkit/html2

if [[ -n $ENABLE_MTPOS_MAP_LOG ]]; then
pypy3 -u /opt/iridium-toolkit/reassembler.py -i zmq: -m live-mt-map 2>&1 | stdbuf -o0 awk '{print "[iridium-reassembler-map] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
if [[ -n $LOG_MTMAP ]]; then
pypy3 -u /opt/iridium-toolkit/reassembler.py -i zmq: -m live-mt-map 2>&1 | stdbuf -o0 awk '{print "[iridium-reassemblmter-map] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
else
pypy3 -u /opt/iridium-toolkit/reassembler.py -i zmq: -m live-mt-map &> /dev/null
fi
Expand Down
11 changes: 11 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/mtmap-server/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/command/with-contenv bash
#shellcheck shell=bash

echo "Starting mtmap-server"
cd /opt/iridium-toolkit/html2

if [[ -n $LOG_MTMAP ]]; then
python3 -m http.server --bind 0.0.0.0 8889 2>&1 | stdbuf -o0 awk '{print "[mtmap-server] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
else
python3 -m http.server --bind 0.0.0.0 8889 &> /dev/null
fi
1 change: 1 addition & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/mtmap-server/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.

0 comments on commit 7f0e964

Please sign in to comment.