This commit is contained in:
Alexandre
2024-04-25 11:12:22 +02:00
parent 50708e068f
commit e9891955be
25 changed files with 52 additions and 49 deletions

View File

@@ -24,7 +24,8 @@ ENV DEBIAN_FRONTEND="noninteractive" \
PUID=1000 \
PGID=1000 \
HOME="/home/abc" \
XDG_RUNTIME_DIR="/run/user/1000"
XDG_RUNTIME_DIR="/run/user/1000" \
PYTHON_VIRTUAL_ENV="/home/abc/BirdNET-Pi/birdnet/bin/python3"
# hadolint ignore=DL3015,SC2016
RUN \
@@ -56,14 +57,14 @@ RUN \
\
/./newinstaller.sh && \
\
# Adapt for lsio
if [ -d /app ]; then rm -r /app; fi && \
ln -s /home/abc /app && \
chown -R abc:abc /home/abc /app && \
\
# Change user to pi
groupmod -o -g "100" abc && usermod -o -u "100" abc && \
groupadd --gid 1000 pi && useradd --uid 1000 --gid 1000 -m pi
\
# Adapt for lsio
if [ -d /app ]; then rm -r /app; fi && \
ln -s /home/abc /app && \
chown -R pi:pi /home/abc /app
#USER abc
#WORKDIR /app

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
#!/usr/bin/with-contenv bashio
s6-setuidgid ${USER}
echo "Starting service: avahi alias"

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
s6-setuidgid ${USER}
#!/usr/bin/with-contenv bashio
echo "Starting service: birdnet log"
/usr/local/bin/gotty --address localhost -p 8080 --path log --title-format "BirdNET-Pi Log" birdnet_log.sh
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 +1,4 @@
#!/usr/bin/with-contenv bash
#!/usr/bin/with-contenv bashio
if { sleep 6 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_recording

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bash
#!/usr/bin/with-contenv bashio
s6-setuidgid ${USER}
echo "Starting service: birdnet stats"
$HOME/BirdNET-Pi/birdnet/bin/streamlit run $HOME/BirdNET-Pi/scripts/plotly_streamlit.py --browser.gatherUsageStats false --server.address localhost --server.baseUrlPath "/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 +1,4 @@
#!/usr/bin/with-contenv bash
#!/usr/bin/with-contenv bashio
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-caddy

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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