Allow ingress access to restricted areas

This commit is contained in:
Alexandre
2024-05-19 21:00:48 +02:00
parent bc8b867612
commit 2921e9bc99
2 changed files with 6 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
- [INGRESS] Allow access to restricted area without password if authentificated from within the homeassistant app
## 0.13-31 (19-05-2024)
- [SPECIES_CONVERTER] : Significantly improve, add a webui when the option is enabled
- [SPECIES_CONVERTER] : Improve the SPECIES_CONVERTER webui with input text filtering in both browser and mobile

View File

@@ -25,4 +25,8 @@ 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
echo "... ensuring restricted area access"
echo "${ingress_entry}" > /ingress_url
sed -i "/function is_authenticated/a if (strpos(\$_SERVER['HTTP_REFERER'], '/api/hassio_ingress') !== false && strpos(\$_SERVER['HTTP_REFERER'], trim(file_get_contents('/ingress_url'))) !== false) { \$ret = true; return \$ret; }" "$HOME"/BirdNET-Pi/scripts/common.php
echo " "