freenas-proxmox/perl5
Kevin Adams 43a8efd125 Fix TrueNAS 25.04 compatibility: handle 404 on v1.0 API endpoint
TrueNAS 25.04 removed the v1.0 REST API entirely. Previously it redirected
(302) to v2.0; now it returns 404. The plugin treated 404 as a fatal
connection failure, preventing any operation on 25.04 hosts.

Fix: extend the v1.0→v2.0 upgrade condition in freenas_api_connect to also
trigger on HTTP 404, but only while probing the v1.0 endpoint (guarded by
`$apiping =~ /v1\.0/`). A 404 on the v2.0 endpoint still fails cleanly.

Also add a syslog warn when Bearer Token auth is attempted over plain HTTP:
TrueNAS 25.04+ revokes API keys sent without SSL, causing auth failures that
are otherwise invisible in the plugin log. The warning points admins to the
"Use SSL" storage config option.

Closes #205

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 22:51:32 -04:00
..
PVE/Storage Fix TrueNAS 25.04 compatibility: handle 404 on v1.0 API endpoint 2026-05-15 22:51:32 -04:00
REST Update comments/doc of the methods changes 2020-07-14 17:32:53 -04:00