This commit is contained in:
Alexandre
2024-04-27 17:17:24 +02:00
parent 59378169de
commit ab59864f1e
84 changed files with 101 additions and 178 deletions

1
birdnet-pi/CHANGELOG.md Normal file
View File

@@ -0,0 +1 @@
- Initial build

View File

@@ -36,8 +36,6 @@ RUN \
# Correct for systemctl
curl -f -L -s -S https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -o /bin/systemctl && \
chmod a+x /bin/systemctl && \
curl -f -L -s -S https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/journalctl3.py -o /bin/journalctl && \
chmod a+x /bin/journalctl && \
\
# Change user to pi and create /home/pi
echo "setting users" && \

100
birdnet-pi/config.json Normal file
View File

@@ -0,0 +1,100 @@
{
"arch": [
"aarch64",
"amd64"
],
"audio": true,
"backup": "cold",
"codenotary": "alexandrep.github@gmail.com",
"devices": [
"/dev/dri",
"/dev/dri/card0",
"/dev/dri/card1",
"/dev/dri/renderD128",
"/dev/vchiq",
"/dev/video10",
"/dev/video11",
"/dev/video12",
"/dev/video13",
"/dev/video14",
"/dev/video15",
"/dev/video16",
"/dev/ttyUSB0",
"/dev/sda",
"/dev/sdb",
"/dev/sdc",
"/dev/sdd",
"/dev/sde",
"/dev/sdf",
"/dev/sdg",
"/dev/nvme",
"/dev/nvme0n1p1",
"/dev/nvme0n1p2",
"/dev/mmcblk",
"/dev/fuse",
"/dev/sda1",
"/dev/sdb1",
"/dev/sdc1",
"/dev/sdd1",
"/dev/sde1",
"/dev/sdf1",
"/dev/sdg1",
"/dev/sda2",
"/dev/sdb2",
"/dev/sdc2",
"/dev/sdd2",
"/dev/sde2",
"/dev/sdf2",
"/dev/sdg2",
"/dev/sda3",
"/dev/sdb3",
"/dev/sda4",
"/dev/sdb4",
"/dev/sda5",
"/dev/sda6",
"/dev/sda7",
"/dev/sda8",
"/dev/nvme0",
"/dev/nvme1",
"/dev/nvme2"
],
"description": "realtime acoustic bird classification system",
"environment": {
},
"image": "ghcr.io/alexbelgium/birdnet-pi-{arch}",
"init": false,
"map": [
"addon_config:rw",
"media:rw",
"share:rw"
],
"name": "BirdNET-pi",
"panel_icon": "mdi:bird",
"ports": {
"80/tcp": 80
},
"ports_description": {
"80/tcp": "web ui"
},
"privileged": [
"SYS_ADMIN",
"DAC_READ_SEARCH"
],
"schema": {
"TZ": "str?",
"cifsdomain": "str?",
"cifspassword": "str?",
"cifsusername": "str?",
"localdisks": "str?",
"networkdisks": "str?"
},
"services": [
"mysql:want"
],
"slug": "birdnet-pi",
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi",
"usb": true,
"version": "1.5",
"video": true,
"webui": "[PROTO:ssl]://[HOST]:[PORT:80]"
}

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet analysis"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV" /usr/local/bin/birdnet_analysis.py

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet log"
exec \
s6-setuidgid "$USER" /usr/local/bin/gotty --address localhost -p 8080 --path log --title-format "BirdNET-Pi Log" birdnet_log.sh

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet stats"
exec \
s6-setuidgid "$USER" "$HOME"/BirdNET-Pi/birdnet/bin/streamlit run "$HOME"/BirdNET-Pi/scripts/plotly_streamlit.py --browser.gatherUsageStats false --server.address localhost --server.baseUrlPath "/stats"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: chart viewer"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV" /usr/local/bin/daily_plot.py --daemon --sleep 2

View File

@@ -1,8 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: getty"
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
exec \
s6-setuidgid "$USER" /sbin/agetty --autologin "${USER}" --noclear %I "$TERM"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: spectrogram viewer"
exec \
s6-setuidgid "$USER" /usr/local/bin/spectrogram.sh

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: web terminal"
exec \
s6-setuidgid "$USER" /usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format "BirdNET-Pi Terminal" login

View File

@@ -1,9 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet recording"
until [[ -e /start ]]; do
sleep 1s
done
exec \
s6-setuidgid "$USER" /usr/local/bin/birdnet_recording.sh

View File

@@ -1,8 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: livestream"
until [[ -e /start ]]; do
sleep 1s
done
exec \
s6-setuidgid "$USER" /usr/local/bin/livestream.sh

View File

@@ -1,16 +0,0 @@
#!/usr/bin/with-contenv bashio
#Disable pulseaudio as managed by HA
echo "Starting service: livestream"
until [[ -e /start ]]; do
sleep 1s
done
echo "Starting service: pulseaudio"
while :
do
if [[ ! $(/usr/bin/pulseaudio --check) ]]; then
exec \
s6-setuidgid "$USER" /usr/bin/pulseaudio --start
fi
sleep 10
done

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-custom_recording

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
s6-envdir /run/user/1000
s6-setuidgid ${USER}
/usr/local/bin/custom_recording.sh

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-avahi_alias

View File

@@ -1,5 +0,0 @@
#!/usr/bin/with-contenv bashio
s6-setuidgid ${USER}
echo "Starting service: avahi alias"
/bin/bash -c "/usr/bin/avahi-publish -a -R %I $(hostname -I |cut -d' ' -f1)"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_analysis

View File

@@ -1,5 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet analysis"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV /usr/local/bin/birdnet_analysis.py"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_log

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet log"
exec \
s6-setuidgid "$USER" "/usr/local/bin/gotty --address localhost -p 8080 --path log --title-format 'BirdNET-Pi Log' birdnet_log.sh"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 6 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_recording

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet recording"
exec \
s6-setuidgid "$USER" "/usr/local/bin/birdnet_recording.sh"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 5 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_stats

View File

@@ -1,5 +0,0 @@
#!/usr/bin/with-contenv bashio
s6-setuidgid ${USER}
echo "Starting service: birdnet stats"
exec \
s6-setuidgid "$USER" "$HOME/BirdNET-Pi/birdnet/bin/streamlit run $HOME/BirdNET-Pi/scripts/plotly_streamlit.py --browser.gatherUsageStats false --server.address localhost --server.baseUrlPath '/stats'"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-caddy

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: caddy"
exec \
s6-setuidgid "$USER" "/usr/local/bin/caddy run --config /etc/caddy/Caddyfile"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 120 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-chart_viewer

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: chart viewer"
exec \
s6-setuidgid "$USER" "$PYTHON_VIRTUAL_ENV /usr/local/bin/daily_plot.py --daemon --sleep 2"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-getty

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: getty"
exec \
s6-setuidgid "$USER" "/sbin/agetty --autologin ${USER} --noclear %I $TERM"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-livestream

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: livestream"
exec \
s6-setuidgid "$USER" "/usr/local/bin/livestream.sh"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 10 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-spectrogram_viewer

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: spectrogram viewer"
exec \
s6-setuidgid "$USER" "/usr/local/bin/spectrogram.sh"

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-web_terminal

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: web terminal"
exec \
s6-setuidgid "$USER" "/usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format 'BirdNET-Pi Terminal' login"