mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-10-10 18:21:36 +02:00
Compare commits
10 Commits
ebe25a6463
...
9151d3bc8a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9151d3bc8a | ||
|
|
0248c95e59 | ||
|
|
78b47f5355 | ||
|
|
8f423ad2f4 | ||
|
|
733134ed5d | ||
|
|
d6de19315d | ||
|
|
71bb8b5130 | ||
|
|
4975eca7c2 | ||
|
|
e09e2afb2c | ||
|
|
05cbe751d5 |
@@ -1,5 +1,12 @@
|
|||||||
|
## 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)
|
## nightly-20260525 (26-05-2026)
|
||||||
- Minor bugs fixed
|
- Minor bugs fixed
|
||||||
|
|
||||||
## nightly-20260511-414-2 (22-05-2026)
|
## nightly-20260511-414-2 (22-05-2026)
|
||||||
- Minor bugs fixed
|
- Minor bugs fixed
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,13 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \
|
|||||||
COPY rootfs/ /
|
COPY rootfs/ /
|
||||||
RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \;
|
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.
|
||||||
|
RUN if [ -f /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; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Uses /bin for compatibility purposes
|
# Uses /bin for compatibility purposes
|
||||||
# hadolint ignore=DL4005
|
# hadolint ignore=DL4005
|
||||||
RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \
|
RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ name: Birdnet-go
|
|||||||
options:
|
options:
|
||||||
env_vars: []
|
env_vars: []
|
||||||
BIRDSONGS_FOLDER: /config/clips
|
BIRDSONGS_FOLDER: /config/clips
|
||||||
|
LOG_MAX_SIZE_MB: 50
|
||||||
|
LOG_MAX_AGE_DAYS: 7
|
||||||
homeassistant_microphone: false
|
homeassistant_microphone: false
|
||||||
panel_admin: false
|
panel_admin: false
|
||||||
panel_icon: mdi:bird
|
panel_icon: mdi:bird
|
||||||
@@ -104,6 +106,8 @@ schema:
|
|||||||
- name: match(^[A-Za-z0-9_]+$)
|
- name: match(^[A-Za-z0-9_]+$)
|
||||||
value: str?
|
value: str?
|
||||||
BIRDSONGS_FOLDER: str?
|
BIRDSONGS_FOLDER: str?
|
||||||
|
LOG_MAX_SIZE_MB: int(1,1000)?
|
||||||
|
LOG_MAX_AGE_DAYS: int(1,365)?
|
||||||
TZ: str?
|
TZ: str?
|
||||||
cifsdomain: str?
|
cifsdomain: str?
|
||||||
cifspassword: str?
|
cifspassword: str?
|
||||||
@@ -118,4 +122,4 @@ slug: birdnet-go
|
|||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-go
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-go
|
||||||
usb: true
|
usb: true
|
||||||
version: "nightly-20260525"
|
version: "nightly-20260525-2"
|
||||||
|
|||||||
@@ -100,3 +100,26 @@ bashio::log.info "Correcting configuration for defaults"
|
|||||||
# Update database location in config files
|
# Update database location in config files
|
||||||
yq -i -y ".output.sqlite.path = \"/config/birdnet.db\"" "$CONFIG_LOCATION"
|
yq -i -y ".output.sqlite.path = \"/config/birdnet.db\"" "$CONFIG_LOCATION"
|
||||||
bashio::log.info "... database is located in /config/birdnet.db"
|
bashio::log.info "... database is located in /config/birdnet.db"
|
||||||
|
|
||||||
|
####################
|
||||||
|
# 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 "Configuring log rotation: max ${LOG_MAX_SIZE_MB}MB per file, max ${LOG_MAX_AGE_DAYS} days retention"
|
||||||
|
|
||||||
|
# Configure log rotation in birdnet-go config
|
||||||
|
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}"
|
||||||
|
find "$LOG_DIR" -type f -name "*.log*" -mtime +"$LOG_MAX_AGE_DAYS" -delete 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|||||||
@@ -8,6 +8,20 @@ set -e
|
|||||||
|
|
||||||
echo " "
|
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
|
# Check if alsa_card is provided
|
||||||
CONFIG_LOCATION="/config/config.yaml"
|
CONFIG_LOCATION="/config/config.yaml"
|
||||||
if bashio::config.true "homeassistant_microphone"; then
|
if bashio::config.true "homeassistant_microphone"; then
|
||||||
|
|||||||
35
birdnet-go/rootfs/root/.asoundrc
Normal file
35
birdnet-go/rootfs/root/.asoundrc
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# 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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user