Commit Graph

216 Commits

Author SHA1 Message Date
Twarner491 b2027fed2c Serve collage at http://birdnet.local/ (replaces stock index)
install_services.sh now symlinks five frontend files (index.html,
styles.css, apt.js, masks.json, dims.json) from avian/frontend/ into
the Caddy site root. Caddy serves index.html before index.php, so /
shows the collage and BirdNET-Pi's stock UI moves to /index.php
(still linked from the menu drawer).

API shims stay under /avian/api/. apt.js fetches them with
./avian/api/birdnet-api.php?action=X now that the frontend lives at
root instead of /avian/frontend/.

avian/index.html redirect file removed (no longer needed - / serves
the collage directly).

README + menu drawer updated to reflect / as the entry point and
/index.php as the stock-UI link.

Verified in Docker:
  /                        200 text/html (collage, 4 tiles)
  /masks.json              200 (276 KB)
  /avian/api/...           200 (all PHP shims working)
  Caddy serves index.html as default index, index.php still reachable
2026-05-28 12:07:27 -07:00
Twarner491 2ec45b9138 AvianVisitors hardening pass — install via fork's newinstaller
Restructures the install so users run ONE command. The fork's
newinstaller.sh clones this repo (instead of upstream Nachtzuster) and
runs BirdNET-Pi's installer. install_services.sh symlinks the avian/
overlay into the Caddy site root, so http://birdnet.local/avian/ comes
up after reboot with no Caddy config needed.

Reviewer-flagged fixes:

Frontend (avian/frontend/apt.js)
- Switch all API paths from /api/*.json (which didn't route) to relative
  action-based URLs (./api/birdnet-api.php?action=recent etc.).
- Fetch ./masks.json + ./dims.json relatively (were /avian/*.json).
- Replace every innerHTML user-content sink with createElement +
  textContent + setAttribute — species labels are user-editable in
  BirdNET-Pi, so untrusted.
- Add esc() helper for the few remaining innerHTML attribute contexts.
- fetchJson throws on non-200 (was silently parsing 404 HTML as JSON).
- Defensive null-check in loadMask if MASKS hasn't loaded.

Backend (avian/api/*.php)
- birdnet-api.php now derives DB_PATH from dirname(__DIR__, 3) so any
  BirdNET-Pi install user works (no hardcoded /home/birdnet).
- recording/spectrogram/cutout use getenv('HOME') for the same reason.
- cutout.php reworked as the canonical image resolver: bundled
  illustration → bundled cutout → cached rembg → fresh
  Wikipedia+rembg, with the binomial regex guard and atomic rename
  on cache write. Wikipedia URL host pinned to wikimedia.org /
  wikipedia.org to block SSRF.
- Stale 'X-BirdNET-Proxy-Token' auth claims removed everywhere.

Pregen (avian/scripts/pregen.py)
- Gemini key moved from URL query to x-goog-api-key header.
- Model bumped to gemini-2.5-flash-image-preview.
- Bounded retry on 429 + 5xx with Retry-After honoured.
- Default --sleep raised from 1s to 4s (under free-tier RPM).
- Unified parser handles |/_/comma in all three input modes.
- responseModalities now [TEXT, IMAGE] (was IMAGE-only).
- --poses validated against POSES keys.
- ASCII [ok]/[fail] markers (was ✓/✗ — Windows console crash).
- Surfaces finishReason + blockReason on safety blocks.

Prompt template
- 'Two placeholders' typo → three.
- 'warm paper' / 'transparent background' contradiction resolved.

Forwarding
- mqtt-bridge.py: paho-mqtt 2.x CallbackAPIVersion compat shim.
- avian-mqtt.service: dropped broken %i, set User=birdnet + %h path.
- forwarding/README.md uses the actual action-based URLs.

README
- One-line install via curl … newinstaller.sh.
- No more 'install BirdNET-Pi separately' step (our fork does it).
- License section uses absolute github.com links.
- bird.onethreenine.net replaces the not-yet-existent project writeup.
- docs/thumb.png replaced with the 24-bird Twitter capture.

Removed
- avian/caddy/ and avian/scripts/install.sh — no longer needed; the
  overlay symlink in install_services.sh handles everything.
2026-05-28 10:49:41 -07:00
Tim 'mithro' Ansell 779325dd8c Add php-mbstring to installed dependencies
phpSysInfo (Tools -> System Info) requires the mbstring PHP extension.
Without it, the page shows:

  checkForExtensions phpSysInfo requires the mbstring extension to php
  in order to work properly.

Fixes #531

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 09:53:38 +01:00
Alexandre b0ccfbb50c Add symlink for confirmed_species_list.txt 2025-12-20 11:31:38 +01:00
frederik 559f29c37a fixup 2025-11-10 19:32:21 +01:00
frederik 1f91f7c2b5 login trixie fix 2025-11-10 18:59:56 +01:00
dalogue1 786348d815 Automatic Update Feature (#424)
* Update advanced.php

Added a checkbox in the Advanced Settings page to enable Automatic Update

* Update install_config.sh

The AUTOMATIC_UPDATE parameter needs to be created in the BirdNET-Pi configuration file.

* Update install_services.sh

Add a cron job to the system to performa automatic updates.

* Create automatic_update.cron

The line to be added to the cron table to check for need to perform automatic update.

* Create automatic_update.sh

Script to perform the automatic update if the flag is set in the configuration.  Also, the services are restarted after the update.

* Update install_services.sh

* Update automatic_update.sh

* Update advanced.php

Correct typo

* Update update_birdnet_snippets.sh

Add the automatic_update.cron to the list of cron jobs

* Update update_birdnet_snippets.sh

* Update automatic_update.cron

Change automatic update to once a week on Sunday at 3AM

* Update update_birdnet_snippets.sh

Adjusted to add option to existing installations

* Update automatic_update.sh

Removed unnecessary call to restart_services.sh

* Update advanced.php

Cleaned up the Options section line spacing in the settings table

* Update templates/automatic_update.cron

Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com>

* Update scripts/update_birdnet_snippets.sh

Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com>

* Delete scripts/automatic_update.sh

* Update advanced.php

Modified the description of the Automatic Update feature on the Advanced Configuration tab.

* Update install_config.sh

---------

Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com>
2025-09-24 20:06:48 +02:00
cjwaian 29eb69025a Adjusting systemd unit files to avoid hardcoded UID in the runtime dir path (#461)
* Update install_services.sh

Replaced hardcoded uid

* Update install_services.sh

avoid uid in /run path

* Update install_services.sh

had to use $(id)

* Update update_birdnet_snippets.sh

Remove XDG_RUNTIME_DIR from templates

* removed XDG_RUNTIME_DIR

* update HIDE_MOUNTS runtime paths

uid agnostic

* typos
2025-09-23 18:17:22 +02:00
frederik fa1c15ceb8 install flickr_labels 2025-05-04 11:06:56 +02:00
frederik e62b991f8e cleanup: our Python dependencies all seem to have native versions these days: no dev tools needed anymore 2025-03-15 11:17:43 +01:00
frederik 57c0d5b208 enable tmp.mount: Raspberry Pi OS and Debian don't have tmpfs mounted on /tmp. So during restore every uploaded chunk would still end up on the SD card before it is un-tar-ed 2024-12-03 19:10:03 +01:00
frederik dc634838ae Revert "fix: make sure we look for the correct gotty executable name"
This reverts commit ee9aeb6d62.
2024-11-03 11:05:51 +01:00
frederik 1ec411e070 fix: make non-interactive 2024-07-13 13:38:19 +02:00
Alexandre 18693fae06 Feat : add species whitelist (#110)
* Add white_list to server.py

https://github.com/Nachtzuster/BirdNET-Pi/issues/108

* Create whitelist_list.php

* Add whitelist to views

* Make more explicit the usage

* Update views.php

* Align with uppercase

* Align with "species"

https://github.com/Nachtzuster/BirdNET-Pi/issues/108

* Update views.php

* Correct python code

https://github.com/Nachtzuster/BirdNET-Pi/issues/108

* Align clear_all_data.sh

* Align install_services.sh

* Embed whitelist_species_list in PREDICTED_SPECIES_LIST

* Only embed whitelist in predicted list

* Correct python append @dalogue1

https://github.com/Nachtzuster/BirdNET-Pi/issues/108#issuecomment-2183508903

* Update scripts/server.py

Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com>

* Use preexisting functions

Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com>

* Alert not a recommended WoW

---------

Co-authored-by: Nachtzuster <Nachtzuster@users.noreply.github.com>
2024-06-30 10:18:32 +02:00
frederik d18c98d7ce cleanup: apt depencies: only include direct dependencies, apt will resolve the rest.
remove ftp it is deprecated
2024-06-01 09:22:41 +02:00
frederik ee9aeb6d62 fix: make sure we look for the correct gotty executable name 2024-04-29 17:57:34 +02:00
frederik b820c195ca advertise http for easy discovery 2024-04-08 15:39:57 +02:00
frederik 819f390614 gotty: fix: forward compatibility with v1.5 2024-02-24 11:55:56 +01:00
frederik 5e18e0c803 fix: File Manager needs group read permissions 2024-02-17 12:41:44 +01:00
frederik a4122b5bcc write transient files to tmpfs aka ram drive 2024-02-13 18:06:57 +01:00
frederik 35db8bcb3b centralise transient files 2024-02-13 18:06:57 +01:00
frederik 44430a1727 bookwork fix: caddy need to be able to list the home dir 2024-02-13 18:06:57 +01:00
frederik c100d19da1 bookwork fix: make php version independant 2024-02-13 18:06:57 +01:00
frederik 2a68bb2e43 bookwork fix: move php to the back so we first hit php-fpm and not pull in apache2 2024-02-13 18:06:57 +01:00
frederik 823df318b6 fix: config file was missing 2024-02-13 18:06:57 +01:00
frederik c4a4cba8e2 fix: /etc/systemd/system/getty@tty1.service.d does not exist on Raspbian Bullseye 2024-02-13 18:06:57 +01:00
frederik 19e68b5f08 use inotifywait update snippets 2024-02-13 10:57:35 +01:00
frederik 0df2b55036 update snippets for obsolete services 2024-02-13 10:57:35 +01:00
frederik 87e694ec14 update snippets for birdnet_analysis.py 2024-02-13 10:57:35 +01:00
frederik d4055b63b9 update snippets for daily_plot 2024-02-13 10:57:35 +01:00
ehpersonal38 0cf2584acc Update install_services.sh 2023-06-13 20:41:11 -04:00
ehpersonal38 20b27194d5 Update install_services.sh 2023-06-13 20:38:37 -04:00
Jochen Oberreiter 41f918474b Update install_services.sh
Added net-tools to the needed packages.
2023-06-08 15:47:24 +02:00
Patrick McGuire b8e77f0dea Update install_services.sh 2022-12-15 07:54:56 -05:00
Patrick McGuire 070db9a4ff typo
Thanks @wrightrocket!
2022-10-10 14:56:28 -04:00
Patrick McGuire f383ef1343 Merge branch 'main' into weekly-report 2022-07-06 07:25:07 -04:00
mcguirepr89 49975f8f60 making icecast2 more secure by default 2022-07-05 11:44:14 -04:00
ehpersonal38 8775b3f66f disable tracking
I came across this in my console while trying to access Species Stats (Streamlit):
![KLVz7qnSXL](https://user-images.githubusercontent.com/103586016/177162889-fb3626fd-a69c-4822-b412-db0aefce7158.png)

It seems that Streamlit collects telemetry data by default. An issue was raised in their GitHub repo (https://github.com/streamlit/streamlit/issues/4747), which details how it's illegal to collect data (even just the IP address) in Europe without explicit consent due to GDPR laws. The Streamlit founder then replied basically saying the onus is on the developers implementing Streamlit to deal with this themselves.

So I propose we disable sending data entirely, this PR does that.
2022-07-04 09:43:20 -04:00
ehpersonal38 5896f00a55 Notification conf and cron setups 2022-06-28 13:04:59 -04:00
mcguirepr89 d0d11f49b2 with this address line, no need for the others 2022-06-13 15:28:18 -04:00
mcguirepr89 db04d9bd15 LAN domain, IP address, or avahi-alias install 2022-06-10 14:13:18 -04:00
mcguirepr89 7ff0c569b4 this should be better going forward 2022-06-02 09:06:00 -04:00
Patrick McGuire c54c0c7f17 Merge branch 'main' into remove-python-shebangs 2022-05-24 12:09:53 -04:00
mcguirepr89 cdbadbb45c starting this to get some help 2022-05-23 18:41:16 -04:00
Patrick McGuire 14b2b8fe13 updating caddy repo fetching 2022-05-21 11:52:22 -04:00
Jake Herbst 670d3f90ca Adding python3 virtualenv to python systemd services 2022-05-16 21:46:05 -04:00
Jake Herbst b70aeac151 Fixing bug in Caddyfile with the '/views.php?view=File*' path.
Caddyfile expects all path specific 'matchers' to begin with a '/'
https://caddyserver.com/docs/caddyfile/matchers#syntax
2022-05-15 13:10:39 -04:00
Patrick McGuire d3b779273a Update install_services.sh 2022-05-12 16:51:32 -04:00
Patrick McGuire e7689db3e7 Update install_services.sh 2022-05-12 12:23:42 -04:00
mcguirepr89 eb8fdd2d8a adjustments to the installer and updater to ensure
`lsof` is installed
2022-05-05 16:42:47 -04:00