Compare commits

...

16 Commits

Author SHA1 Message Date
Alexandre
14070f6243 Update config.yaml 2026-01-29 20:27:02 +01:00
github-actions
c427e3beea GitHub bot: changelog 2026-01-29 17:16:13 +00:00
Alexandre
96d49344b6 Update config.yaml 2026-01-29 17:59:48 +01:00
Alexandre
5bdcab6ccd Merge pull request #2415 from alexbelgium/codex/update-nginx.conf-installation-and-configurations
Use upstream frontend nginx.conf and generate ingress config at startup
2026-01-29 17:43:19 +01:00
Alexandre
e75cf4beea update 2026-01-29 17:40:59 +01:00
Alexandre
936d44c21c clean 2026-01-29 17:39:15 +01:00
Alexandre
8e86e0b8e7 Update BirdNET-PiPy nginx configs 2026-01-29 17:38:17 +01:00
Alexandre
80b0e840bb Update ingress_params.conf 2026-01-29 17:26:47 +01:00
Alexandre
29d5d796a2 Create ingress_params.conf 2026-01-29 17:25:45 +01:00
Alexandre
5e1622584e Update server_params.conf 2026-01-29 17:25:15 +01:00
Alexandre
18766146a0 Update nginx.conf 2026-01-29 17:22:02 +01:00
Alexandre
8372be9c20 Update run 2026-01-29 17:14:07 +01:00
github-actions
ae64850d97 GitHub bot: changelog 2026-01-29 15:27:26 +00:00
Alexandre
c3a5a67518 Merge pull request #2414 from alexbelgium/codex/check-connection-logic-for-birdnet-pipy
Fix BirdNET-PiPy nginx routing and docs for direct access
2026-01-29 16:13:13 +01:00
Alexandre
0fb143972d Bump BirdNET-PiPy version 2026-01-29 16:12:53 +01:00
Alexandre
5c10f19d18 Fix BirdNET-PiPy nginx routing 2026-01-29 16:07:08 +01:00
10 changed files with 46 additions and 89 deletions

View File

@@ -1,3 +1,9 @@
## 0.6.3 (29-01-2026)
- Minor bugs fixed
## 0.6.2 (29-01-2026)
- Use upstream nginx.conf and generate ingress config at startup
## 0.6.1 (29-01-2026)
- Minor bugs fixed
## 0.2 (29-01-2026)
- Minor bugs fixed
# Changelog

View File

@@ -10,7 +10,7 @@
## Access
- **Ingress:** Use the Home Assistant sidebar entry.
- **Direct:** `http://<host>:8099`
- **Direct:** `http://<host>:8011` (or the port you configure)
## Options

View File

@@ -57,6 +57,7 @@ RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGL
# Copy local files
COPY rootfs/ /
RUN find /etc -type f \( -name "*.sh" -o -path "*/services.d/*/run" \) -exec chmod +x {} \;
COPY --from=frontend-builder /src/frontend/nginx.conf /etc/nginx/servers/nginx.conf
# Uses /bin for compatibility purposes
# hadolint ignore=DL4005
@@ -84,9 +85,6 @@ RUN python3 -m venv "${VIRTUAL_ENV}"
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
RUN pip install --no-cache-dir --extra-index-url https://www.piwheels.org/simple -r /app/requirements.txt
# Add frontend nginx
ADD "https://raw.githubusercontent.com/Suncuss/BirdNET-PiPy/refs/heads/main/frontend/nginx.conf" "/etc/nginx/servers/nginx.conf"
# Patch service hostnames for single-container usage
RUN sed -i \
-e "s/API_HOST = 'api'/API_HOST = '127.0.0.1'/" \

View File

@@ -9,7 +9,7 @@ BirdNET-PiPy is a self-hosted system that uses the BirdNET deep-learning model t
## Configuration
Install, then start the add-on a first time. Open the Web UI from Home Assistant (Ingress) or directly at `http://<host>:8099`.
Install, then start the add-on a first time. Open the Web UI from Home Assistant (Ingress) or directly at `http://<host>:8011` (or the port you configure).
Configure location, audio source, and other settings in the BirdNET-PiPy UI after the container starts.
Options can be configured through three ways:

View File

@@ -56,6 +56,9 @@ devices:
- /dev/nvme0
- /dev/nvme1
- /dev/nvme2
environment:
PGID: "0"
PUID: "0"
image: ghcr.io/alexbelgium/birdnet-pipy-{arch}
ingress: true
ingress_stream: true
@@ -98,4 +101,4 @@ schema:
ssl: bool?
slug: birdnet-pipy
url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pipy
version: "0.6"
version: "0.6.3"

View File

@@ -14,12 +14,19 @@ ingress_interface="$(bashio::addon.ip_address)"
ingress_entry="$(bashio::addon.ingress_entry)"
ingress_entry_modified="$(echo "$ingress_entry" | sed 's/[@_!#$%^&*()<>?/\|}{~:]//g')"
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
sed -i "s#%%ingress_entry_modified%%#/${ingress_entry_modified}#g" /etc/nginx/servers/ingress.conf
sed -i "s#%%ingress_entry%%#${ingress_entry}#g" /etc/nginx/servers/nginx.conf
sed -i "s#%%ingress_entry_modified%%#/${ingress_entry_modified}#g" /etc/nginx/servers/nginx.conf
sed -i \
-e "s|proxy_pass http://api|proxy_pass http://127.0.0.1|g" \
-e "s|proxy_pass http://icecast|proxy_pass http://127.0.0.1|g" \
/etc/nginx/servers/nginx.conf
cp /etc/nginx/servers/nginx.conf /etc/nginx/servers/ingress.conf
sed -i \
-e "s|listen 80;|listen ${ingress_interface}:${ingress_port} default_server;|g" \
-e "/index index.html;/a\\ include /etc/nginx/includes/ingress_params.conf;" \
/etc/nginx/servers/ingress.conf
sed -i "s#%%ingress_entry%%#${ingress_entry}#g" /etc/nginx/includes/ingress_params.conf
sed -i "s#%%ingress_entry_modified%%#/${ingress_entry_modified}#g" /etc/nginx/includes/ingress_params.conf
# Set DNS resolver for internal requests
sed -i "s/%%dns_host%%/127.0.0.11/g" /etc/nginx/includes/resolver.conf

View File

@@ -0,0 +1,17 @@
sub_filter_once off;
sub_filter_types text/html;
sub_filter '<head>' '<head><base href="%%ingress_entry%%/">';
sub_filter 'href="/' 'href="%%ingress_entry%%/';
sub_filter 'src="/' 'src="%%ingress_entry%%/';
# Disable buffering
proxy_buffering off;
proxy_request_buffering off;
proxy_cache off;
# Next three lines allow websockets
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;

View File

@@ -1,5 +1,5 @@
server_name $hostname;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;

View File

@@ -1,74 +0,0 @@
server {
listen %%interface%%:%%port%% default_server;
root /usr/share/nginx/html;
index index.html;
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
client_max_body_size 0;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
sub_filter_once off;
sub_filter_types text/html;
sub_filter '<head>' '<head><base href="%%ingress_entry%%/">';
sub_filter 'href="/' 'href="%%ingress_entry%%/';
sub_filter 'src="/' 'src="%%ingress_entry%%/';
location ^~ /api/ {
proxy_pass http://127.0.0.1:5002;
}
location = /internal/auth {
internal;
proxy_pass http://127.0.0.1:5002/api/auth/verify;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Cookie $http_cookie;
}
location @stream_unauthorized {
default_type application/json;
return 401 '{"error": "Authentication required"}';
}
location ^~ /stream/ {
auth_request /internal/auth;
error_page 401 = @stream_unauthorized;
proxy_pass http://127.0.0.1:8888/;
proxy_buffering off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
location /socket.io/ {
proxy_pass http://127.0.0.1:5002/socket.io/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_cache_bypass $http_upgrade;
}
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /index.html;
error_page 500 502 503 504 /index.html;
}

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -euo pipefail
exec nginx -g "daemon off;"
nginx