Disable pulseaudio here

This commit is contained in:
Alexandre
2025-03-27 13:31:31 +01:00
committed by GitHub
parent 81ef2e7f8b
commit 8ead86b6da

View File

@@ -19,9 +19,28 @@ fi
bashio::log.info "Adapting webui" bashio::log.info "Adapting webui"
# Remove services tab from webui # HA specific elements
echo "... removing System Controls from webui as should be used from HA" ######################
sed -i '/>System Controls/d' "$HOME/BirdNET-Pi/homepage/views.php"
if bashio::supervisor.ping 2>/dev/null; then
# Remove services tab from webui
echo "... removing System Controls from webui as should be used from HA"
sed -i '/>System Controls/d' "$HOME/BirdNET-Pi/homepage/views.php"
# Remove pulseaudio
echo "... disabling pulseaudio as managed by HomeAssistant"
for file in $(grep -srl "pulseaudio --start" $HOME/BirdNET-Pi/scripts); do
sed -i "s|! pulseaudio --check|pulseaudio --check|g" "$file"
done
# Check if port 80 is correctly configured
if [ -n "$(bashio::addon.port "80")" ] && [ "$(bashio::addon.port "80")" != 80 ]; then
bashio::log.fatal "The port 80 is enabled, but should still be 80 if you want automatic SSL certificates generation to work."
fi
fi
# General elements
##################
# Remove Ram drive option from webui # Remove Ram drive option from webui
echo "... removing Ram drive from webui as it is handled from HA" echo "... removing Ram drive from webui as it is handled from HA"
@@ -97,21 +116,12 @@ if ! grep -q "/stats/" "$HOME/BirdNET-Pi/homepage/views.php"; then
sed -i "s|/log|/log/|g" "$HOME/BirdNET-Pi/homepage/views.php" sed -i "s|/log|/log/|g" "$HOME/BirdNET-Pi/homepage/views.php"
fi fi
# Check if port 80 is correctly configured
if [ -n "$(bashio::addon.port "80")" ] && [ "$(bashio::addon.port "80")" != 80 ]; then
bashio::log.fatal "The port 80 is enabled, but should still be 80 if you want automatic SSL certificates generation to work."
fi
# Correct systemctl path # Correct systemctl path
echo "... updating systemctl path" echo "... updating systemctl path"
curl -f -L -s -S https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -o /bin/systemctl || mv /helpers/systemctl3.py /bin/systemctl curl -f -L -s -S https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -o /bin/systemctl || mv /helpers/systemctl3.py /bin/systemctl
chown pi:pi /bin/systemctl chown pi:pi /bin/systemctl
chmod a+x /bin/systemctl chmod a+x /bin/systemctl
# Improve streamlit cache
#echo "... add streamlit cache"
#sed -i "/def get_data/i \\@st\.cache_resource\(\)" "$HOME/BirdNET-Pi/scripts/plotly_streamlit.py"
# Allow reverse proxy for streamlit # Allow reverse proxy for streamlit
echo "... allow reverse proxy for streamlit" echo "... allow reverse proxy for streamlit"
sed -i "s|plotly_streamlit.py --browser.gatherUsageStats|plotly_streamlit.py --server.enableXsrfProtection=false --server.enableCORS=false --browser.gatherUsageStats|g" "$HOME/BirdNET-Pi/templates/birdnet_stats.service" sed -i "s|plotly_streamlit.py --browser.gatherUsageStats|plotly_streamlit.py --server.enableXsrfProtection=false --server.enableCORS=false --browser.gatherUsageStats|g" "$HOME/BirdNET-Pi/templates/birdnet_stats.service"