Compare commits

..

4 Commits

Author SHA1 Message Date
Alexandre
7cdb4b478a Merge pull request #2453 from alexbelgium/codex/fix-issue-#2451
sonarr: add ffmpeg (provides ffprobe) and bump version
2026-02-06 10:36:29 +01:00
Alexandre
c6fb0befea Bump Sonarr addon version 2026-02-06 10:36:07 +01:00
Alexandre
4ad9488db8 Apply dns servers only if no vpn option is true
https://github.com/alexbelgium/hassio-addons/issues/2449
2026-02-06 10:16:05 +01:00
Alexandre
a5f005e1c6 Suppress smb permissions messages
https://github.com/alexbelgium/hassio-addons/issues/2449
2026-02-06 10:06:41 +01:00
5 changed files with 40 additions and 32 deletions

View File

@@ -36,15 +36,16 @@ test_mount() {
_test_write() {
local testfile="$mountpoint/.writetest_$$"
if : >"$testfile" 2>/dev/null; then
rm -f "$testfile" || true
rm -f "$testfile" 2>/dev/null || true
return 0
else
rm -f "$testfile" 2>/dev/null || true
return 1
fi
}
# First write test
if _test_write; then
if _test_write 2>/dev/null; then
MOUNTED=true
return 0
fi
@@ -56,7 +57,7 @@ test_mount() {
umount "$mountpoint" 2>/dev/null || true
if mount_drive "$MOUNTOPTIONS"; then
if _test_write; then
if _test_write 2>/dev/null; then
MOUNTED=true
return 0
fi
@@ -70,7 +71,7 @@ test_mount() {
umount "$mountpoint" 2>/dev/null || true
if mount_drive "$MOUNTOPTIONS"; then
if _test_write; then
if _test_write 2>/dev/null; then
MOUNTED=true
return 0
fi
@@ -78,7 +79,6 @@ test_mount() {
fi
# ---- Final: mounted but not writable ----
bashio::log.warning "Disk mounted but is not writable (permission denied). Marking as read-only."
MOUNTED="readonly"
return 0
}

View File

@@ -9,35 +9,38 @@ set -e
# Avoid usage of local dns such as adguard home or pihole\n"
if bashio::config.has_value 'DNS_server'; then
# Define variables
DNSSERVER=$(bashio::config 'DNS_server')
DNS=""
DNSLIST=""
# Get DNS servers
# shellcheck disable=SC2086
for server in ${DNSSERVER//,/ }; do # Separate comma separated values
# Only add DNS if successful
if ping -c 1 "$server" &> /dev/null; then
DNS="${DNS}nameserver $server\n"
DNSLIST="$server $DNSLIST"
if ! bashio::config.is_true "openvpn_enabled" && ! bashio::config.is_true "wireguard_enabled"; then
# Define variables
DNSSERVER=$(bashio::config 'DNS_server')
DNS=""
DNSLIST=""
# Get DNS servers
# shellcheck disable=SC2086
for server in ${DNSSERVER//,/ }; do # Separate comma separated values
# Only add DNS if successful
if ping -c 1 "$server" &> /dev/null; then
DNS="${DNS}nameserver $server\n"
DNSLIST="$server $DNSLIST"
else
bashio::log.warning "DNS $server was requested but can't be pinged. It won't be used"
fi
done
# Only add DNS if there are DNS set
# shellcheck disable=SC2236
if [[ -n "${DNS:-}" ]]; then
# Write resolv.conf
# shellcheck disable=SC2059
printf "${DNS}" > /etc/resolv.conf
chmod 644 /etc/resolv.conf
bashio::log.info "DNS SERVERS set to $DNSLIST"
else
bashio::log.warning "DNS $server was requested but can't be pinged. It won't be used"
bashio::log.warning "No valid DNS were found. Using default router (or HA) dns servers."
fi
done
# Only add DNS if there are DNS set
# shellcheck disable=SC2236
if [[ -n "${DNS:-}" ]]; then
# Write resolv.conf
# shellcheck disable=SC2059
printf "${DNS}" > /etc/resolv.conf
chmod 644 /etc/resolv.conf
bashio::log.info "DNS SERVERS set to $DNSLIST"
else
bashio::log.warning "No valid DNS were found. Using default router (or HA) dns servers."
bashio::log.warning "DNS servers are enabled but a vpn is enabled. Resolv will be handled through the vpn script"
fi
else
bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers."
fi

View File

@@ -1,4 +1,7 @@
## 4.0.16.2946-2 (2026-02-06)
- Add ffmpeg to provide ffprobe for runtime detection (fixes https://github.com/alexbelgium/hassio-addons/issues/2451)
## 4.0.16.2946-1 (2026-01-08)
- ⚠ MAJOR CHANGE : switch to the new config logic from homeassistant. Your configuration files will have migrated from /config/addons_config/sonarr to a folder only accessible from my Filebrowser addon called /addon_configs/xxx-sonarr_nas. This avoids the addon to mess with your homeassistant configuration folder, and allows to backup the options. Migration of data should be automatic. Please be sure to update all your links however ! For more information, see here : https://developers.home-assistant.io/blog/2023/11/06/public-addon-config/

View File

@@ -57,7 +57,9 @@ RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_auto
ENV PACKAGES="jq \
curl \
cifs-utils \
keyutils nginx"
keyutils \
ffmpeg \
nginx"
# Automatic apps & bashio
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"

View File

@@ -110,4 +110,4 @@ schema:
slug: sonarr_nas
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/sonarr
version: "4.0.16.2946-1"
version: "4.0.16.2946-2"