Commit Graph

167 Commits

Author SHA1 Message Date
Kevin Adams f18003651f Fix perlcritic: move \$VERSION after use strict/warnings
RequireUseStrict and RequireUseWarnings require that strict and warnings
are the first statements after the package declaration. Move our \$VERSION
to after the two use pragmas.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 00:16:34 -04:00
Kevin Adams 7fa3ff9c91 Add \$VERSION to FreeNAS.pm; use it as authoritative version in CI
our \$VERSION = '2.3.0' is now the single source of truth for the release
series. The build.yml extracts it with a perl one-liner (no module load,
no stubs needed) and uses it as BASE_VERSION for alpha/beta channel builds.

Git tags remain the release trigger: pushing an exact vX.Y.Z tag publishes
to the stable Cloudsmith channel. A mismatch warning fires if the tag
version and \$VERSION disagree, catching forgotten version bumps.

The v2.3.0-pre anchor tag approach is superseded by this; the anchor tag
can stay in history as a breadcrumb but \$VERSION is now what drives builds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 00:13:28 -04:00
Kevin Adams ccdc7a43f6 Fix version numbering: anchor tags set series without triggering release
Two changes:
1. BASE_VERSION now strips pre-release suffixes from the nearest ancestor tag
   (e.g. v2.3.0-pre → 2.3.0), so anchor tags like v2.3.0-pre make feature
   branch builds say 2.3.0-alpha+<sha> without "pre" leaking into the version.

2. Stable release detection changed from glob (refs/tags/v*) to an exact
   semver regex (^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$). Tags with a suffix
   (v2.3.0-pre, v2.3.0-rc1) build and validate but do not publish to Cloudsmith
   stable — they fall through to the 'none' channel.

This lets us place a v2.3.0-pre anchor tag to version the development series
correctly, then later push v2.3.0 as the actual stable release.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 23:59:26 -04:00
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
Kevin Adams 13217640ab Harden: replace stringy eval with explicit dispatch hash
freenas_iscsi_create_extent and freenas_iscsi_create_target_to_extent
both used `eval $value` to expand template variable names like '$name'
into their runtime values. Replace with a local %vars hash and an
`exists` lookup — same behavior, no stringy eval, no perlcritic warning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 22:21:56 -04:00
Kevin Adams ac58bf75de Fix DEBIAN control.j2: use binary-only format for dpkg-deb
dpkg-deb --build reads a binary control file and rejects the two-stanza
source+binary format. Rewrote control.j2 as a single binary-only stanza.
Removed the source stanza (Source, Standards-Version, Build-Depends fields)
which are only meaningful in source packages built with dpkg-buildpackage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:16:20 -04:00
Kevin Adams 0606ffb1a4 Fix shellcheck SC2034: remove unused REST_CLIENT_PATH variable in postrm
REST_CLIENT_PATH was defined but never referenced. REST/Client.pm is owned
by librest-client-perl and is intentionally not removed by our postrm
(documented in the comment above remove_plugin_files). Remove the dead variable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:10:45 -04:00
Kevin Adams 2430048a3d Fix perlcritic: replace 'return undef' with 'return'
ProhibitExplicitReturnUndef (severity 5): returning undef explicitly is
wrong because it forces scalar context on callers. 'return;' returns
undef in scalar context and an empty list in list context, which is the
correct idiom. Fixed all 7 occurrences in FreeNAS.pm.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:08:54 -04:00
Kevin Adams 84cc862bed Fix CI: install Perl deps and stub PVE::SafeSyslog for syntax check
perl -c requires all modules to be loadable at compile time. PVE::SafeSyslog
only exists on Proxmox VE hosts, so the syntax check always failed on
GitHub Actions runners. Fix:
- Install real Perl deps via apt (libwww-perl, libio-socket-ssl-perl,
  librest-client-perl, libjson-perl)
- Create a minimal stub for PVE::SafeSyslog so perl -c can load FreeNAS.pm
- Pass -I/tmp/pve-stub to perl -c so the stub is found

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:05:52 -04:00
Kevin Adams ce84a857c4 Fix YAML syntax: quote step names containing colons
Unquoted YAML plain scalars cannot contain ': ' (colon-space) because
the parser interprets it as a nested key-value mapping. The two step
names 'Dry-run patch: ZFSPlugin (PVE 8)' and 'Dry-run patch: apidoc.js
(PVE 8)' triggered this, causing GitHub Actions to reject the workflow
file before any jobs ran.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:02:08 -04:00
Kevin Adams ba238eb7d6 Fix CI workflow file issues causing no-jobs-run failure
Two bugs that prevented any jobs from running:

1. action.yml contained only YAML comments (no 'on:' or 'jobs:' keys),
   making it an invalid workflow file. GitHub rejected it at parse time.
   Fixed by giving it a minimal valid structure with workflow_dispatch
   trigger only, so it never fires automatically.

2. build.yml perlcritic step referenced perl5/PVE/Storage/Custom/FreeNAS.pm
   which is not committed to the repository, causing a step failure.
   Removed — only FreeNAS.pm (LunCmd) is linted for now.

3. build.yml publish job used 'if: |' block scalar for a multi-line
   expression, which GitHub Actions rejects in expression position.
   Changed to a single inline expression string.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 14:52:17 -04:00
Kevin Adams 636cd06ff6 Phase 1 project revival + PR fixes (#207, #209, #213)
Project infrastructure:
- Replace MIT license with AGPL-3.0 (KSA Technologies, LLC)
- Full README rewrite with badges, compatibility table, token auth docs
- Add CHANGELOG, CONTRIBUTING, DONORS, SECURITY docs
- Add GitHub issue/PR templates, update FUNDING.yml and stale.yml
- Replace external packer repo dispatch with self-contained CI (build.yml)
- Add packaging/DEBIAN/ with postinst/postrm/triggers (no git clone at install)
- Add .perlcriticrc for static analysis
- Add .claude/cos/ ADRs, plans, and runbooks

Bug fixes from community PRs:
- Fix bearer token check in freenas_api_connect: defined() && value instead of
  defined() alone, so truenas_token_auth=0 no longer activates Bearer Token auth (#207)
- Fix LUN 0 falsy bug in ZFSPlugin patch: !$guid -> !defined $guid in both
  zfs_get_lun_number and zfs_get_wwid_number, fixing VMs on LUN 0 for PVE 9 (#209)
- Fix syslog typo "wtih" -> "with" in run_list_extent (#213)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 14:22:04 -04:00
Kevin Scott Adams ebc461a519 Updated README.md
- Updated README.md to announce the Bearer Token Authentication feature.
2024-01-07 09:43:56 -05:00
Kevin Scott Adams 817433a393 Clean up code.
- Indent and whitespace cleanup.
2024-01-06 17:34:17 -05:00
Kevin Scott Adams b9dd1d6f89 Update for Proxmox 8 and Bearer Token
- Patch updates for Proxmox VE 8
- Update to select Basic or Bearer authentication.
2024-01-06 13:43:35 -05:00
Kevin Scott Adams 466d819a89
Merge pull request #160 from TheGrandWazoo/master
Merge to feature_bearer_token
2023-08-19 10:53:01 -04:00
Kevin Scott Adams ea3637d29a
Update README.md
- Update README.md to be more structured and selective from a visitors view.
- Update the Roadmap section.
- Update the Donators list.
- Update the New Install Instructions section to allow the visitor to select the GPG location they want to use.
- Update the Activity section.
- Fix spelling errors.
2023-08-19 10:46:39 -04:00
Kevin Scott Adams b6e34be5e5
Update README.md for typo
- Fixed testing repo name in install section.
2023-08-16 09:05:06 -04:00
Kevin Scott Adams ca48a9e517
Update README.md for new repos
- Updated anchor.
- Added documentation to roadmap.
2023-08-16 09:03:20 -04:00
Kevin Scott Adams 871c720026
Merge pull request #157 from TheGrandWazoo/TheGrandWazoo-readme-patch-2
Update README.md
2023-08-16 08:54:47 -04:00
Kevin Scott Adams 65c1c250df
Update README.md
- Change announcement for the Cloudsmith repos.
- Changed the New Install section to include instructions for stable and development repos.
2023-08-16 08:54:15 -04:00
Kevin Scott Adams 80c5eda63a
Merge pull request #155 from TheGrandWazoo/TheGrandWazoo-patch-1
Update README.md
2023-08-09 13:07:11 -04:00
Kevin Scott Adams 3977be6daa
Update README.md
Changed Attention description to notify that a new repo is on the horizon.
2023-08-09 13:02:43 -04:00
Kevin Scott Adams a86bf3eb95
Update README.md
Update README.md

- Added ATTENTION due to JFrog canceling my subscription.
2023-07-13 09:09:22 -04:00
Kevin Scott Adams 0997a68048 Import Proxmox stock PVE Manager Lib.
- Imported the stock Proxmox pvemanagerlib.js from Proxmox 7.4-3.
2023-06-12 17:19:16 -04:00
Kevin Scott Adams d507706996 Remove previous commmit.
- Forgot to change branches.
2023-06-12 17:17:56 -04:00
Kevin Scott Adams 9de5aaf81b Import stock pvemanagerlib.js.
- Imported stock pvemanagerlib.js from Proxmox 7.4-3 to develop and
create patches against.
2023-06-12 17:16:29 -04:00
Kevin Scott Adams dc5a5c2be9
Merge pull request #130 from TheGrandWazoo/revert-129-2.0
Revert "2.0"
2023-02-20 13:24:48 -05:00
Kevin Scott Adams c1f453e15c
Revert "2.0" 2023-02-20 13:24:07 -05:00
Kevin Scott Adams 6141b6c784
Merge pull request #129 from TheGrandWazoo/2.0
2.0
2023-02-20 13:07:21 -05:00
Kevin Scott Adams b05124592f Update README.md
- Updated Roadmap and Updates.
- Removed Attention
- Added a note about systemctl restart pvescheduler.service before
2.2.0-0-beta8.
2023-02-12 17:14:15 -05:00
Kevin Scott Adams 9021ec22b7 Fix recursion error.
- When SSL redirect is enabled on TrueNAS and a change from V1 to V2
api's needs to happen then we overrun the limit of 1 on the recursion
loop. Set it to 2.
- Added some logging for TrueNAS-Scale conversion from slash (/) to dash
(-).
2022-06-05 18:57:52 -04:00
Kevin Scott Adams d2f5c2b27f Update readme.MD.
- Updated new repo install.
- Updated Roadmap.
- Cleanup old information.
- Updated Donation list.
- Changed FreeNAS to TrueNAS in most of the instructions.
2022-06-04 09:58:34 -04:00
Kevin Scott Adams a2e395658d
Update README.md 2022-05-31 16:58:53 -04:00
Kevin Scott Adams 4039df8a59
Update README.md 2022-05-31 16:56:05 -04:00
Kevin Scott Adams aea45c992f
Update README.md 2022-05-25 21:46:55 -04:00
Kevin Scott Adams 2e9d736ebd
Update README.md 2022-05-25 21:45:15 -04:00
Kevin Scott Adams 7ecd64f79a
Update README.md 2022-05-25 21:34:58 -04:00
Kevin Scott Adams 0b760eefc3 Fix TrueNAS-Scale slash replacement.
- When changing from slashes (/) to dashes (-), I did not provide the
global parameter so a Storage/Tank/Disks would turn out to be
Storage-Tank/Disks causing a iSCSI: Failed to connect to LUN :
iscsi_service failed with : iscsi_service_reconnect_if_loggedin. Can not
reconnect right now.
2022-05-21 15:19:46 -04:00
Kevin Scott Adams c3b6f38c61 Fix TrueNAS-Scale parsing.
- TrueNAS-Scale returns 'application/json' so we need to catch that also
on the return code of 200 from a version API call.
2022-05-21 14:21:05 -04:00
Kevin Scott Adams dc3c724d45 Merge branch 'master' of https://github.com/TheGrandWazoo/freenas-proxmox.git 2022-05-20 12:40:08 -04:00
Kevin Scott Adams 75f63b56d1 Update plugin for TrueNAS 13
- Created conditional to parse new TrueNAS 13 version.
- Created conditional to check for a 200 and that the Content-Type is
text/html so it will change to v2.0 of the API's. This is new behavior
in TrueNAS-Core 13.
2022-05-20 12:39:55 -04:00
Kevin Scott Adams 50a474bea1
Update README.md
Updated Donators - Thank you again.
Updated messages of repo and development status.
2022-05-20 10:02:17 -04:00
Kevin Scott Adams bfb1962503
Update README.md 2022-05-11 15:45:14 -04:00
Kevin Scott Adams 85a67077b2 Optimize methods.
- Instead of using foreach loops to iterate through an array change to
using a hash which the key is the value we are looking for.
2022-04-13 16:29:24 -04:00
Kevin Scott Adams 4663fca8b0 Trigger a build.
- Just touch the README.md to trigger.
2022-04-03 13:25:58 -04:00
Kevin Scott Adams e4c9f12f03 Update README.md
- Trigger a build.
2022-04-03 11:10:13 -04:00
Kevin Scott Adams 8da7d98538 Update README.md
- Need to trigger a build.
2022-04-03 11:03:29 -04:00
Kevin Scott Adams 7976b1cfe8 Update README.md
- Possible outage due to lack of fundings.
2022-04-03 10:51:11 -04:00
Kevin Scott Adams 780c6590fe Update patches and some fixes.
- Add the true path to the debug statement when comparing targets.
- Add patch set for ZFSPlugin.pm for Storage lib 7.1-1
- Add patch set for pvemanagerlib.js for pve-manager version 7.1-11
- Add patch set for apidoc.js for pve-docs version 7.1-2.
- Create stable-7 directory for future installs based on Proxmox major
version each modules version.
2022-04-03 09:18:31 -04:00