mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 13:24:04 +02:00
Compare commits
16 Commits
7905b2df7b
...
14070f6243
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14070f6243 | ||
|
|
c427e3beea | ||
|
|
96d49344b6 | ||
|
|
5bdcab6ccd | ||
|
|
e75cf4beea | ||
|
|
936d44c21c | ||
|
|
8e86e0b8e7 | ||
|
|
80b0e840bb | ||
|
|
29d5d796a2 | ||
|
|
5e1622584e | ||
|
|
18766146a0 | ||
|
|
8372be9c20 | ||
|
|
ae64850d97 | ||
|
|
c3a5a67518 | ||
|
|
0fb143972d | ||
|
|
5c10f19d18 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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'/" \
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
17
birdnet-pipy/rootfs/etc/nginx/includes/ingress_params.conf
Normal file
17
birdnet-pipy/rootfs/etc/nginx/includes/ingress_params.conf
Normal 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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -euo pipefail
|
||||
exec nginx -g "daemon off;"
|
||||
nginx
|
||||
|
||||
Reference in New Issue
Block a user