Revert "Build"

This reverts commit ffc3a1bfe3.
This commit is contained in:
GitHub Actions
2026-07-05 09:24:29 +00:00
parent 594d875477
commit abc7e454f0
27 changed files with 0 additions and 2293 deletions

View File

@@ -1,477 +0,0 @@
## source-20260703 (03-07-2026)
- Minor bugs fixed
## source-20260702-em (02-07-2026)
- Minor bugs fixed
## source-20260702-2 (02-07-2026)
- Minor bugs fixed
## source-20260701 (01-07-2026)
- Minor bugs fixed
## source-20260629-3 (29-06-2026)
- Minor bugs fixed
## source-20260629-2 (29-06-2026)
- Minor bugs fixed
## source-20260629 (29-06-2026)
- Minor bugs fixed
## source-20260627-v3 (28-06-2026)
- Minor bugs fixed
## source-20260627-v2 (27-06-2026)
- Minor bugs fixed
## source-20260627 (27-06-2026)
- Minor bugs fixed
## source-20260626-5 (26-06-2026)
- Minor bugs fixed
## source-20260626-4 (26-06-2026)
- Minor bugs fixed
## source-20260626-3 (26-06-2026)
- Minor bugs fixed
## source-20260626 (26-06-2026)
- Minor bugs fixed
## source-20260625-14 (26-06-2026)
- Minor bugs fixed
## source-20260625-13 (25-06-2026)
- Minor bugs fixed
## source-20260625-12 (25-06-2026)
- Minor bugs fixed
## source-20260625-11 (25-06-2026)
- Minor bugs fixed
## source-20260625-10 (25-06-2026)
- Minor bugs fixed
## source-20260625-5 (25-06-2026)
- Minor bugs fixed
## source-20260625-4 (25-06-2026)
- Minor bugs fixed
## source-20260625-3 (25-06-2026)
- Minor bugs fixed
## source-20260625-2 (25-06-2026)
- Minor bugs fixed
## source-20260625 (25-06-2026)
- Minor bugs fixed
## source-20260624-6 (24-06-2026)
- Minor bugs fixed
## source-20260624-5 (24-06-2026)
- Minor bugs fixed
## source-20260624-4 (24-06-2026)
- Minor bugs fixed
## source-20260624-3 (24-06-2026)
- Minor bugs fixed
## source-20260624-2 (24-06-2026)
- Minor bugs fixed
## source-20260623-3 (23-06-2026)
- Minor bugs fixed
## source-20260623-2 (23-06-2026)
- Minor bugs fixed
## source-20260623 (23-06-2026)
- Minor bugs fixed
## source-20260622 (23-06-2026)
- Minor bugs fixed
## source-20260621-5 (22-06-2026)
- Minor bugs fixed
## source-20260621-4 (22-06-2026)
- Minor bugs fixed
## source-20260621-3 (22-06-2026)
- Minor bugs fixed
## source-20260621-2 (22-06-2026)
- Minor bugs fixed
## source-20260621-1 (21-06-2026)
- Fix OpenVINO load failure: bundle oneTBB (libtbb.so.12) from OpenVINO 3rdparty libs so libopenvino_c.so resolves at runtime
## source-20260620-13 (21-06-2026)
- Minor bugs fixed
## source-20260620-12 (21-06-2026)
- Minor bugs fixed
## source-20260620-11 (21-06-2026)
- Minor bugs fixed
## source-20260620-10 (21-06-2026)
- Minor bugs fixed
## source-20260620-7 (21-06-2026)
- Minor bugs fixed
## source-20260620-6 (21-06-2026)
- Minor bugs fixed
## source-20260620-5 (21-06-2026)
- Minor bugs fixed
## source-20260620-4 (21-06-2026)
- Minor bugs fixed
## source-20260620-3 (21-06-2026)
- Minor bugs fixed
## source-20260620-2 (21-06-2026)
- Minor bugs fixed
## source-20260620 (21-06-2026)
- Minor bugs fixed
## source-20260619-8 (20-06-2026)
- Minor bugs fixed
## source-20260619-7 (20-06-2026)
- Minor bugs fixed
## source-20260619-6 (20-06-2026)
- Minor bugs fixed
## source-20260619-5 (20-06-2026)
- Minor bugs fixed
## source-20260619-4 (20-06-2026)
- Minor bugs fixed
## source-20260619-3 (20-06-2026)
- Minor bugs fixed
## source-20260619-2 (20-06-2026)
- Minor bugs fixed
## source-20260619 (20-06-2026)
- Minor bugs fixed
## source-20260618-3 (18-06-2026)
- Minor bugs fixed
## source-20260618-2 (18-06-2026)
- Minor bugs fixed
## source-20260617-4 (18-06-2026)
- Minor bugs fixed
## source-20260617-3 (17-06-2026)
- Minor bugs fixed
## source-20260617-2 (17-06-2026)
- Minor bugs fixed
## source-20260617 (17-06-2026)
- Minor bugs fixed
## source-20260616-2 (16-06-2026)
- Minor bugs fixed
## source-20260616 (16-06-2026)
- Minor bugs fixed
## source-20260615bats (15-06-2026)
- Minor bugs fixed
## source-20260615 (15-06-2026)
- Minor bugs fixed
## source-20260614-2 (14-06-2026)
- Minor bugs fixed
## source-20260614 (14-06-2026)
- Minor bugs fixed
## source-20260613 (13-06-2026)
- Minor bugs fixed
## source-20260612-4 (13-06-2026)
- Minor bugs fixed
## source-20260612-3 (12-06-2026)
- Minor bugs fixed
## source-20260612-2 (12-06-2026)
- Minor bugs fixed
## source-20260612 (12-06-2026)
- Minor bugs fixed
## source-20260610-9 (11-06-2026)
- Minor bugs fixed
## source-20260610-8 (11-06-2026)
- Minor bugs fixed
## source-20260610-7 (11-06-2026)
- Minor bugs fixed
## source-20260610-6 (11-06-2026)
- Minor bugs fixed
## source-20260610-5 (11-06-2026)
- Minor bugs fixed
## source-20260610-4 (10-06-2026)
- Minor bugs fixed
## source-20260610-3 (10-06-2026)
- Minor bugs fixed
## source-20260610-2 (10-06-2026)
- Minor bugs fixed
## source-20260610 (10-06-2026)
- Minor bugs fixed
## source-20260608-8 (09-06-2026)
- Minor bugs fixed
## source-20260608-7 (09-06-2026)
- Minor bugs fixed
## source-20260608-6 (08-06-2026)
- Minor bugs fixed
## source-20260608-5 (08-06-2026)
- Minor bugs fixed
## source-20260608-4 (08-06-2026)
- Minor bugs fixed
## source-20260608-3 (08-06-2026)
- Minor bugs fixed
## source-20260608-2 (08-06-2026)
- Minor bugs fixed
## source-20260608 (08-06-2026)
- Minor bugs fixed
## source-20260607-4 (07-06-2026)
- Minor bugs fixed
## source-20260607-3 (07-06-2026)
- Minor bugs fixed
## source-20260607-2 (07-06-2026)
- Minor bugs fixed
## source-20260607 (07-06-2026)
- **Test variant** of the birdnet-go add-on that compiles BirdNET-Go from the `alexbelgium/birdnet-go` fork instead of pulling the prebuilt `ghcr.io/tphakala/birdnet-go` image.
- At build time, `merge-prs.sh` syncs the fork's `main` with the `tphakala/birdnet-go` upstream and merges every open non-draft ("in review") pull request on the fly, so the resulting binary is upstream main + all work currently under review.
- Home Assistant integration layers (nginx ingress, modules, init scripts, options handling) are identical to the standard birdnet-go add-on.
- Published as a separate image (`ghcr.io/alexbelgium/birdnet-go-source-{arch}`) so it never overwrites the production add-on image.
- Fix (`01-structure.sh`): create the absolute `BIRDSONGS_FOLDER` target (e.g. the default `/config/clips`) before migrating clips from a legacy `/data/clips`, so upgrades with existing recordings no longer abort startup under `set -e`.
## nightly-20260601-2 (03-06-2026)
- Minor bugs fixed
## nightly-20260601 (2026-06-01)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260524 (2026-05-30)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260429-405 (2026-05-30)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260525-3 (28-05-2026)
- New `mqtt_auto_config` addon option (default `false`). When `true` and the Home Assistant MQTT addon is active, `realtime.mqtt.{enabled,broker,username,password}` are written directly to `config.yaml` on every restart. When `false` but Mosquitto is detected, the addon still logs the broker details and reminds you about the option — nothing is written.
- New `mariadb_auto_config` addon option (default `false`). When `true` and the Home Assistant MariaDB addon is active, `output.mysql.*` is filled in and `output.sqlite.enabled` is set to `false`. When `false` but MariaDB is detected, the addon logs the credentials and reminds you about the option.
- **Breaking**: `output.sqlite.path` and `logging.file_output.*` are now seeded only when missing from `config.yaml` (previously overwritten every restart). Values changed through the BirdNET-Go UI or by hand-editing `config.yaml` now survive container restarts. If you relied on `LOG_MAX_SIZE_MB` / `LOG_MAX_AGE_DAYS` addon options to override an existing setting in `config.yaml`, remove the existing key from `config.yaml` or edit it directly — the option will only be applied on first run.
- **Breaking (UI only)**: The nginx ingress reverse-proxy no longer rewrites HTML `href`/`src`/`action` attributes; upstream BirdNET-Go handles those itself via `X-Ingress-Path`. JavaScript string-literal rewrites are unchanged. Please file an issue if you see broken images, links, or forms in the ingress UI after upgrade.
- Fix database-migration restore: the timestamped backup created during a `BIRDSONGS_FOLDER` change was being written to the script's working directory and looked up under a fresh timestamp on restore, so a SQL failure left the user unable to recover. Backup path is now absolute and reused for restore.
- Harden the `BIRDSONGS_FOLDER` SQL/YAML path substitution: paths containing characters outside `[A-Za-z0-9._/-]` are now rejected up front instead of being interpolated raw into the SQL UPDATE statement.
- Tolerate a missing internet connection on first boot: if the default `config.yaml` cannot be downloaded from GitHub, the init script now seeds an empty YAML document so the addon-defaults block populates a usable config (rather than aborting the script on the next `yq` call under `set -e`).
- Warn (without failing the build) if the upstream `entrypoint.sh` patch target drifts in a new nightly.
- Remove a dead nginx upstream definition that pointed at an unused port.
## nightly-20260525-2 (26-05-2026)
- Suppress noisy startup logs: silence `chmod /dev/snd` errors on the read-only HA mount, and hide unavailable ALSA plugins (JACK, OSS, dsnoop) from device enumeration so libjack and pcm_oss/dsnoop probes no longer print at launch. ALSA overrides are written to `/root/.asoundrc` (since `/etc/asound.conf` is read-only in this environment).
- Allow advanced users to override the ALSA config by dropping a custom `asound.conf` into the addon config folder.
- Add LOG_MAX_SIZE_MB and LOG_MAX_AGE_DAYS addon options to manage log storage size
- Automatically trim log files exceeding configured age on startup
## nightly-20260525 (26-05-2026)
- Minor bugs fixed
## nightly-20260511-414-2 (22-05-2026)
- Minor bugs fixed
## nightly-20260511-414 (2026-05-16)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260429-405 (2026-05-02)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260321-397 (2026-03-26)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260315 (2026-03-21)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260311 (2026-03-14)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260118-2 (17-02-2026)
- Minor bugs fixed
## nightly-20260118 (2026-01-21)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260113 (2026-01-14)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260111 (2026-01-12)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20260110 (2026-01-10)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20251223-2 (2025-12-27)
- Minor bugs fixed
## nightly-20251224 (2025-12-24)
- Minor bugs fixed
## nightly-20251223 (2025-12-23)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20251214 (2025-12-20)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
- Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
- Preserve the microphone selected in the BirdNET-Go UI unless the `homeassistant_microphone` option explicitly forces the default device.
## "nightly-20251028" (2025-11-01)
- Minor bugs fixed
## nightly-20251028 (2025-11-01)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## "nightly-20251012" (2025-10-18)
- Minor bugs fixed
## nightly-20251012 (2025-10-18)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20251008 (2025-10-11)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20250904_6 (2025-09-17)
- New option "homeassistant_microphone". If set to true, will use homeassistant's microphone by setting the audio_card to "default". Please use the addon options to select the device to which "default" is allocated
## nightly-20250904 (2025-09-06)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20250826 (2025-08-30)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20250813 (2025-08-16)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20250805 (2025-08-09)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20250731-4 (2025-08-04)
- Minor bugs fixed
## nightly-20250731-3 (2025-08-04)
- Minor bugs fixed
## nightly-20250731-2 (2025-08-02)
- Minor bugs fixed
## nightly-20250731 (2025-08-01)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20250730 (2025-07-30)
- Minor bugs fixed
## nightly-20250725-2 (2025-07-28)
- Fix /asset path
- Added 9090 telemetry port
## nightly-20250725 (2025-07-25)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## nightly-20250710 (2025-07-12)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 20250710 (2025-07-12)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 20250704 (2025-07-07)
- Minor bugs fixed
## 20250508 (2025-07-05)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 20250419 (2025-05-17)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 20250427-7 (2025-05-15)
- Breaking change: COMMAND addon option removed. Please instead use the config.yaml to define the RTSP feeds
- Use entrypoint
## 20250427-2 (2025-04-27)
- Minor bugs fixed
## 20250427 (2025-04-27)
- Minor bugs fixed
## 20250316 (2025-04-26)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 0.6.4-3 (2025-04-07)
- Minor bugs fixed
## 0.6.4-2 (2025-03-30)
- Minor bugs fixed
## 0.6.4 (2025-03-17)
- Minor bugs fixed
## 0.6.3 (2025-03-15)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 0.6.2-2 (2025-02-21)
- Minor bugs fixed
## 0.6.2 (2025-02-21)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 20250126-2 (2025-02-21)
- Minor bugs fixed
## 20250126 (2025-02-15)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 0.6.0-nightly-20250124 (2025-01-25)
- Minor bugs fixed
## 0.6.0-4 (2025-01-21)
- Fix sounds play
- Correct sqlite for //
## 0.6.0 (2025-01-18)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 20250103-10 (2025-01-17)
- BREAKING CHANGE : improve implementation of addon options such as Birdsongs folder. Please check the log at first start if anything is different than you expected
- WARNING : your files will move to the new Birdsongs folder in case of change
- WARNING : your db will be modified in case of Birdsongs folder change to still allow access to files. A backup will always be created
- Fix ingress issues
## 20250103 (2025-01-11)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 25-4 (2024-12-29)
- Fixed https://github.com/alexbelgium/hassio-addons/issues/1687
## 25-3 (2024-12-28)
- avx2 support added by @tphakala
## 25-2 (2024-12-21)
- Minor bugs fixed
## 25 (2024-12-21)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 0.5.5-11 (2024-10-22)
- Minor bugs fixed
## 0.5.5-10 (2024-09-30)
- Minor bugs fixed
## 0.5.5-9 (2024-07-06)
- Correct indentation issue
## 0.5.5-8 (2024-07-03)
- New option : set the audio clip directory from addon options
## 0.5.5-2 (2024-06-25)
- Minor bugs fixed
## 0.5.5 (2024-06-22)
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
## 0.5.5 (2024-06-20)
- Minor bugs fixed
## 0.5.3-3 (2024-06-07)
- Minor bugs fixed
## 0.5.3-2 (2024-06-07)
- Minor bugs fixed
## 0.5.3 (2024-05-26)
- Minor bugs fixed
## 0.5.2 (2024-05-04)
- Minor bugs fixed
## 0.5.1-4 (2024-04-23)
- Feat : provide mariadb information in the startup log to allow its usage
## 0.5.1-3 (2024-04-23)
- Feat : Allow mounting of SMB and local drives to store the audio clips on an external drive
## 0.5.1 (2024-04-22)
- Initial build

View File

@@ -1,365 +0,0 @@
# syntax=docker/dockerfile:1
#============================#
# ALEXBELGIUM'S DOCKERFILE #
# BirdNET-Go (OpenVINO/AMD64)#
#============================#
# _.------.
# _.-` ('>.-`"""-.
# '.--'` _'` _ .--.)
# -' '-.-';` `
# ' - _.' ``'--.
# '---` .-'""``
# /`
#=== Home Assistant Addon ===#
#
# AMD64-only, OpenVINO-enabled build of the BirdNET-Go add-on.
# The binary is compiled from the alexbelgium/birdnet-go fork with the
# OpenVINO inference backend enabled (openvino build tag). The OpenVINO
# 2026.2 runtime libraries are bundled in the image, enabling:
# - Faster CPU inference on modern Intel CPUs (AVX-512/AMX)
# - Intel iGPU inference when /dev/dri is passed from the host
#
# Before compiling, "merge-prs.sh" clones the fork, fast-forwards its main
# onto the tphakala/birdnet-go upstream and merges every OPEN, NON-DRAFT
# pull request on the fly. Home Assistant integration layers (2-6) are then
# applied on top and are byte-for-byte identical to the upstream variant.
#
# Build stages 0-1 mirror tphakala/birdnet-go's Docker/Dockerfile; if
# upstream changes its build (Go/Node/onnxruntime versions, task names)
# sync them here.
##########################################################
# 0 Prepare merged BirdNET-Go source tree (fork + PRs) #
##########################################################
FROM alpine/git:latest AS birdnet-source
ARG BIRDNET_FORK=alexbelgium/birdnet-go
ARG BIRDNET_UPSTREAM=tphakala/birdnet-go
# BUILD_DATE changes on every CI run, busting this layer's cache so the fork is
# re-cloned and the open PRs are re-merged "on the fly" on every build.
ARG BUILD_DATE=unknown
RUN apk add --no-cache bash curl jq
COPY merge-prs.sh /usr/local/bin/merge-prs.sh
RUN chmod +x /usr/local/bin/merge-prs.sh && \
echo "Build date marker: ${BUILD_DATE}" && \
BIRDNET_FORK="${BIRDNET_FORK}" BIRDNET_UPSTREAM="${BIRDNET_UPSTREAM}" \
/usr/local/bin/merge-prs.sh /birdnet-src
##########################################################
# 0b Download OpenVINO runtime libraries for amd64 #
##########################################################
FROM alpine:3 AS openvino-libs
ARG OPENVINO_BUILD=2026.2.0.21903.52ddc073857
ARG OPENVINO_RELEASE=2026.2
# Download the x86_64 OpenVINO runtime package and extract runtime/lib/intel64.
# The same build id is used for the C API headers downloaded during compilation
# (see Taskfile.yml OPENVINO_BUILD), ensuring header/runtime version parity.
# We use the arm64 package for headers (arch-independent C declarations) but the
# x86_64 package here for the actual runtime .so files.
#
# OpenVINO links against its own bundled oneTBB (libtbb.so.12, libtbbmalloc*),
# which does NOT live in runtime/lib/intel64 but in runtime/3rdparty/tbb/lib.
# It must be bundled too, otherwise dlopen("libopenvino_c.so") fails at runtime
# with "libtbb.so.12: cannot open shared object file: No such file or directory"
# and the OpenVINO backend silently falls back / GPU planning treats the device
# as unavailable.
RUN apk add --no-cache curl && \
mkdir -p /openvino && \
curl -fsSL \
"https://storage.openvinotoolkit.org/repositories/openvino/packages/${OPENVINO_RELEASE}/linux/openvino_toolkit_ubuntu22_${OPENVINO_BUILD}_x86_64.tgz" \
-o /tmp/openvino.tgz && \
tar -xzf /tmp/openvino.tgz -C /tmp/ --strip-components=1 && \
cd /tmp/runtime/lib/intel64 && \
tar -cf - . | tar -xf - -C /openvino/ && \
# Bundle OpenVINO's own oneTBB runtime (preserving symlinks with cp -a).
# Search the whole 3rdparty tree so the copy survives minor layout changes
# between OpenVINO releases. Fail the build loudly if libtbb is missing,
# since the runtime is unusable without it.
find /tmp/runtime/3rdparty -name 'libtbb*.so*' -exec cp -a {} /openvino/ \; && \
if ! ls /openvino/libtbb.so.12* >/dev/null 2>&1; then \
echo "ERROR: libtbb.so.12 not found in OpenVINO package 3rdparty/tbb" >&2; \
exit 1; \
fi && \
rm -rf /tmp/openvino.tgz /tmp/runtime /tmp/tools /tmp/python \
/tmp/samples /tmp/install_dependencies 2>/dev/null || true
#########################################################################
# 1a Build environment (mirrors tphakala/birdnet-go Docker/Dockerfile) #
#########################################################################
FROM --platform=$BUILDPLATFORM golang:1.26-trixie AS buildenv
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION:-unknown}
# Install Task and other dependencies
RUN apt-get update -q && apt-get install -q -y \
curl \
git \
sudo \
zip \
gcc-aarch64-linux-gnu && \
rm -rf /var/lib/apt/lists/*
# Install Node.js v24 from NodeSource
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Install Task
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
# Create dev-user for building
RUN groupadd --gid 10001 dev-user && \
useradd --uid 10001 --gid dev-user --shell /bin/bash --create-home dev-user && \
usermod -aG sudo dev-user && \
usermod -aG audio dev-user && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
mkdir -p /home/dev-user/src && \
mkdir -p /home/dev-user/lib && \
mkdir -p /home/dev-user/.cache && \
mkdir -p /home/dev-user/.npm && \
chown -R dev-user:dev-user /home/dev-user
USER dev-user
WORKDIR /home/dev-user/src/BirdNET-Go
# Bring in the merged source tree (fork main + upstream sync + open PRs)
COPY --from=birdnet-source --chown=dev-user /birdnet-src ./
# Pre-build frontend once in the shared buildenv stage
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN task frontend-build
##################
# 1b Build stage #
##################
FROM --platform=$BUILDPLATFORM buildenv AS build
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION:-unknown}
ARG ONNXRUNTIME_VERSION=1.25.1
# Download ONNX Runtime for amd64 (x64)
RUN echo "Downloading ONNX Runtime ${ONNXRUNTIME_VERSION} for x64" && \
curl -fsSL "https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz" \
-o /tmp/onnxruntime.tgz && \
mkdir -p /tmp/onnxruntime && \
tar -xzf /tmp/onnxruntime.tgz -C /tmp/onnxruntime --strip-components=1 && \
cp /tmp/onnxruntime/lib/libonnxruntime*.so* /home/dev-user/lib/ && \
rm -rf /tmp/onnxruntime /tmp/onnxruntime.tgz
# Build BirdNET-Go for amd64 with OpenVINO enabled.
# OPENVINO=true compiles in the openvino build tag, enabling the OpenVINO
# inference backend (dlopen'd at runtime; falls back to ONNX Runtime when
# libopenvino_c.so is absent). The noembed_linux_amd64 task defaults to
# OPENVINO=true anyway; we make it explicit here for clarity.
RUN --mount=type=cache,target=/go/pkg/mod,uid=10001,gid=10001 \
--mount=type=cache,target=/home/dev-user/.cache/go-build,uid=10001,gid=10001 \
task check-tensorflow && \
echo "Building amd64 with OpenVINO enabled, BUILD_VERSION=${BUILD_VERSION}" && \
BUILD_VERSION="${BUILD_VERSION}" DOCKER_LIB_DIR=/home/dev-user/lib task noembed_linux_amd64 OPENVINO=true
#####################################################
# 1c BirdNET-Go runtime base (mirrors upstream) #
#####################################################
FROM debian:trixie-slim AS birdnet-runtime
# Copy TFLite model files (amd64 uses TFLite; OpenVINO reads them via its
# TFLite frontend plugin bundled in the OpenVINO runtime below)
RUN mkdir -p /models
COPY --from=build /home/dev-user/src/BirdNET-Go/internal/classifier/data/*.tflite /models/
RUN chmod -R a+r /models/*.tflite 2>/dev/null || true && \
chmod a+x /models
# Install ALSA library, SOX for audio processing, and system utilities.
# ocl-icd-libopencl1 provides the OpenCL ICD loader; combined with
# /dev/dri passthrough from the host it enables Intel iGPU inference.
RUN apt-get update -q && apt-get install -q -y --no-install-recommends \
adduser \
ca-certificates \
libasound2 \
ffmpeg \
sox \
libsox-fmt-mp3 \
procps \
iproute2 \
net-tools \
curl \
wget \
nano \
vim \
less \
tzdata \
tzdata-legacy \
jq \
strace \
lsof \
bash-completion \
gosu \
ocl-icd-libopencl1 \
&& rm -rf /var/lib/apt/lists/*
# Copy TensorFlow Lite library from build stage
COPY --from=build /home/dev-user/lib/libtensorflowlite_c.so* /usr/lib/
# Copy ONNX Runtime libraries from build stage
COPY --from=build /home/dev-user/lib/libonnxruntime*.so* /usr/lib/
# Copy OpenVINO runtime libraries (libopenvino_c.so, CPU/GPU plugins,
# TFLite frontend, plugins.xml, bundled oneTBB libtbb.so.12, etc.) into a
# dedicated directory and register it with ldconfig so both
# dlopen("libopenvino_c.so") and its libtbb.so.12 dependency resolve.
# plugins.xml is co-located with libopenvino.so so device plugin
# discovery works without additional environment variables.
COPY --from=openvino-libs /openvino/ /usr/lib/openvino/
RUN echo "/usr/lib/openvino" > /etc/ld.so.conf.d/openvino.conf && ldconfig
# Include reset_auth tool from build stage
COPY --from=build /home/dev-user/src/BirdNET-Go/reset_auth.sh /usr/bin/
RUN chmod +x /usr/bin/reset_auth.sh
# Add entrypoint and startup wrapper scripts from build stage
COPY --from=build /home/dev-user/src/BirdNET-Go/Docker/entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
COPY --from=build /home/dev-user/src/BirdNET-Go/Docker/startup-wrapper.sh /usr/bin/
RUN chmod +x /usr/bin/startup-wrapper.sh
# Create config and data directories with proper permissions for rootless compatibility
RUN mkdir -p /config /data/clips /data/models && \
chmod 777 /config /data /data/clips /data/models
# Install the freshly built BirdNET-Go binary
COPY --from=build /home/dev-user/src/BirdNET-Go/bin /usr/bin/
# Enable openvino
ARG NEO_VERSION=26.22.38646.4
ARG IGC_VERSION=2.36.3+21719
RUN groupadd -g 109 render || true && \
usermod -aG render root && \
\
apt-get update -q && apt-get install -q -y --no-install-recommends wget ocl-icd-libopencl1 libdrm2 libdrm-intel1 && \
mkdir -p /tmp/neo && cd /tmp/neo && \
wget -q https://github.com/intel/intel-graphics-compiler/releases/download/v2.36.3/intel-igc-core-2_${IGC_VERSION}_amd64.deb \
https://github.com/intel/intel-graphics-compiler/releases/download/v2.36.3/intel-igc-opencl-2_${IGC_VERSION}_amd64.deb \
https://github.com/intel/compute-runtime/releases/download/${NEO_VERSION}/intel-opencl-icd_${NEO_VERSION}-0_amd64.deb \
https://github.com/intel/compute-runtime/releases/download/${NEO_VERSION}/libigdgmm12_22.10.0_amd64.deb \
https://github.com/intel/compute-runtime/releases/download/${NEO_VERSION}/libze-intel-gpu1_${NEO_VERSION}-0_amd64.deb && \
dpkg -i *.deb && \
rm -rf /tmp/neo && \
rm -rf /var/lib/apt/lists/*
#============================================================================#
# From here on, the Home Assistant integration layers are identical to the #
# standard alexbelgium/birdnet-go add-on (which builds FROM the prebuilt #
# upstream image). The only difference above is that the base is compiled #
# from the fork + open PRs with OpenVINO enabled. #
#============================================================================#
##################
# 2 Modify Image #
##################
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Set S6 wait time
ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \;
# Silence "chmod: Read-only file system" noise from upstream entrypoint:
# Home Assistant mounts /dev/snd read-only, so the chmod is a no-op and the
# stderr output is just noise. The "|| true" already absorbs the exit code.
# Warn (without failing the build) if the upstream pattern drifts so we notice
# in CI logs and can update the patch.
RUN if [ -f /usr/bin/entrypoint.sh ]; then \
if grep -q 'chmod -R a+rw /dev/snd || true' /usr/bin/entrypoint.sh; then \
sed -i 's#chmod -R a+rw /dev/snd || true#chmod -R a+rw /dev/snd 2>/dev/null || true#' /usr/bin/entrypoint.sh; \
else \
echo "WARN: upstream entrypoint.sh /dev/snd chmod pattern not found; nightly drift?" >&2; \
fi; \
fi
# Uses /bin for compatibility purposes
# hadolint ignore=DL4005
RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \
if [ ! -f /bin/bash ] && [ -f /usr/bin/bash ]; then ln -s /usr/bin/bash /bin/bash; fi
# Modules
ARG MODULES="00-local_mounts.sh 00-smb_mounts.sh"
# Automatic modules download
COPY ha_automodules.sh /ha_automodules.sh
RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh
# Manual apps
ENV PACKAGES="alsa-utils libasound2-plugins mariadb-client nginx yq"
# Automatic apps & bashio
COPY ha_autoapps.sh /ha_autoapps.sh
RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh
################
# 4 Entrypoint #
################
# Add entrypoint
ENV S6_STAGE2_HOOK=/ha_entrypoint.sh
COPY ha_entrypoint.sh /ha_entrypoint.sh
RUN chmod 777 /ha_entrypoint.sh
# Install bashio
COPY bashio-standalone.sh /usr/local/lib/bashio-standalone.sh
RUN chmod 0755 /usr/local/lib/bashio-standalone.sh
# Avoid config.yaml interference
RUN sed -i "s|config.yaml|config_env.yaml|g" /etc/cont-init.d/01-config_yaml.sh
ENTRYPOINT [ "/usr/bin/env" ]
CMD [ "/ha_entrypoint.sh" ]
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############
# 5 Labels #
############
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
ENV BUILD_VERSION="${BUILD_VERSION}"
LABEL \
io.hass.name="${BUILD_NAME}" \
io.hass.description="${BUILD_DESCRIPTION}" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.title="${BUILD_NAME}" \
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
org.opencontainers.image.vendor="Home Assistant Add-ons" \
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://github.com/alexbelgium" \
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}
#################
# 6 Healthcheck #
#################

View File

@@ -1,258 +0,0 @@
# BirdNET-Go Addon: Home Assistant Integration
BirdNET-Go can be integrated with Home Assistant using a MQTT Broker.
> **💡 Easiest path — automatic discovery.** If you run the Home Assistant
> Mosquitto (MQTT) addon, just set `mqtt_auto_config: true` in this add-on's
> options. The add-on then wires in the broker credentials **and** enables
> BirdNET-Go's native Home Assistant MQTT auto-discovery, so the detection
> sensors appear in Home Assistant automatically with **no manual YAML at
> all**. The manual sensor/template/card configuration below is only needed if
> you want to build your own custom entities instead of (or in addition to) the
> auto-discovered ones.
## MQTT Configuration
Your Home Assistant must be setup with MQTT and BirdNET-Go MQTT integration must be enabled. Modify the BirdNET-Go config.yaml file to enable MQTT. If you are using the Mosquitto Broker addon, you will see a log message during the BirdNET-Go startup showing the internal MQTT server details needed for configuration similar to below.
```text
BirdNET-Go log snipped showing MQTT details:
/etc/cont-init.d/33-mqtt.sh: executing
---
MQTT addon is active on your system! Add the MQTT details below to the Birdnet-go config.yaml :
MQTT user : addons
MQTT password : Ri5ahV1aipeiw0aelerooteixai5ohtoeNg6oo3mo0thi5te0phiezuge4Phoore
MQTT broker : tcp://core-mosquitto:1883
---
Edit this section of config.yaml found in addon_configs/db21ed7f_birdnet-go/:
mqtt:
enabled: true # true to enable MQTT
broker: tcp://core-mosquitto:1883 # MQTT (tcp://host:port)
topic: birdnet # MQTT topic
username: addons # MQTT username
password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # MQTT password
```
## BirdNET-Go MQTT Sensors
Add the [MQTT sensor](https://www.home-assistant.io/integrations/sensor.mqtt/) yaml configuration below to your Home Assistant configuration.yaml file. Reload the configuration and once BirdNET-Go publishes a new finding to MQTT the new BirdNET-Go sensors should show that latest finding data.
```yaml
mqtt:
sensor:
- name: "Birdnet-Go"
state_topic: "birdnet"
value_template: "{{ today_at(value_json.Time) }}"
json_attributes_topic: "birdnet"
json_attributes_template: "{{ value_json | tojson }}"
- name: "Birdnet-Go Bird Image Url"
state_topic: "birdnet"
value_template: "{{ value_json.BirdImage.URL }}"
- name: "Birdnet-Go Clip Name"
state_topic: "birdnet"
value_template: "{{ value_json.ClipName }}"
- name: "Birdnet-Go Common Name"
state_topic: "birdnet"
value_template: "{{ value_json.CommonName }}"
- name: "Birdnet-Go Confidence"
state_topic: "birdnet"
value_template: "{{ (value_json.Confidence | float * 100) | round(2) }}"
unit_of_measurement: "%"
- name: "Birdnet-Go Date"
state_topic: "birdnet"
value_template: "{{ value_json.Date }}"
- name: "Birdnet-Go ProcessingTime"
state_topic: "birdnet"
value_template: "{{ (value_json.ProcessingTime | float / 1000000000 ) | round(4) }}"
unit_of_measurement: "s"
- name: "Birdnet-Go Scientific Name"
state_topic: "birdnet"
value_template: "{{ value_json.ScientificName }}"
- name: "Birdnet-Go Sensitivity"
state_topic: "birdnet"
value_template: "{{ value_json.Sensitivity }}"
- name: "Birdnet-Go Source"
state_topic: "birdnet"
value_template: "{{ value_json.Source }}"
- name: "Birdnet-Go Species Code"
state_topic: "birdnet"
value_template: "{{ value_json.SpeciesCode }}"
- name: "Birdnet-Go Threshold"
state_topic: "birdnet"
value_template: "{{ value_json.Threshold }}"
- name: "Birdnet-Go Time"
state_topic: "birdnet"
value_template: "{{ today_at(value_json.Time) }}"
```
![BirdNET-go MQTT](./images/ha_birdnet_mqtt_sensor.png)
## BirdNET-Go Events Sensor[^1]
Then create a new template sensor using the configuration below.
```yaml
- trigger:
- platform: mqtt
topic: "birdnet"
id: birdnet
- platform: time
at: "00:00:00"
id: reset
sensor:
- unique_id: c893533c-3c06-4ebe-a5bb-da833da0a947
name: BirdNET-Go Events
state: >
{% if trigger.id == 'reset' %}
{{ now() }}
{% elif trigger.id == 'birdnet' %}
{{ today_at(trigger.payload_json.Time) }}
{% endif %}
attributes:
bird_events: >
{% if trigger.id == 'reset' %}
{{ [] }}
{% elif trigger.id == 'birdnet' %}
{% set time = trigger.payload_json.Time %}
{% set name = trigger.payload_json.CommonName %}
{% set confidence = trigger.payload_json.Confidence|round(2) * 100 ~ '%' %}
{% set current = this.attributes.get('bird_events', []) %}
{% set new = dict(time=time, name=name, confidence=confidence) %}
{{ current + [new] }}
{% endif %}
```
### BirdNET-Go Dashboard Cards
There are two versions listed below. The first example will link the Bird Name to Wikipedia. The other example will link to All About Birds. You will need to modify the Confidence link to match your Home Assistant setup.
![BirdNET-go Markdown Card Wikipedia](./images/ha_birdnet_markdown_card_wikipedia.png)
```yaml
type: markdown
title: BirdNET (Wikipedia)
content: >-
Time|  Bird Name|Number Today|    Max
[Confidence](http://ip_address_of_HA:8080/)
:---|:---|:---:|:---:
{%- set t = now() %}
{%- set bird_list = state_attr('sensor.birdnet_go_events','bird_events') |
sort(attribute='time', reverse=true) | map(attribute='name') | unique | list
%}
{%- set bird_objects = state_attr('sensor.birdnet_go_events','bird_events') |
sort(attribute='time', reverse=true) %}
{%- for thisbird in bird_list or [] %}
{%- set ubird = ((bird_objects | selectattr("name", "equalto", thisbird)) |
list)[0] %}
{%- set ubird_count = ((bird_objects | selectattr("name", "equalto",
thisbird)) | list) | length %}
{%- set ubird_max_confidence = ((bird_objects | selectattr("name", "equalto",
thisbird)) | map(attribute='confidence') | map('replace', '%', '') |
map('float') | max | round(0)) %}
{%- if ubird_max_confidence > 70 %}
{{ubird.time}}
|  [{{ubird.name}}](https://en.wikipedia.org/wiki/{{ubird.name |
replace(' ', '_')}}) | {{ubird_count}} | {{ ubird_max_confidence }} %
{%- endif %}
{%- endfor %}
card_mod:
style:
$: |
.card-header {
display: flex !important;
align-items: center;
}
.card-header:before {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='m23 11.5l-3.05-1.13c-.26-1.15-.91-1.81-.91-1.81a4.19 4.19 0 0 0-5.93 0l-1.48 1.48L5 3c-1 4 0 8 2.45 11.22L2 19.5s8.89 2 14.07-2.05c2.76-2.16 3.38-3.42 3.77-4.75zm-5.29.22c-.39.39-1.03.39-1.42 0a.996.996 0 0 1 0-1.41c.39-.39 1.03-.39 1.42 0s.39 1.02 0 1.41'/%3E%3C/svg%3E");
height: 42px;
width: 42px;
margin-top: 0px;
padding-left: 0px;
padding-right: 14px;
}
@media (prefers-color-scheme: dark) {
.card-header:before {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E1E1E1' d='m23 11.5l-3.05-1.13c-.26-1.15-.91-1.81-.91-1.81a4.19 4.19 0 0 0-5.93 0l-1.48 1.48L5 3c-1 4 0 8 2.45 11.22L2 19.5s8.89 2 14.07-2.05c2.76-2.16 3.38-3.42 3.77-4.75zm-5.29.22c-.39.39-1.03.39-1.42 0a.996.996 0 0 1 0-1.41c.39-.39 1.03-.39 1.42 0s.39 1.02 0 1.41'/%3E%3C/svg%3E");
height: 42px;
width: 42px;
margin-top: 0px;
padding-left: 0px;
padding-right: 14px;
}
}
```
![BirdNET-go Markdown Card All About Birds](./images/ha_birdnet_markdown_card_all_about_birds.png)
```yaml
type: markdown
title: BirdNET (All About Birds)
content: >-
Time|  Bird Name|Number Today|    Max
[Confidence](http://ip_address_of_HA:8080/)
:---|:---|:---:|:---:
{%- set t = now() %}
{%- set bird_list = state_attr('sensor.birdnet_go_events','bird_events') |
sort(attribute='time', reverse=true) | map(attribute='name') | unique | list
%}
{%- set bird_objects = state_attr('sensor.birdnet_go_events','bird_events') |
sort(attribute='time', reverse=true) %}
{%- for thisbird in bird_list or [] %}
{%- set ubird = ((bird_objects | selectattr("name", "equalto", thisbird)) |
list)[0] %}
{%- set ubird_count = ((bird_objects | selectattr("name", "equalto",
thisbird)) | list) | length %}
{%- set ubird_max_confidence = ((bird_objects | selectattr("name", "equalto",
thisbird)) | map(attribute='confidence') | map('replace', '%', '') |
map('float') | max | round(0)) %}
{%- if ubird_max_confidence > 70 %}
{{ubird.time}}
|  [{{ubird.name}}](https://www.allaboutbirds.org/guide/{{ubird.name
| replace(' ', '_')}}) | {{ubird_count}} | {{ ubird_max_confidence }} %
{%- endif %}
{%- endfor %}
card_mod:
style:
$: |
.card-header {
display: flex !important;
align-items: center;
}
.card-header:before {
content: url("data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDYuODcgMTE2LjY2Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2Y0ZTUwNTt9LmNscy0ye2ZpbGw6I2UzMWUyNjt9LmNscy0ze2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTIwNi4zNywxNi42OHMtMTYuNDQtNC4zNC0yMi43Ni00LjljMCwwLTI1LDEzLjUtMzIsMThhMTkuMTYsMTkuMTYsMCwwLDAtOC42NywxMy44OWwzNS43MS0yNi4zMmgyOEMyMDcuMzEsMTcuMzksMjA2LjM3LDE2LjY4LDIwNi4zNywxNi42OFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMC42MykiLz48cGF0aCBkPSJNMTQ4LjU1LDI3LjMzYzcuMzItNC45LDMyLjYyLTE4LjczLDMyLjYyLTE4LjczbDAsMEEzMC42OSwzMC42OSwwLDAsMCwxNTktLjYzYTQ0LjIzLDQ0LjIzLDAsMCwwLTIwLjcxLDVIMGMwLDMuNzEsNS42LDYuNTYsMTIuMTQsNi41Nkg1Mi4zNkw4Ni42MiwzNS4xMlY3MS4zN2MwLDE1LjczLDguMjYsMjkuNDQsMjEuNzgsMzcuMzVTMTI4LjY4LDExNiwxMzguNjMsMTE2VjQ2Ljg3QzEzOC42Myw0MC43OCwxNDAuNDcsMzIuNzMsMTQ4LjU1LDI3LjMzWk0xNjcuODcsOGEyLjUxLDIuNTEsMCwxLDEtMi41MSwyLjUxQTIuNTEsMi41MSwwLDAsMSwxNjcuODcsOFptLTI5LjEzLDEzLDE1LjY5LTguNjgsNi44OS41N0wxMzguNzQsMjUuMzZaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDAuNjMpIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNTIuMzYsMTAuOTFIMTEwYy0xMi44OSwwLTIzLjQsMTAuMzUtMjMuNCwyNC4yMVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMC42MykiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0xNzgsMTAuMzNBMzEuNzEsMzEuNzEsMCwwLDAsMTU3Ljc4LDIuOVYtLjYxbDEuMjUsMEEzMC42MywzMC42MywwLDAsMSwxODEuMTcsOC42WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAwLjYzKSIvPjxwYXRoIGNsYXNzPSJjbHMtMiIgZD0iTTE3OC42MywxNy4zOWwtMjUsMTguNDNzLS4yOS0yLjcsMy40Ny01Ljc0LDI2LjUtMTguMywyNi41LTE4LjNaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDAuNjMpIi8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNMTI4LjE0LDY0LjQ3VjUyLjE1YzAtNS4xOC0yLjExLTguNzctNi45My0xMi4xOEwxMDAuNzksMjUuNTRhMTQuMzIsMTQuMzIsMCwwLDAsMiwyMVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMC42MykiLz48cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0xMjguMTQsNjQuNDdWNTIuMTVjMC01LjE4LTIuMTEtOC43Ny02LjkzLTEyLjE4TDEwMC43OSwyNS41NGExNC4zMiwxNC4zMiwwLDAsMCwyLDIxWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAwLjYzKSIvPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTE1MS41OSwyOS44MmM3LTQuNTQsMzItMTgsMzItMThhMTYuMjQsMTYuMjQsMCwwLDAtMi40MS0zLjE1bDAsMHMtMjUuMywxMy44My0zMi42MiwxOC43My05LjU3LDEyLjE3LTkuODcsMThsLS4wNSwxLjUxLDQuMjktMy4xNkExOS4xNiwxOS4xNiwwLDAsMSwxNTEuNTksMjkuODJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDAuNjMpIi8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNMTY3Ljg3LDhhMi41MSwyLjUxLDAsMSwxLTIuNTEsMi41MUEyLjUxLDIuNTEsMCwwLDEsMTY3Ljg3LDhaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDAuNjMpIi8+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjEzOC43NCAyMS41NyAxNTQuNDMgMTIuODkgMTYxLjMyIDEzLjQ1IDEzOC43NCAyNS45OCAxMzguNzQgMjEuNTciLz48L3N2Zz4=");
height: 20px;
width: 60px;
margin-top: -10px;
padding-left: 8px;
padding-right: 18px;
}
```
## Footnotes
[^1]: [Displaying Birdnet-go detections](https://community.home-assistant.io/t/displaying-birdnet-go-detections/713611/22)

View File

@@ -1,177 +0,0 @@
# Home assistant add-on: Birdnet-Go (from source)
> **⚠️ Test build.** This is a special variant of the [standard birdnet-go add-on](https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-go). Instead of pulling the prebuilt `ghcr.io/tphakala/birdnet-go` image, it **compiles BirdNET-Go from the [`alexbelgium/birdnet-go`](https://github.com/alexbelgium/birdnet-go) fork**. At build time it syncs the fork's `main` with the `tphakala/birdnet-go` upstream and **merges every open non-draft ("in review") pull request on the fly** (see [`merge-prs.sh`](./merge-prs.sh)), so the binary reflects upstream main plus all work currently under review. Everything below is identical to the standard add-on.
I maintain this and other Home Assistant add-ons in my free time: keeping up with upstream changes, HA changes, and testing on real hardware takes a lot of time (and some money). I use around 5-10 of my >110 addons so regularly I install test machines (and purchase some test services such as vpn) that I don't use myself to troubleshoot and improve the addons
If this add-on saves you time or makes your setup easier, I would be very grateful for your support!
[![Buy me a coffee][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
[![Donate via PayPal][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA)
## Addon informations
![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-go%2Fconfig.yaml)
![Ingress](https://img.shields.io/badge/dynamic/yaml?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-go%2Fconfig.yaml)
![Arch](https://img.shields.io/badge/dynamic/yaml?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fbirdnet-go%2Fconfig.yaml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c6cf10bdbba45ecb202d7f579b5be0e)](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
[![GitHub Super-Linter](https://img.shields.io/github/actions/workflow/status/alexbelgium/hassio-addons/weekly-supelinter.yaml?label=Lint%20code%20base)](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly-supelinter.yaml)
[![Builder](https://img.shields.io/github/actions/workflow/status/alexbelgium/hassio-addons/onpush_builder.yaml?label=Builder)](https://github.com/alexbelgium/hassio-addons/actions/workflows/onpush_builder.yaml)
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
[paypal-badge]: https://img.shields.io/badge/Donate%20via%20PayPal-0070BA?logo=paypal&style=flat&logoColor=white
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
[![Stargazers repo roster for @alexbelgium/hassio-addons](https://reporoster.com/stars/alexbelgium/hassio-addons)](https://github.com/alexbelgium/hassio-addons/stargazers)
![downloads evolution](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/birdnet-go/stats.png)
## About
[BirdNET-Go](https://github.com/tphakala/birdnet-go/tree/main) is an AI solution for continuous avian monitoring and identification developed by @tphakala
This addon is based on their docker image.
## Configuration
Install, then start the addon a first time. Webui can be found at <http://homeassistant:8080>.
You'll need a microphone : either use one connected to HA or the audio stream of a rstp camera.
The audio clips folder can be stored on an external or SMB drive by mounting it from the addon options, then specifying the path instead of "clips/". For example, "/mnt/NAS/Birdnet/"
Options can be configured through three ways :
- Addon options
```yaml
BIRDSONGS_FOLDER: /config/clips # where audio clips are stored (can be on a mounted drive)
LOG_MAX_SIZE_MB: 50 # max log file size before rotation
LOG_MAX_AGE_DAYS: 7 # max log retention in days
homeassistant_microphone: false # when true, force audio source to "default" (HA microphone)
env_vars: [] # extra environment variables to pass to the container
TZ: Etc/UTC # timezone, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
mqtt_auto_config: false # set true to auto-wire the Home Assistant MQTT addon into config.yaml
mariadb_auto_config: false # set true to auto-wire the Home Assistant MariaDB addon into config.yaml (also disables SQLite)
```
- Config.yaml
Additional variables can be configured using the config.yaml file found in /config/db21ed7f_birdnet-go/config.yaml using the Filebrowser addon
- Config_env.yaml
Additional environment variables can be configured there
### MQTT and MariaDB auto-configuration (opt-in)
If the Home Assistant **MQTT** addon is installed and running and you set `mqtt_auto_config: true` in the addon options, the addon writes the HA Mosquitto credentials directly into BirdNET-Go's `config.yaml` on every startup: `realtime.mqtt.enabled`, `broker`, `username`, and `password` are populated, and the topic defaults to `birdnet`. In addition, it enables BirdNET-Go's **native Home Assistant MQTT auto-discovery** (`realtime.mqtt.homeassistant.enabled`), so the detection sensors show up in Home Assistant automatically — **no manual MQTT sensor YAML required** (the hand-written sensors in [HAINTEGRATION.md](./HAINTEGRATION.md) remain available if you prefer to build your own). Messages are also retained (`realtime.mqtt.retain: true`) so sensor states survive Home Assistant restarts. When the option is `false` (the default), the addon still logs the broker details and reminds you about the option whenever Mosquitto is detected — nothing is written.
If the Home Assistant **MariaDB** addon is installed and running and you set `mariadb_auto_config: true`, the addon writes the HA credentials into `output.mysql.*` and sets `output.sqlite.enabled` to `false` (database name `birdnet`, created on first connect). When the option is `false` (the default), the addon only logs the credentials so you can configure them manually.
The addon also seeds `output.sqlite.path` and `logging.file_output.*` defaults only when those keys are missing from `config.yaml`, so values you change through the BirdNET-Go UI now survive container restarts.
### Mounting Drives
This addon supports mounting both local drives and remote SMB shares:
- **Local drives**: See [Mounting Local Drives in Addons](https://github.com/alexbelgium/hassio-addons/wiki/Mounting-Local-Drives-in-Addons)
- **Remote shares**: See [Mounting Remote Shares in Addons](https://github.com/alexbelgium/hassio-addons/wiki/Mounting-remote-shares-in-Addons)
### Custom Scripts and Environment Variables
This addon supports custom scripts and environment variables through the `addon_config` mapping:
- **Custom scripts**: See [Running Custom Scripts in Addons](https://github.com/alexbelgium/hassio-addons/wiki/Running-custom-scripts-in-Addons)
- **env_vars option**: Use the add-on `env_vars` option to pass extra environment variables (uppercase or lowercase names). See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
## Installation
The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on.
1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA)
[![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons)
1. Install this add-on.
1. Click the `Save` button to store your configuration.
1. Set the add-on options to your preferences
1. Start the add-on.
1. Check the logs of the add-on to see if everything went well.
1. Open the webUI and adapt the software options
## Integration with HA
Home Assistant Integration instructions are found here, [Birdnet-Go Addon: Home Assistant Integration](./HAINTEGRATION.md)
## Setting up a RTSP Source using VLC
VLC opens a TCP port but the stream is udp. Because of this will need to configure Birdnet-Go to use udp. Adjust the config.yaml file to udp or use the birdnet-go command line option:
`--rtsptransport udp --rtsp rtsp://192.168.1.21:8080/stream.sdp`
### Linux instructions
Run vlc without an interface using one of these commands:
```bash
# This should work for most devices
/usr/bin/vlc -I dummy -vvv alsa://hw:0,0 --no-sout-all --sout-keep --sout '#transcode{acodec=mpga}:rtp{sdp=rtsp://:8080/stream.sdp}'
# Try this if the first command does not work
/usr/bin/vlc -I dummy -vvv alsa://hw:4,0 --no-sout-all --sout-keep --sout '#rtp{sdp=rtsp://:8080/stream.sdp}'
```
Run `arecord -l` to get microphone hardware info
```text
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC3220 Analog [ALC3220 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: S7 [SteelSeries Arctis 7], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: Nano [Yeti Nano], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 4: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
```
hw:4,0 = **card 4**: Device [USB PnP Sound Device], **device 0**: USB Audio [USB Audio]
Systemd service file example. Adjust the user:group accordingly. If you want to run as root, you will likely need to run vlc-wrapper instead of vlc.
```text
[Unit]
Description=VLC Birdnet RTSP Server
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
StandardOutput=journal
ExecStart=/usr/bin/vlc -I dummy -vvv alsa://hw:0,0 --sout '#transcode{acodec=mpga}:rtp{sdp=rtsp://:8080/stream.sdp}'
User=someone
Group=somegroup
[Install]
WantedBy=multi-user.target
```
## Common issues
Not yet available
## Support
Create an issue on github
---
![illustration](https://raw.githubusercontent.com/tphakala/birdnet-go/main/doc/BirdNET-Go-dashboard.webp)

View File

@@ -1,67 +0,0 @@
#include <tunables/global>
profile db21ed7f_birdnet-go flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
capability chown,
capability dac_override,
capability dac_read_search,
capability fowner,
capability setgid,
capability setuid,
capability sys_admin,
capability sys_resource,
file,
signal,
mount,
umount,
remount,
network udp,
network tcp,
network dgram,
network stream,
network inet,
network inet6,
network netlink raw,
network unix dgram,
# S6-Overlay
/init ix,
/run/{s6,s6-rc*,service}/** ix,
/package/** ix,
/command/** ix,
/run/{,**} rwk,
/dev/tty rw,
/bin/** ix,
/usr/bin/** ix,
/usr/lib/bashio/** ix,
/etc/s6/** rix,
/run/s6/** rix,
/etc/services.d/** rwix,
/etc/cont-init.d/** rwix,
/etc/cont-finish.d/** rwix,
/init rix,
/var/run/** mrwkl,
/var/run/ mrwkl,
/dev/i2c-1 mrwkl,
# Files required
/dev/fuse mrwkl,
/dev/sda1 mrwkl,
/dev/sdb1 mrwkl,
/dev/nvme0 mrwkl,
/dev/nvme1 mrwkl,
/dev/mmcblk0p1 mrwkl,
/dev/* mrwkl,
/tmp/** mrkwl,
# Data access
/data/** rw,
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
ptrace (trace,read) peer=docker-default,
# docker daemon confinement requires explict allow rule for signal
signal (receive) set=(kill,term) peer=/usr/bin/docker,
}

View File

@@ -1,131 +0,0 @@
arch:
- amd64
audio: true
backup_exclude:
- logs/**
description: Realtime BirdNET soundscape analyzer, compiled from the alexbelgium/birdnet-go fork with all open PRs merged, with OpenVINO enabled for Intel CPU/iGPU acceleration (amd64-only test build)
devices:
- /dev/dri
- /dev/snd
- /dev/snd/controlC0
- /dev/snd/controlC1
- /dev/snd/pcmC1D0c
- /dev/snd/pcmC1D0p
- /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/nvme0
- /dev/nvme0n1
- /dev/nvme0n1p1
- /dev/nvme0n1p2
- /dev/nvme0n1p3
- /dev/nvme1n1
- /dev/nvme1n1p1
- /dev/nvme1n1p2
- /dev/nvme1n1p3
- /dev/nvme2n1
- /dev/nvme2n1p1
- /dev/nvme2n1p2
- /dev/nvme2n3p3
- /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
environment:
BIRDNET_GID: "0"
BIRDNET_UID: "0"
image: ghcr.io/alexbelgium/birdnet-go-source-{arch}
ingress: true
ingress_entry: "ui/dashboard"
ingress_stream: true
init: false
map:
- addon_config:rw
- media:rw
- share:rw
name: Birdnet-go (custom version)
options:
env_vars: []
BIRDSONGS_FOLDER: /config/clips
LOG_MAX_SIZE_MB: 50
LOG_MAX_AGE_DAYS: 7
homeassistant_microphone: false
mqtt_auto_config: false
mariadb_auto_config: false
panel_admin: false
panel_icon: mdi:bird
ports:
8080/tcp: 8080
9090/tcp: 9090
ports_description:
8080/tcp: Web ui
9090/tcp: Telemetry endpoint
privileged:
- SYS_ADMIN
- DAC_READ_SEARCH
- SYS_RESOURCE
schema:
env_vars:
- name: match(^[A-Za-z0-9_]+$)
value: str?
BIRDSONGS_FOLDER: str?
LOG_MAX_SIZE_MB: int(1,1000)?
LOG_MAX_AGE_DAYS: int(1,365)?
TZ: str?
cifsdomain: str?
cifspassword: str?
cifsusername: str?
homeassistant_microphone: bool?
localdisks: str?
mariadb_auto_config: bool?
mqtt_auto_config: bool?
networkdisks: str?
services:
- mysql:want
- mqtt:want
slug: birdnet-go-dev
udev: true
url: https://github.com/alexbelgium/hassio-addons-test/tree/master/birdnet-go
usb: true
version: "source-20260703"
video: true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -1,88 +0,0 @@
#!/usr/bin/env bash
#
# Build-time helper for the BirdNET-Go "from source" Home Assistant add-on.
#
# Clones the alexbelgium/birdnet-go fork, fast-forwards its main onto the
# tphakala/birdnet-go upstream (so main is fully synced with upstream), then
# merges every OPEN, NON-DRAFT ("in review") pull request on top - producing a
# source tree that is upstream main plus all work currently under review.
#
# The merged tree (including .git, which the BirdNET-Go build uses for version
# stamping) is written to the directory given as $1 so the Docker build can
# compile it.
#
# Environment:
# BIRDNET_FORK owner/repo of the fork (default alexbelgium/birdnet-go)
# BIRDNET_UPSTREAM owner/repo of the upstream (default tphakala/birdnet-go)
# GH_TOKEN / GITHUB_TOKEN optional, lifts the 60 req/h unauthenticated
# GitHub API rate limit; not required for public repos
#
set -euo pipefail
TARGET_DIR="${1:?usage: merge-prs.sh <target-dir>}"
FORK="${BIRDNET_FORK:-alexbelgium/birdnet-go}"
UPSTREAM="${BIRDNET_UPSTREAM:-tphakala/birdnet-go}"
FORK_URL="https://github.com/${FORK}.git"
UPSTREAM_URL="https://github.com/${UPSTREAM}.git"
API_URL="https://api.github.com/repos/${FORK}/pulls?state=open&per_page=100"
# Optional token to lift the unauthenticated GitHub API rate limit.
GH_TOKEN="${GH_TOKEN:-${GITHUB_TOKEN:-}}"
log() { echo ">>> $*"; }
git config --global user.email "addon-builder@users.noreply.github.com"
git config --global user.name "BirdNET-Go Addon Builder"
git config --global advice.detachedHead false
log "Cloning fork ${FORK}"
git clone "${FORK_URL}" "${TARGET_DIR}"
cd "${TARGET_DIR}"
git checkout main
log "Syncing main with upstream ${UPSTREAM}"
git remote add upstream "${UPSTREAM_URL}"
git fetch --no-tags upstream main
# --no-ff keeps an explicit sync commit; a no-op when main is already current.
git merge --no-edit --no-ff upstream/main
log "Querying open non-draft PRs from ${FORK}"
auth_header=()
if [ -n "${GH_TOKEN}" ]; then
auth_header=(-H "Authorization: Bearer ${GH_TOKEN}")
fi
pr_json="$(curl -fsSL "${auth_header[@]}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"${API_URL}")"
# Open, non-draft PRs only ("in review"), oldest first for a stable merge order.
mapfile -t prs < <(echo "${pr_json}" \
| jq -r 'sort_by(.number) | .[] | select(.draft == false) | "\(.number)\t\(.head.sha)\t\(.title)"')
if [ "${#prs[@]}" -eq 0 ]; then
log "No open non-draft PRs to merge - building upstream-synced main only"
else
log "Merging ${#prs[@]} open non-draft PR(s)"
fi
for entry in "${prs[@]}"; do
number="$(printf '%s' "${entry}" | cut -f1)"
sha="$(printf '%s' "${entry}" | cut -f2)"
title="$(printf '%s' "${entry}" | cut -f3-)"
log "Merging PR #${number}: ${title} (${sha})"
# Fetch the PR head commit by number; works unauthenticated for public repos.
git fetch --no-tags origin "refs/pull/${number}/head"
if ! git merge --no-edit --no-ff -m "Merge PR #${number}: ${title}" "${sha}"; then
echo "!!! Merge conflict while merging PR #${number} (${title})." >&2
echo "!!! Resolve the conflict in the fork or pause this PR, then rebuild." >&2
git merge --abort || true
exit 1
fi
done
log "Merged HEAD: $(git rev-parse --short HEAD)"
log "Source tree ready at ${TARGET_DIR}"

View File

@@ -1,166 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# Default Variables
DEFAULT_BIRDSONGS_FOLDER="/data/clips"
CONFIG_LOCATION="/config/config.yaml"
# Strip trailing slashes; canonical internal form has none.
normalize_path() {
local p="$1"
while [[ "$p" == */ && "$p" != "/" ]]; do
p="${p%/}"
done
printf '%s' "$p"
}
# Reject paths containing characters that would break the SQL/YAML literals
# we substitute into below. We deliberately allow only "safe" filename chars.
validate_safe_path() {
local p="$1"
if [[ ! "$p" =~ ^[A-Za-z0-9._/-]+$ ]]; then
bashio::log.fatal "Refusing unsafe path: '$p' (only [A-Za-z0-9._/-] allowed)"
exit 1
fi
}
if [ ! -f "$CONFIG_LOCATION" ]; then
bashio::log.warning "There is no config.yaml yet in the config folder, downloading a default one. Please customize"
# Network may be unreachable on first boot. If the download fails, seed
# an empty YAML document so the yq reads/writes below succeed and the
# default-value seeding logic later in this script populates a usable
# config. (We can't remove the file and continue — subsequent yq calls
# under set -e would abort the init script.)
if ! curl -fL -s -S \
https://raw.githubusercontent.com/tphakala/birdnet-go/refs/heads/main/internal/conf/config.yaml \
-o "$CONFIG_LOCATION"; then
bashio::log.warning "Could not download default config.yaml; seeding an empty document so addon defaults can populate it"
echo '{}' > "$CONFIG_LOCATION"
fi
fi
#################
# Migrate Database
#################
if [ -f /data/birdnet.db ]; then
bashio::log.warning "Moving birdnet.db to /config/birdnet.db"
mv /data/birdnet.db /config
fi
######################
# Birdsongs Location
######################
# Read the current folder from config.yaml; "// """ collapses both missing
# keys and explicit nulls (e.g. in a freshly seeded "{}" doc) to an empty
# string so the ${VAR:-DEFAULT} fallback below kicks in.
CURRENT_BIRDSONGS_FOLDER="$(yq -r '.realtime.audio.export.path // ""' "$CONFIG_LOCATION")"
CURRENT_BIRDSONGS_FOLDER="${CURRENT_BIRDSONGS_FOLDER:-$DEFAULT_BIRDSONGS_FOLDER}"
# Treat the upstream-shipped relative "clips/" as the legacy default.
if [[ "$CURRENT_BIRDSONGS_FOLDER" == "clips" || "$CURRENT_BIRDSONGS_FOLDER" == "clips/" ]]; then
CURRENT_BIRDSONGS_FOLDER="$DEFAULT_BIRDSONGS_FOLDER"
fi
CURRENT_BIRDSONGS_FOLDER="$(normalize_path "$CURRENT_BIRDSONGS_FOLDER")"
# Set the new birdsongs folder from addon options (default: relative "clips").
BIRDSONGS_FOLDER="$(bashio::config "BIRDSONGS_FOLDER")"
BIRDSONGS_FOLDER="$(normalize_path "${BIRDSONGS_FOLDER:-clips}")"
validate_safe_path "$BIRDSONGS_FOLDER"
validate_safe_path "$CURRENT_BIRDSONGS_FOLDER"
if [[ ! "$BIRDSONGS_FOLDER" == /* ]]; then
if [ ! -d "/config/$BIRDSONGS_FOLDER" ]; then
mkdir -p "/config/$BIRDSONGS_FOLDER"
fi
if [ -d "/data/$BIRDSONGS_FOLDER" ]; then
if [ -n "$(ls -A /data/"$BIRDSONGS_FOLDER" 2> /dev/null)" ]; then
cp -rf /data/"$BIRDSONGS_FOLDER"/* "/config/$BIRDSONGS_FOLDER"/
fi
rm -r "/data/$BIRDSONGS_FOLDER"
fi
ln -sf "/config/$BIRDSONGS_FOLDER" "/data/$BIRDSONGS_FOLDER"
fi
bashio::log.info "... audio clips saved to $BIRDSONGS_FOLDER according to addon options"
# Migrate data if the folder has changed
if [[ "$CURRENT_BIRDSONGS_FOLDER" != "$BIRDSONGS_FOLDER" ]]; then
bashio::log.warning "Birdsongs folder changed from $CURRENT_BIRDSONGS_FOLDER to $BIRDSONGS_FOLDER"
# Update config.yaml with the new birdsongs folder path (trailing slash
# restored only at the boundary, since birdnet-go expects it).
yq -i -y ".realtime.audio.export.path = \"${BIRDSONGS_FOLDER}/\"" "$CONFIG_LOCATION"
# Move files only if sqlite paths changed
if [[ -d "$CURRENT_BIRDSONGS_FOLDER" && "$(ls -A "$CURRENT_BIRDSONGS_FOLDER")" ]]; then
bashio::log.warning "Migrating files from $CURRENT_BIRDSONGS_FOLDER to $BIRDSONGS_FOLDER"
# The absolute-path target (e.g. the default /config/clips) is never
# created by the relative-path block above, so ensure it exists before
# copying into it; otherwise cp aborts the init script under set -e.
mkdir -p "$BIRDSONGS_FOLDER"
cp -rnf "$CURRENT_BIRDSONGS_FOLDER"/* "$BIRDSONGS_FOLDER"/
mv "$CURRENT_BIRDSONGS_FOLDER" "${CURRENT_BIRDSONGS_FOLDER}_migrated"
fi
# Adapt the database
if [ -f /config/birdnet.db ]; then
backup="$(date +%Y%m%d_%H%M%S)"
BACKUP_FILE="/config/birdnet.db_${backup}"
bashio::log.warning "Modifying database paths from $CURRENT_BIRDSONGS_FOLDER to $BIRDSONGS_FOLDER. A backup will be created at ${BACKUP_FILE}"
# Create backup at the absolute path we'll restore from on failure.
if ! cp /config/birdnet.db "$BACKUP_FILE"; then
bashio::log.error "Failed to create a backup of the database. Aborting path modification."
exit 1
fi
# Paths were validated above against [A-Za-z0-9._/-]+ so quote
# escaping in the SQL literal is not a concern.
SQL_QUERY="UPDATE notes SET clip_name = '${BIRDSONGS_FOLDER}/' || substr(clip_name, length('${CURRENT_BIRDSONGS_FOLDER}/') + 1) WHERE clip_name LIKE '${CURRENT_BIRDSONGS_FOLDER}/%';"
if ! sqlite3 /config/birdnet.db "$SQL_QUERY"; then
bashio::log.warning "An error occurred while updating the paths. The database backup will be restored."
if [ -f "$BACKUP_FILE" ]; then
mv "$BACKUP_FILE" /config/birdnet.db
bashio::log.info "The database backup has been restored."
else
bashio::log.error "Backup file $BACKUP_FILE not found! Manual intervention required."
fi
else
bashio::log.info "Paths have been successfully updated."
fi
fi
fi
####################
# Correct Defaults
####################
# Seed addon-specific defaults only if the user has not set them in
# config.yaml. The "//=" form leaves any user-edited value alone, so
# changes made via the BirdNET-Go UI or by hand-editing /config/config.yaml
# survive container restarts.
bashio::log.info "Seeding default configuration values (only if missing)"
yq -i -y '.output.sqlite.path //= "/config/birdnet.db"' "$CONFIG_LOCATION"
####################
# Log Management
####################
LOG_MAX_SIZE_MB="$(bashio::config "LOG_MAX_SIZE_MB")"
LOG_MAX_SIZE_MB="${LOG_MAX_SIZE_MB:-50}"
LOG_MAX_AGE_DAYS="$(bashio::config "LOG_MAX_AGE_DAYS")"
LOG_MAX_AGE_DAYS="${LOG_MAX_AGE_DAYS:-7}"
bashio::log.info "Seeding default log rotation: max ${LOG_MAX_SIZE_MB}MB per file, max ${LOG_MAX_AGE_DAYS} days retention (only applied if not already set)"
# Seed log-rotation defaults; do not clobber user-edited values.
yq -i -y ".logging.file_output.max_size //= ${LOG_MAX_SIZE_MB}" "$CONFIG_LOCATION"
yq -i -y ".logging.file_output.max_age //= ${LOG_MAX_AGE_DAYS}" "$CONFIG_LOCATION"
yq -i -y '.logging.file_output.max_rotated_files //= 3' "$CONFIG_LOCATION"
yq -i -y '.logging.file_output.compress //= true' "$CONFIG_LOCATION"
# Trim existing log files that exceed the configured max age
LOG_DIR="/config/logs"
if [ -d "$LOG_DIR" ]; then
bashio::log.info "Trimming log files older than ${LOG_MAX_AGE_DAYS} days in ${LOG_DIR}"
ln -sf "$LOG_DIR" /logs
find "$LOG_DIR" -type f -name "*.log*" -mtime +"$LOG_MAX_AGE_DAYS" -delete 2>/dev/null || true
fi

View File

@@ -1,18 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
#################
# NGINX SETTING #
#################
declare ingress_interface
declare ingress_port
echo "Adapting for ingress"
ingress_port=$(bashio::addon.ingress_port)
ingress_interface=$(bashio::addon.ip_address)
ingress_entry=$(bashio::addon.ingress_entry)
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/servers/ingress.conf

View File

@@ -1,112 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# When the Home Assistant MariaDB addon is active, optionally wire its
# credentials directly into BirdNET-Go's config.yaml. Upstream reads MySQL
# settings only from YAML (no env-var overrides exist), so this is the only
# way to auto-configure them. The behaviour is opt-in via the
# mariadb_auto_config addon option.
#
# When the option is off but MariaDB is detected, we log a one-shot hint and
# ensure config.yaml falls back to SQLite (reverting any previously written
# mysql block). This is safe because BirdNET-Go's config.yaml defaults to
# SQLite and the mysql block is only ever written by this script.
#
# When the option is on we:
# 1. Create the "birdnet" database if it does not already exist — birdnet-go
# connects to an existing schema and does not create it automatically.
# 2. Write the MySQL credentials into config.yaml and disable SQLite.
CONFIG_LOCATION="/config/config.yaml"
MYSQL_DATABASE="birdnet"
if ! bashio::services.available 'mysql'; then
exit 0
fi
MYSQL_HOST="$(bashio::services 'mysql' 'host')"
MYSQL_PORT="$(bashio::services 'mysql' 'port')"
MYSQL_USER="$(bashio::services 'mysql' 'username')"
MYSQL_PASS="$(bashio::services 'mysql' 'password')"
if ! bashio::config.true 'mariadb_auto_config'; then
bashio::log.green "---"
bashio::log.yellow "Home Assistant MariaDB addon detected but mariadb_auto_config is disabled; ensuring BirdNET-Go uses SQLite."
bashio::log.yellow "Set 'mariadb_auto_config: true' in the addon options to wire MariaDB into BirdNET-Go automatically. Connection details:"
bashio::log.blue "Database user : ${MYSQL_USER}"
bashio::log.blue "Database password: [redacted]"
bashio::log.blue "Database name : ${MYSQL_DATABASE}"
bashio::log.blue "Host-name : ${MYSQL_HOST}"
bashio::log.blue "Port : ${MYSQL_PORT}"
bashio::log.green "---"
if [ -f "$CONFIG_LOCATION" ]; then
# Only revert if config.yaml points at the HA MariaDB host we would have
# written — a mysql block pointing at a different host was set manually.
# shellcheck disable=SC2016
CURRENT_MYSQL_HOST="$(yq -r '.output.mysql.host // empty' "$CONFIG_LOCATION" 2>/dev/null || true)"
if yq -e '.output.mysql.enabled == true' "$CONFIG_LOCATION" >/dev/null 2>&1 \
&& [ "${CURRENT_MYSQL_HOST}" = "${MYSQL_HOST}" ]; then
yq -i -y \
'.output.mysql.enabled = false
| .output.sqlite.enabled = true' \
"$CONFIG_LOCATION"
fi
fi
exit 0
fi
if [ ! -f "$CONFIG_LOCATION" ]; then
bashio::log.warning "Skipping MariaDB auto-configuration: $CONFIG_LOCATION not found"
exit 0
fi
bashio::log.green "---"
bashio::log.blue "mariadb_auto_config enabled; creating MariaDB database and wiring credentials into BirdNET-Go config"
bashio::log.blue "Host: ${MYSQL_HOST}:${MYSQL_PORT}"
bashio::log.blue "User: ${MYSQL_USER}"
bashio::log.blue "Database: ${MYSQL_DATABASE}"
bashio::log.green "---"
# Resolve MariaDB hostname to IPv4: on HAOS >=17.3 the Supervisor network
# gained IPv6, but the MariaDB addon only grants its user from the IPv4
# subnet. Fall back to the raw hostname if resolution fails.
MYSQL_HOST_RESOLVED="$(getent ahostsv4 "${MYSQL_HOST}" 2>/dev/null | awk '{print $1; exit}')"
MYSQL_HOST_RESOLVED="${MYSQL_HOST_RESOLVED:-${MYSQL_HOST}}"
if [ "${MYSQL_HOST_RESOLVED}" != "${MYSQL_HOST}" ]; then
bashio::log.blue "Resolved ${MYSQL_HOST} -> ${MYSQL_HOST_RESOLVED} (forcing IPv4)"
fi
# Create the database — birdnet-go connects to an existing schema and does NOT
# create it automatically. MYSQL_PWD avoids exposing the password via the
# process command line.
if ! MYSQL_PWD="${MYSQL_PASS}" mysql \
--skip-ssl \
--host="${MYSQL_HOST_RESOLVED}" \
--port="${MYSQL_PORT}" \
--user="${MYSQL_USER}" \
--connect-timeout=10 \
-e "CREATE DATABASE IF NOT EXISTS \`${MYSQL_DATABASE}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"; then
bashio::log.error "Failed to create MariaDB database '${MYSQL_DATABASE}' — verify the MariaDB addon is running and the user has CREATE DATABASE privileges"
exit 1
fi
bashio::log.blue "Database '${MYSQL_DATABASE}' is ready"
# Upstream config.go stores port as a string; pass it as such to match.
# $host / $port / etc. are jq/yq variables, not shell expansions — the
# single quotes around the filter are intentional.
# shellcheck disable=SC2016
yq -i -y \
--arg host "$MYSQL_HOST" \
--arg port "$MYSQL_PORT" \
--arg user "$MYSQL_USER" \
--arg pass "$MYSQL_PASS" \
--arg db "$MYSQL_DATABASE" \
'.output.mysql.enabled = true
| .output.mysql.host = $host
| .output.mysql.port = $port
| .output.mysql.username = $user
| .output.mysql.password = $pass
| .output.mysql.database = $db
| .output.sqlite.enabled = false' \
"$CONFIG_LOCATION"

View File

@@ -1,77 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# When the Home Assistant MQTT addon is active, optionally wire its
# credentials directly into BirdNET-Go's config.yaml. Upstream reads MQTT
# settings only from YAML (no env-var overrides exist), so this is the only
# way to auto-configure them. The behaviour is opt-in via the
# mqtt_auto_config addon option. When the option is off but Mosquitto is
# detected, we log a one-shot hint pointing users at the option.
#
# In addition to the broker credentials we enable BirdNET-Go's native Home
# Assistant MQTT auto-discovery (realtime.mqtt.homeassistant.*). This makes
# the detection sensors appear in Home Assistant automatically, so users no
# longer have to hand-write the MQTT sensor YAML from HAINTEGRATION.md.
CONFIG_LOCATION="/config/config.yaml"
if ! bashio::services.available 'mqtt'; then
exit 0
fi
MQTT_HOST="$(bashio::services 'mqtt' 'host')"
MQTT_PORT="$(bashio::services 'mqtt' 'port')"
MQTT_USER="$(bashio::services 'mqtt' 'username')"
MQTT_PASS="$(bashio::services 'mqtt' 'password')"
MQTT_BROKER="tcp://${MQTT_HOST}:${MQTT_PORT}"
if ! bashio::config.true 'mqtt_auto_config'; then
bashio::log.green "---"
bashio::log.yellow "Home Assistant MQTT addon detected. Set 'mqtt_auto_config: true' in the addon options to wire it into BirdNET-Go automatically AND enable Home Assistant auto-discovery (sensors appear in HA with no manual YAML). Connection details:"
bashio::log.blue "MQTT user : ${MQTT_USER}"
bashio::log.blue "MQTT password: ${MQTT_PASS}"
bashio::log.blue "MQTT broker : ${MQTT_BROKER}"
bashio::log.green "---"
exit 0
fi
if [ ! -f "$CONFIG_LOCATION" ]; then
bashio::log.warning "Skipping MQTT auto-configuration: $CONFIG_LOCATION not found"
exit 0
fi
bashio::log.green "---"
bashio::log.blue "mqtt_auto_config enabled; writing Home Assistant MQTT credentials into BirdNET-Go config"
bashio::log.blue "Broker: ${MQTT_BROKER}"
bashio::log.blue "User: ${MQTT_USER}"
bashio::log.blue "Home Assistant auto-discovery: enabled (sensors appear in HA automatically)"
bashio::log.green "---"
# $broker / $user / $pass / "birdnet" are jq/yq variables and literals,
# not shell expansions, so the single quotes are intentional.
#
# Connection fields (enabled/broker/username/password) are force-set on every
# start so they track the HA MQTT addon's rotating credentials. Topic and the
# homeassistant.* discovery knobs use "//=" so they are only seeded when
# missing. retain is seeded via an explicit has() check rather than "//=",
# because jq treats a user-set "retain: false" as falsy and "//=" would wrongly
# flip it back to true; has() seeds the default only when the key is truly
# absent. Any value the user later changes in the BirdNET-Go UI or config.yaml
# therefore survives restarts. homeassistant.enabled is force-set to true
# because turning on discovery is the whole point of the auto-config option.
# shellcheck disable=SC2016
yq -i -y \
--arg broker "$MQTT_BROKER" \
--arg user "$MQTT_USER" \
--arg pass "$MQTT_PASS" \
'.realtime.mqtt.enabled = true
| .realtime.mqtt.broker = $broker
| .realtime.mqtt.username = $user
| .realtime.mqtt.password = $pass
| .realtime.mqtt.topic //= "birdnet"
| (if (.realtime.mqtt | has("retain")) then . else .realtime.mqtt.retain = true end)
| .realtime.mqtt.homeassistant.enabled = true
| .realtime.mqtt.homeassistant.discovery_prefix //= "homeassistant"
| .realtime.mqtt.homeassistant.device_name //= "BirdNET-Go"' \
"$CONFIG_LOCATION"

View File

@@ -1,47 +0,0 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
#################
# INITALISATION #
#################
echo " "
# Allow advanced users to supply their own ALSA config (e.g. to enable JACK
# or a custom dsnoop chain) by dropping asound.conf into the addon config
# folder. Written to /root/.asoundrc because /etc/asound.conf is read-only.
if [ -f /config/asound.conf ]; then
if [ -r /config/asound.conf ]; then
bashio::log.info "Using user-provided /config/asound.conf, overriding addon defaults"
if ! cp /config/asound.conf /root/.asoundrc; then
bashio::log.warning "Failed to copy /config/asound.conf; continuing with bundled /root/.asoundrc defaults"
fi
else
bashio::log.warning "/config/asound.conf exists but is not readable; continuing with bundled /root/.asoundrc defaults"
fi
fi
# Check if alsa_card is provided
CONFIG_LOCATION="/config/config.yaml"
if bashio::config.true "homeassistant_microphone"; then
bashio::log.info "homeassistant_microphone option is selected. The audio card config value is set to 'default'. Set in the addon options to which this is set"
audio_card="default"
yq -iy ".realtime.audio.source = \"${audio_card}\"" "$CONFIG_LOCATION"
else
bashio::log.info "homeassistant_microphone option is not set, keeping audio source configured via the UI"
fi
########################
# CONFIGURE birdnet-go #
########################
bashio::log.info "Starting app..."
# shellcheck disable=SC2086
/usr/bin/entrypoint.sh birdnet-go realtime &
true
# Wait for app to become available to start nginx
bashio::net.wait_for 8080 localhost 900
bashio::log.info "Starting NGinx..."
exec nginx

View File

@@ -1,96 +0,0 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@@ -1,16 +0,0 @@
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_hide_header X-Frame-Options;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;

View File

@@ -1 +0,0 @@
resolver 127.0.0.11 ipv6=off;

View File

@@ -1,6 +0,0 @@
root /dev/null;
server_name $hostname;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;

View File

@@ -1,9 +0,0 @@
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_ecdh_curve secp384r1;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;

View File

@@ -1,81 +0,0 @@
# Run nginx in foreground.
daemon off;
# This is run inside Docker.
user root;
# Pid storage location.
pid /var/run/nginx.pid;
# Set number of worker processes.
worker_processes auto;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;
# Write error log to Hass.io add-on log.
error_log /proc/1/fd/1 error;
# Load allowed environment vars
env HASSIO_TOKEN;
# Load dynamic modules.
include /etc/nginx/modules/*.conf;
# Max num of simultaneous connections by a worker process.
events {
worker_connections 8192;
}
http {
include /etc/nginx/includes/mime.types;
# https://emby.media/community/index.php?/topic/93074-how-to-emby-with-nginx-with-windows-specific-tips-and-csp-options/
server_names_hash_bucket_size 64;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
image/svg+xml;
proxy_connect_timeout 1h;
log_format hassio '[$time_local] $status '
'$http_x_forwarded_for($remote_addr) '
'$request ($http_user_agent)';
access_log /proc/1/fd/1 hassio;
client_max_body_size 4G;
default_type application/octet-stream;
gzip on;
keepalive_timeout 65;
sendfile on;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $time_iso8601 $today {
default "";
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
include /etc/nginx/includes/resolver.conf;
include /etc/nginx/servers/*.conf;
}

View File

@@ -1,54 +0,0 @@
server {
listen %%interface%%:%%port%% default_server;
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
location / {
proxy_pass http://localhost:8080/;
rewrite ^%%ingress_entry%%/?(.*)$ /$1 break;
# Disable buffering (required for SSE and sub_filter)
proxy_buffering off;
proxy_request_buffering off;
proxy_cache off;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Tell BirdNET-Go its proxy prefix. Upstream honours X-Ingress-Path
# in internal/api/server.go and rewrites HTML href/src/action
# attributes itself, so we no longer duplicate that work here.
proxy_set_header X-Ingress-Path %%ingress_entry%%;
# Prevent timeouts
proxy_read_timeout 86400;
proxy_send_timeout 86400;
# sub_filter setup: keep gzip off and the type filter wide so JS gets
# touched too (the upstream HTML rewriter does not look inside JS).
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types *;
# JS string-literal rewrites — paths embedded in JS code are not
# touched by upstream's HTML rewriter, so we patch them here.
sub_filter EventSource('/ EventSource('%%ingress_entry%%/;
sub_filter fetch('/ fetch('%%ingress_entry%%/;
sub_filter `/api/v `%%ingress_entry%%/api/v;
sub_filter "'/api/v" "'%%ingress_entry%%/api/v";
sub_filter \"/api/v \"%%ingress_entry%%/api/v;
sub_filter `/u `%%ingress_entry%%/u;
sub_filter "'/u" "'%%ingress_entry%%/u";
sub_filter \"/u \"%%ingress_entry%%/u;
sub_filter `/asset `%%ingress_entry%%/asset;
sub_filter "'/asset" "'%%ingress_entry%%/asset";
sub_filter \"/asset \"%%ingress_entry%%/asset;
sub_filter window.location.origin} window.location.origin}%%ingress_entry%%;
}
}

View File

@@ -1,35 +0,0 @@
# Home Assistant addon: birdnet-go
#
# Shipped at /root/.asoundrc because /etc/asound.conf is read-only in this
# environment. ALSA loads ~/.asoundrc as an additive layer on top of the
# system config, so the overrides below take effect for the birdnet-go process
# (which runs as root, HOME=/root).
#
# Replace ALSA PCM plugins whose backends are not available in the addon
# container (JACK server, OSS /dev/dsp) with type "null" and hide them from
# snd_device_name_hint(). Without this, miniaudio's capture-device enumeration
# probes every PCM hint at startup, triggering noisy errors like:
# - "Cannot connect to server socket" / "jack server is not running" (libjack)
# - "ALSA lib pcm_oss.c: Cannot open device /dev/dsp"
# - "ALSA lib pcm_dsnoop.c: unable to open slave"
# BirdNET-Go itself never opens these PCMs; only the enumeration probe does.
pcm.!jack {
type null
hint.show off
}
pcm.!oss {
type null
hint.show off
}
pcm.!dsp {
type null
hint.show off
}
pcm.!dsnoop {
type null
hint.show off
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1,12 +0,0 @@
{
"github_beta": true,
"github_exclude": "-4",
"github_fulltag": true,
"last_update": "2026-06-07",
"paused": true,
"repository": "alexbelgium/hassio-addons",
"slug": "birdnet-go",
"source": "github",
"upstream_repo": "tphakala/birdnet-go",
"upstream_version": "nightly-20260601"
}