feat ✨: NAG checksum-based detection (auto-repatch after upgrades) #1
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Updated the task to utilize
ansible.builtin.slurpinstead of the deprecatedslurpmodule for improved compatibility with newer Ansible versions.Review Summary
proxmoxlib.jsand minifiedproxmoxlib.min.jsfiles, and updates the subscription task to use these stored checksums when necessary. The changes improve maintainability, security, and performance. LGTM (with the noted improvements in logic, security, performance, and maintainability)@@ -2,0 +15,4 @@src: /var/lib/proxmox-nag-patch/proxmoxlib.js.sha256register: proxmoxlib_js_checksum_storedwhen: proxmoxlib_js.stat.existsfailed_when: false[Lines 13-18] [Score: 2] The script is now reading the stored checksum for the legacy
proxmoxlib.jsfile, which ensures that any updates to the checksum are tracked and makes it easier to verify the integrity of the file.@@ -13,3 +35,4 @@!= (proxmoxlib_js_checksum_stored.content | b64decode | trim))register: patch_legacyfailed_when:- proxmoxlib_js.stat.exists[Lines 27-38] [Score: 2] The script now checks for and handles the presence of
proxmoxlib.min.js, which is used in newer versions of Proxmox VE (VE 8/9). This ensures compatibility with different versions of the software.@@ -19,0 +50,4 @@- proxmoxlib_js.stat.exists- patch_legacy is changed############################[Lines 42-53] [Score: 2] The script now stores patched checksums for both the legacy and minified files, which ensures that any updates to the checksums are tracked and makes it easier to verify the integrity of the files. This improves security and maintainability.
@@ -35,0 +92,4 @@content: "{{ proxmoxlib_min_js.stat.checksum }}\n"when:- proxmoxlib_min_js.stat.exists- patch_minified is changed[Lines 31-95] [Score: 3] The
whenandfailed_whenconditions have been modified to properly handle the presence of both the legacy and minified files, as well as the stored checksums. This improves maintainability by keeping the conditions concise and easier to understand. However, it could be argued that the conditions are now more complex than before.refactor ♻️: Refactor task to use ansible.builtin.slurp for compatibilityto feat ✨: NAG checksum-based detection (auto-repatch after upgrades)