From f79d67eb3998f45cc1935169c6dfe835cea7f6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Ho=CC=88chst?= Date: Mon, 18 Oct 2021 17:29:44 +0200 Subject: [PATCH] separated radiotracking from config module --- etc/caddy/Caddyfile | 4 ++++ etc/systemd/system/radiotracking-config.service | 15 +++++++++++++++ home/pi/pyradiotracking | 2 +- tRackIT.Pifile | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 etc/systemd/system/radiotracking-config.service diff --git a/etc/caddy/Caddyfile b/etc/caddy/Caddyfile index 9a7be83..0163890 100644 --- a/etc/caddy/Caddyfile +++ b/etc/caddy/Caddyfile @@ -9,6 +9,10 @@ reverse_proxy http://localhost:8050 } + route /radiotracking-config/* { + reverse_proxy http://localhost:8051 + } + file_server * browse { root /data/ } diff --git a/etc/systemd/system/radiotracking-config.service b/etc/systemd/system/radiotracking-config.service new file mode 100644 index 0000000..00bcda1 --- /dev/null +++ b/etc/systemd/system/radiotracking-config.service @@ -0,0 +1,15 @@ +[Unit] +Description=RadioTracking Configuration +After=network.target mosquitto.service time-sync.target hostname-config.service + +StartLimitIntervalSec=600 +StartLimitAction=reboot + +[Service] +ExecStart=bash -c "/usr/bin/python3 -m radiotracking.config --config /boot/radiotracking.ini --station `hostname` --dashboard --dashboard-host localhost --dashboard-port 8050 --mqtt --mqtt-host localhost --mqtt-port 1883 --csv --export-config --path /data" +Restart=always +RestartSec=10s + +[Install] +WantedBy=multi-user.target + diff --git a/home/pi/pyradiotracking b/home/pi/pyradiotracking index db53a4f..48d5020 160000 --- a/home/pi/pyradiotracking +++ b/home/pi/pyradiotracking @@ -1 +1 @@ -Subproject commit db53a4fc07a8b5f38111c059b96edb42cea5ecf1 +Subproject commit 48d50209ec8834b444a3776729b3a8b9f5657177 diff --git a/tRackIT.Pifile b/tRackIT.Pifile index 8943060..ad0ad41 100644 --- a/tRackIT.Pifile +++ b/tRackIT.Pifile @@ -109,6 +109,7 @@ RUN mkdir /data RUN chown pi:pi /data RUN ln -s . /data/sysdweb RUN ln -s . /data/radiotracking +RUN ln -s . /data/radiotracking-config RUN ln -s /boot/ /data/boot # enable caddy @@ -159,8 +160,13 @@ RUN tee -a /etc/modprobe.d/raspi-blacklist.conf <<<'blacklist dvb_usb_rtl28xxu' # Install radiotracking RUN python3 -m pip install -e /home/pi/pyradiotracking RUN systemctl enable radiotracking.service +RUN systemctl enable radiotracking-config.service RUN tee -a /etc/sysdweb.conf <