Commit Graph

58 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 6d5b18e959 the php code no longer needs uid==1000 2025-03-15 11:17:43 +01:00
frederik 1271ea0e2d Bullseye is deprecated 2025-03-15 11:17:43 +01:00
frederik e3b8cd134a allow x86_64 for development purposes 2024-03-09 13:31:36 +01:00
frederik bff4c3f377 try to avoid broken installs 2024-02-24 12:01:07 +01:00
frederik 054f41ec37 point to this repo 2024-02-13 18:06:57 +01:00
coldclimate c5938e5d7f Kick out super early if it's not a suitable system
Untested, but raised after a frustrating morning :D
2023-04-09 14:10:35 +01:00
Adam Leskis 7edd29f739 Clone shallow on installation
Just clone a single commit, which will be faster and save space/bandwidth.
2022-09-01 19:55:34 +01:00
ehpersonal38 0f68b676c6 Please run as a non-root user 2022-06-10 18:51:55 -04:00
Hugh Brown (Saint Aardvark the Carpeted) 085466b35c Use jq for processing JSON when figuring out latitude/longitude
Signed-off-by: Hugh Brown (Saint Aardvark the Carpeted) <aardvark@saintaardvarkthecarpeted.com>
2022-05-01 10:57:44 -07:00
Patrick McGuire cc66a8aff3 Update newinstaller.sh 2022-04-12 14:01:33 -04:00
mcguirepr89 c20d1ace9b ugh 2022-04-11 11:30:24 -04:00
mcguirepr89 2214319e03 adjustments 2022-04-11 10:49:16 -04:00
Patrick McGuire 3c4c0a9d2c Update newinstaller.sh 2022-04-11 10:40:10 -04:00
Patrick McGuire d4f247a1d3 Update newinstaller.sh 2022-04-11 10:28:35 -04:00
Patrick McGuire a8e67410df Update newinstaller.sh 2022-04-11 10:24:44 -04:00
mcguirepr89 023b68f386 making changes to accomodate removing the pi user 2022-04-11 10:16:54 -04:00
mcguirepr89 baabb4240c preparing for pull to main 2022-04-02 13:05:01 -04:00
Patrick McGuire 4c75591315 Update newinstaller.sh 2022-03-03 11:15:10 -05:00
Patrick McGuire 806f1b5f45 Update newinstaller.sh 2022-02-18 15:32:44 -05:00
Patrick McGuire 0913dc3e21 Update newinstaller.sh 2022-02-18 15:04:04 -05:00
Patrick McGuire 7c1e22eced Update newinstaller.sh 2022-02-18 15:01:23 -05:00
Patrick McGuire 84fb3ebc62 Update newinstaller.sh 2022-02-18 15:00:22 -05:00
Patrick McGuire 58ce0ac262 Update newinstaller.sh 2022-02-18 14:56:02 -05:00
Patrick McGuire ce02b13af4 Update newinstaller.sh 2022-02-18 14:55:27 -05:00
Patrick McGuire e7db0e1789 Update newinstaller.sh 2022-02-18 14:53:52 -05:00
Patrick McGuire 93c658cb6e Update newinstaller.sh 2022-02-18 14:52:36 -05:00
Patrick McGuire cfef74be7a Update newinstaller.sh 2022-02-18 14:51:10 -05:00
mcguirepr89 ebe39de283 new logging 2022-02-18 14:33:53 -05:00
Patrick McGuire f62d39d877 Update newinstaller.sh 2022-02-18 14:20:35 -05:00
Patrick McGuire e2acc020f1 Update newinstaller.sh 2022-02-18 14:13:10 -05:00
Patrick McGuire a7351d6302 Update newinstaller.sh 2022-02-17 16:54:42 -05:00
Patrick McGuire f0f1a149fb Update newinstaller.sh 2022-02-14 13:59:35 -05:00
Patrick McGuire bb0411f11e Update newinstaller.sh 2022-02-14 13:59:23 -05:00
Patrick McGuire 2fd2bdecec Update newinstaller.sh 2022-02-10 12:43:58 -05:00
Patrick McGuire da11a26349 Update newinstaller.sh 2022-02-10 12:42:09 -05:00
mcguirepr89 3894487a83 adding forms back to newinstaller for more tseting 2022-02-10 11:31:28 -05:00
mcguirepr89 4c218ef8a7 preparing a pull to main 2022-02-08 20:55:50 -05:00
Patrick McGuire 6c668d6982 Update newinstaller.sh 2022-02-02 14:07:57 -05:00
Patrick McGuire 8a39af4a72 Update newinstaller.sh 2022-01-24 18:57:20 -05:00
mcguirepr89 e88e5df870 preparing for merge 2022-01-24 16:10:07 -05:00
Patrick McGuire 67fd5d11c5 Update newinstaller.sh 2022-01-22 16:23:41 -05:00
mcguirepr89 80edfdcd05 trying a new installer (HA) 2022-01-22 16:12:39 -05:00
mcguirepr89 69109784aa preparing branch for testing 2022-01-20 15:33:21 -05:00
Patrick McGuire ca2f444ba0 Update newinstaller.sh 2021-12-12 15:31:32 -05:00
Patrick McGuire 79b27175f0 Update newinstaller.sh 2021-12-12 15:14:12 -05:00
Patrick McGuire accf68ddea Update newinstaller.sh 2021-12-12 15:10:20 -05:00
Patrick McGuire 399df58486 Update newinstaller.sh 2021-12-12 15:09:22 -05:00
Patrick McGuire 4fae5e544c Update newinstaller.sh 2021-12-12 15:08:22 -05:00
Patrick McGuire d381e65787 Update newinstaller.sh 2021-12-12 15:07:27 -05:00