Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
reorganized repo struture
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashoechst committed Mar 9, 2021
1 parent 58376e0 commit 799c567
Show file tree
Hide file tree
Showing 67 changed files with 227 additions and 211 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
uses: Nature40/[email protected]
with:
pifile: Base.Pifile
- name: Run Radiotracking Pifile
- name: Run tRackIT Pifile
uses: Nature40/[email protected]
with:
pifile: RadioTracking.Pifile
pifile: tRackIT.Pifile

- name: Package RadioTracking.zip
run: zip RadioTracking.zip RadioTracking.img
- name: Package tRackIT.zip
run: zip tRackIT.zip tRackIT.img
- name: Create GitHub release
id: create_release
uses: actions/[email protected]
Expand All @@ -36,13 +36,13 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
- name: Upload RadioTracking.zip to release
id: upload_radiotracking_zip
- name: Upload tRackIT.zip to release
id: upload_trackit_zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: RadioTracking.zip
asset_name: RadioTracking.zip
asset_path: tRackIT.zip
asset_name: tRackIT.zip
asset_content_type: application/zip
14 changes: 4 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@
path = pimod
url = https://github.com/Nature40/pimod.git
[submodule "Base/home/pi/sysdweb"]
path = Base/home/pi/sysdweb
path = home/pi/sysdweb
url = https://github.com/Nature40/sysdweb
[submodule "Base/home/pi/uhubctl"]
path = Base/home/pi/uhubctl
path = home/pi/uhubctl
url = https://github.com/mvp/uhubctl
[submodule "RadioTracking/home/pi/rtlsdr_signal_detect"]
path = RadioTracking/home/pi/rtlsdr_signal_detect
url = https://github.com/Nature40/rtlsdr_signal_detect.git
[submodule "RadioTracking/home/pi/pyradiotracking"]
path = RadioTracking/home/pi/pyradiotracking
path = home/pi/pyradiotracking
url = https://github.com/Nature40/pyradiotracking.git
[submodule "RadioTracking/home/pi/pyradiotracking-lora"]
path = RadioTracking/home/pi/pyradiotracking-lora
url = https://github.com/Nature40/pyradiotracking-lora.git
[submodule "RadioTracking/home/pi/pymqttutil"]
path = RadioTracking/home/pi/pymqttutil
path = home/pi/pymqttutil
url = https://github.com/Nature40/pymqttutil
3 changes: 0 additions & 3 deletions .run.Pifile

This file was deleted.

111 changes: 15 additions & 96 deletions Base.Pifile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2020-08-24/2020-08-20-raspios-buster-arm64-lite.zip
PUMP 700M
PUMP 1000M

# Update OS and sources
RUN bash -c "echo y | rpi-update"
Expand All @@ -22,61 +22,6 @@ RUN apt-get install -y \
dnsmasq \
bridge-utils

# Set default password
RUN bash -c 'echo "pi:natur" | chpasswd'

# Allow basic connectivity (0 == success status code - enable)
RUN raspi-config nonint do_ssh 0

# Install configuration files
INSTALL Base /
RUN chown -R pi:pi /home/pi/

# Fix permissions on host ssh files
RUN bash -c 'chown root:root /etc/ssh/ssh_host_*'
RUN bash -c 'chmod 600 /etc/ssh/ssh_host_*_key'
RUN bash -c 'chmod 644 /etc/ssh/ssh_host_*_key.pub'
RUN systemctl disable regenerate_ssh_host_keys

# Install user ssh files and fix permissions
INSTALL Base/home/pi/.ssh /home/pi/.ssh
RUN chown pi:pi /home/pi
RUN chown pi:pi /home/pi/.ssh
RUN chown pi:pi /home/pi/.ssh/id_ed25519
RUN chown pi:pi /home/pi/.ssh/id_ed25519.pub
RUN chown pi:pi /home/pi/.ssh/authorized_keys
RUN chmod 755 /home/pi
RUN chmod 700 /home/pi/.ssh
RUN chmod 600 /home/pi/.ssh/id_ed25519
RUN chmod 644 /home/pi/.ssh/id_ed25519.pub
RUN chmod 644 /home/pi/.ssh/authorized_keys

# Install root ssh files and fix permissions
INSTALL Base/home/pi/.ssh /root/.ssh
RUN chown root:root /root
RUN chown root:root /root/.ssh
RUN chown root:root /root/.ssh/id_ed25519
RUN chown root:root /root/.ssh/id_ed25519.pub
RUN chown root:root /root/.ssh/authorized_keys
RUN chmod 755 /root
RUN chmod 700 /root/.ssh
RUN chmod 600 /root/.ssh/id_ed25519
RUN chmod 644 /root/.ssh/id_ed25519.pub
RUN chmod 644 /root/.ssh/authorized_keys

# Set Europe/Berlin timezone
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime

# set git config for possible local commits
RUN git config --global user.email "root@nature40-sensorbox"
RUN git config --global user.name "Nature 4.0 Sensorbox"

# Install uhubctl
RUN bash -c 'cd /home/pi/uhubctl; make; make install'

# enable hostname-config script
RUN systemctl enable hostname-config.service

# install wireguard (requires rpi-update from above)
RUN bash -c "wget http://archive.raspbian.org/raspbian.public.key -O - | apt-key add -"
RUN tee -a /etc/apt/sources.list.d/testing.list <<EOF
Expand All @@ -90,16 +35,7 @@ EOF
RUN apt-get update
RUN apt-get install -y wireguard-tools

# enable wireguard
RUN ln -s /boot/wireguard.conf /etc/wireguard/wireguard.conf
RUN systemctl enable wg-quick@wireguard
RUN tee -a /etc/sysdweb.conf <<EOF
[wg-quick@wireguard]
title = Wireguard (/boot/wireguard.conf)
unit = wg-quick@wireguard
EOF

# Install and enable caddy
# Install caddy
RUN curl -o /usr/bin/caddy "https://caddyserver.com/api/download?os=linux&arch=arm64"
RUN chmod +x /usr/bin/caddy
RUN groupadd --system caddy
Expand All @@ -110,36 +46,19 @@ RUN useradd --system \
--shell /usr/sbin/nologin \
--comment "Caddy web server" \
caddy
RUN systemctl enable caddy
RUN tee -a /etc/sysdweb.conf <<EOF
[caddy]
title = Caddy Web Server
unit = caddy
EOF

# Install and enable sysdweb
RUN apt-get install -y python3-systemd python3-dbus libdbus-glib-1-dev
RUN python3 -m pip install -e /home/pi/sysdweb
RUN systemctl enable sysdweb

# Create symlinks for other webserver targets
RUN mkdir /data
RUN chown pi:pi /data
RUN ln -s . /data/sysdweb
RUN ln -s /boot/ /data/boot
# Install mosquitto
RUN apt-get install -y mosquitto mosquitto-clients

# Dump dmesg to disk
RUN systemctl enable dmesgdump

# enable wifi-config script
RUN systemctl enable [email protected]

# Modify default network settings
RUN bash -c "echo net.ipv4.ip_forward=1 | tee -a /etc/sysctl.conf"
RUN bash -c "echo net.ipv4.icmp_echo_ignore_broadcasts=0 | tee -a /etc/sysctl.conf"

# enable hostapd-config script
RUN systemctl enable hostapd-config.service
RUN systemctl enable hostapd.service
# Install sysdweb dependecies
RUN apt-get install -y python3-systemd python3-dbus libdbus-glib-1-dev

RUN bash -c 'CMDLINE=$(cat /boot/cmdline.txt); echo "${CMDLINE} -- systemd.hostname=tRackIT" > /boot/cmdline.txt'
# Install pyradiotracking dependecies
RUN apt-get install -y \
rtl-sdr \
python3 \
python3-pip \
python3-numpy \
python3-scipy \
python3-paho-mqtt
RUN python3 -m pip install dash
11 changes: 0 additions & 11 deletions Base/etc/caddy/Caddyfile

This file was deleted.

6 changes: 0 additions & 6 deletions Base/hosts

This file was deleted.

74 changes: 0 additions & 74 deletions RadioTracking.Pifile

This file was deleted.

1 change: 0 additions & 1 deletion RadioTracking/home/pi/pyradiotracking
Submodule pyradiotracking deleted from 111c61
1 change: 0 additions & 1 deletion RadioTracking/home/pi/pyradiotracking-lora
Submodule pyradiotracking-lora deleted from bb77bc
1 change: 0 additions & 1 deletion RadioTracking/home/pi/rtlsdr_signal_detect
Submodule rtlsdr_signal_detect deleted from 1b65c1
File renamed without changes.
12 changes: 12 additions & 0 deletions boot/mosquitto.d/dsgw.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# connection
connection bridge-rts-sensorbox
address dsgw.mathematik.uni-marburg.de:8883
allow_anonymous true
remote_username sensorbox
remote_password gckoydnogabkepahhoulfaohcunoicf
topic +/radiotracking/device/+/json out 0
topic +/radiotracking/matched/json out 0
topic +/mqttutil/# out 0
topic # in 0

bridge_cafile /boot/mosquitto.d/dsgw.crt
24 changes: 24 additions & 0 deletions boot/mosquitto.d/dsgw.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEBjCCAu4CCQClFTHPDA22wDANBgkqhkiG9w0BAQUFADCBxDELMAkGA1UEBhMC
REUxDzANBgNVBAgMBkhlc3NlbjEQMA4GA1UEBwwHTWFyYnVyZzEeMBwGA1UECgwV
VW5pdmVyc2l0eSBvZiBNYXJidXJnMRwwGgYDVQQLDBNEaXN0cmlidXRlZCBTeXN0
ZW1zMScwJQYDVQQDDB5kc2d3Lm1hdGhlbWF0aWsudW5pLW1hcmJ1cmcuZGUxKzAp
BgkqhkiG9w0BCQEWHGRzQG1hdGhlbWF0aWsudW5pLW1hcmJ1cmcuZGUwHhcNMjEw
MjEyMTMzNDAxWhcNMjIwMjA3MTMzNDAxWjCBxDELMAkGA1UEBhMCREUxDzANBgNV
BAgMBkhlc3NlbjEQMA4GA1UEBwwHTWFyYnVyZzEeMBwGA1UECgwVVW5pdmVyc2l0
eSBvZiBNYXJidXJnMRwwGgYDVQQLDBNEaXN0cmlidXRlZCBTeXN0ZW1zMScwJQYD
VQQDDB5kc2d3Lm1hdGhlbWF0aWsudW5pLW1hcmJ1cmcuZGUxKzApBgkqhkiG9w0B
CQEWHGRzQG1hdGhlbWF0aWsudW5pLW1hcmJ1cmcuZGUwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQC4l9OqpW9b81wA0Z58zgSLVs+sGC1EfXPMcQaWZl+/
OkQhmCKs8eXbv9x+3zKQk9bMCx4ZXd+IEhFhXRAM+Yha6syW5dUlM8cfr1Ojo7Wo
WNSI6Da7rwAF/eSe6w7zTKaTn0GJQMix+H3y+slqUifFJ+/KTC1HmGdBpDN6++w3
ZszP08aM3G4IGDsTDeqnw8SKakq73reT1B6r0FU/JXDXuT/No/aAJEodKluXUG+R
+rdbVGAbKvVp+JnTV/Yf3h8ZlnxkHnXvRpP82NfyQHl0UuvNYSSae/PZ/kBiOUaD
VPF0VJbjBTDrnU4fIO+SQGCs57LU4ZhzMomhVDxi5ywnAgMBAAEwDQYJKoZIhvcN
AQEFBQADggEBAA95J6+yQzmNxNLrDIGIC77bGKER+pTjHI3SuLwJuRzibRlghY6l
LALhCJo+DZFCBf9zKooT6g/uDqWpIkTolj/bm8nrwki+bhiNVgY1ebTISW4ePIeu
pya81RdpgeWxLLLhDUEEturoGLUoezoxiJZ2PRbTxxNPoZSen5yP26M4YXl1zuZk
wrCs1Gac/CE7CdDTG2d/BpHPKdY5LGpQqZWZ5VTdIoijox28e9A25uIryq1qLk0P
CjunBDc9xHDoVfapm5TGQWQdC0vgJ7+QA+yMW5o+1P7MWybX4aK3tBRHlpK974gD
OhjsQriS6vyWMeoSXVToAEOCR8MnK6fxlYg=
-----END CERTIFICATE-----
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions etc/mosquitto/mosquitto.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
include_dir /boot/mosquitto.d
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions home/pi/pyradiotracking
Submodule pyradiotracking added at 83bae1
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 799c567

Please sign in to comment.