Commit Graph

2063 Commits

Author SHA1 Message Date
Twarner491 038b17c6c1 [PROD] refined php int 2026-05-28 15:39:58 -07:00
Twarner491 87981a62fb [PROD] 2026-05-28 15:15:22 -07:00
Twarner491 37b7c9e6a7 fix(caddy): override php_fastcgi try_files to prefer index.html 2026-05-28 14:31:30 -07:00
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 d3241f92cf Pre-share fixes from final review pass
Blockers
- http://birdnet.local/avian/ now serves the collage (added avian/index.html
  redirect to frontend/; previously the symlink target had no top-level
  index, so users saw a directory listing of api/ assets/ forwarding/
  frontend/ scripts/).
- Gemini model bumped from gemini-2.5-flash-image-preview (deprecated
  2026-01-15) to the stable gemini-2.5-flash-image. Pregen was non-
  functional out of the box.
- avian-mqtt.service: dropped %h (which expands to /root for system-mode
  units regardless of User=). Use WorkingDirectory=~ which DOES respect
  User=, plus a relative ExecStart.
- birdnet-api.php case 'lifelist' now aliases COUNT(*) AS n (was 'total'),
  matching what apt.js reads for atlas card counts. Atlas previously
  always displayed 0.

Bugs
- Retry-After parsing handles HTTP-date format without crashing.
- apt.js no longer fetches firstseen/timeseries (declared in state but
  never consumed). Two wasted round-trips per page load removed.
- update_birdnet.sh defaults branch=avian-visitors so the (opt-in)
  Sunday auto-update cron doesn't reset HEAD to upstream main and
  delete the avian/ overlay.
- recording.php: removed dead $BIRDS_JSON_CANDIDATES.

Polish
- Pregen --sleep default raised 4→6s (more headroom under free-tier RPM).
- en-dash in README BOM (~$35–80) replaced with hyphen for style match.
- Slop sweep across user-facing docs: no em-dashes, no en-dashes, no
  AI-slop word hits (robust/comprehensive/seamless/etc.).
2026-05-28 11:11:20 -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
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