Commit Graph

2058 Commits

Author SHA1 Message Date
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
frederik 13e44a72de fix: look for an actual json file 2026-02-28 10:50:26 +01:00
Canopy2523 c5877e6e89 change_thumbnail_size
Wikipedia errors out on thumbnails with obsolete resolutions with "Error: 429, Use thumbnail steps listed on https://w.wiki/GHai."
Indirectly fixes https://github.com/Nachtzuster/BirdNET-Pi/issues/568 and https://github.com/Nachtzuster/BirdNET-Pi/discussions/441
2026-02-28 09:54:41 +01: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
frederik 3786dfd4c4 fix typo 2025-12-20 12:14:30 +01:00
Alexandre f6752e1e16 Fix ffmpeg command by removing unused option 2025-12-20 11:31:57 +01:00
Alexandre 5fe725f251 Remove xerror 2025-12-20 11:31:57 +01:00
Alexandre 0f287d597d Update ffmpeg command to include xerror option 2025-12-20 11:31:57 +01:00
Alexandre 8b637e5640 Increase ffmpeg thread queue size in recording script 2025-12-20 11:31:57 +01:00
Alexandre 524d366023 Remove under_base function from species_tools.php
Removed the under_base function to simplify path checks.
2025-12-20 11:31:38 +01:00
Alexandre 7a17fa2574 Remove under_base check before directory deletion
Removed the check for directory under base before deletion.
2025-12-20 11:31:38 +01:00
Alexandre 24461bb679 Remove htmlspecialchars
Removed htmlspecialchars encoding for common and scientific names, and adjusted last seen display.
2025-12-20 11:31:38 +01:00
Alexandre 3465305fd6 Remove useless under_base 2025-12-20 11:31:38 +01:00
Alexandre 26d028f187 Simplify file deletion process in species_tools.php
Refactor deletion logic to count deleted files instead of iterating through them.
2025-12-20 11:31:38 +01:00
Alexandre 082d0369a1 Fix typo 2025-12-20 11:31:38 +01:00
Alexandre dba949b83d Show deletion text using common name 2025-12-20 11:31:38 +01:00
Alexandre 5ee50c089b Delete using sudo rm aligned code with play.php
Updated file and directory deletion methods to use 'exec' for sudo commands and handle errors appropriately.
2025-12-20 11:31:38 +01:00
Alexandre 2348b1e25e Revert diskcount to comname, as files are stored by comname 2025-12-20 11:31:38 +01:00
Alexandre 40bb623348 Use sci names for diskcount ajax 2025-12-20 11:31:38 +01:00
Alexandre 6ef96d1c9e FILTER_SANITIZE_STRING is deprecated in PHP 8.1+ 2025-12-20 11:31:38 +01:00
Alexandre f16114736b Load threshold with sci names 2025-12-20 11:31:38 +01:00
Alexandre b0ccfbb50c Add symlink for confirmed_species_list.txt 2025-12-20 11:31:38 +01:00
Alexandre 7a06695c80 Add confirmed species list to backup script 2025-12-20 11:31:38 +01:00
Alexandre ed92d165bd Link confirmed species list in clear_all_data.sh
Add symbolic link for confirmed species list.
2025-12-20 11:31:38 +01:00
Alexandre c9fa9ee81d Still use sci name_com name in text files 2025-12-20 11:31:38 +01:00
Alexandre 99a7f652ee Compare with sci_names and not com_names in lists 2025-12-20 11:31:38 +01:00
Alexandre efd62fcadf External generateMiniGraph function
Removed the generateMiniGraph function and its associated logic.
2025-12-20 11:31:38 +01:00
Alexandre 6f125ce303 External generateMiniGraph
Removed the generateMiniGraph function and its associated AJAX call for fetching detections. This change may affect how mini graphs are displayed on the page.
2025-12-20 11:31:38 +01:00
Alexandre ccd3e1a741 Use common generateMiniGraph 2025-12-20 11:31:38 +01:00
Alexandre 8a851923ad Change queries to use Sci_Name instead of Com_Name 2025-12-20 11:31:38 +01:00
Alexandre aa6d1016f6 Fix apostrophes 2025-12-20 11:31:38 +01:00
Alexandre 1ce9f4caa9 Remove db modif 2025-12-20 11:31:38 +01:00
Alexandre 89c49d5d2f Add link to info pages 2025-12-20 11:31:38 +01:00
Alexandre 47b39aa098 Rename 'Identifications' header to 'Count' 2025-12-20 11:31:38 +01:00
Alexandre 013bcf1c24 Add options for 720 and 1080 days in selector 2025-12-20 11:31:38 +01:00
Alexandre d6b853b4eb Add improved mini charts 2025-12-20 11:31:38 +01:00
Alexandre 4a0ff5a095 Lazy load local files and threshold 2025-12-20 11:31:38 +01:00
Alexandre 5ce5547ffc Clarify what is deleted 2025-12-20 11:31:38 +01:00
Alexandre b8562c6904 Add search, max confidence 2025-12-20 11:31:38 +01:00
Alexandre fb59d34873 Open db in write only if needed 2025-12-20 11:31:38 +01:00
Alexandre 97fa0c5e11 Enhance species management with confirmed list 2025-12-20 11:31:38 +01:00
Alexandre 2169bc4975 Add species_tools.php for species management 2025-12-20 11:31:38 +01:00
frederik 3b8af7f868 fix: Chinese has two variants now 2025-12-14 10:04:51 +01:00
frederik 8e5e2a2696 fix: stray comma breaks sending notifications 2025-12-06 13:43:41 +01:00
hestonhamilton efe382e0b0 Fix extra whitespace in notification listenurl 2025-12-03 21:24:03 +01:00
frederik 2a79f1fa65 we previously merged both BirdNET label files, not realising one had traditional and the other simplified Chinese, so split properly and have both Chinese variants now. 2025-11-29 16:57:13 +01:00
frederik 466c91fdc0 work around flake8 bug?? 2025-11-22 19:32:23 +01:00
frederik f210fb1f74 add translation tools to maintainer.py 2025-11-22 19:20:41 +01:00
frederik d6e975b344 add vietnamese 2025-11-22 19:04:53 +01:00
frederik 8d08e17770 cleanup filter_humans a bit 2025-11-22 18:35:55 +01:00