Skip to content

Feature/os 261 add support in monitor to create output for panel backport#2653

Closed
SimonFair wants to merge 44 commits into
unraid:masterfrom
SimonFair:feature/os-261-add-support-in-monitor-to-create-output-for-panel_backport
Closed

Feature/os 261 add support in monitor to create output for panel backport#2653
SimonFair wants to merge 44 commits into
unraid:masterfrom
SimonFair:feature/os-261-add-support-in-monitor-to-create-output-for-panel_backport

Conversation

@SimonFair
Copy link
Copy Markdown
Contributor

@SimonFair SimonFair commented May 28, 2026

Summary by CodeRabbit

  • New Features

    • Added EULA viewer for license file display.
    • Enhanced system monitoring with temperature and health event tracking.
  • Bug Fixes

    • Fixed Docker container dropdown UI layering issue.
    • Improved VM countdown message rendering.
  • Security

    • Enhanced request authorization with stricter path validation.
    • Improved file upload safety and command handling.
  • Documentation

    • Updated README with Unraid OS information.
  • Chores

    • Improved language pack installation and removal robustness.

Review Change Stack

SimonFair and others added 30 commits December 8, 2025 19:29
Backport ReadMe not populating in templates
…dnsconfd

backport: fix: disable rc.avahidnsconfd by default
…o-diagnostics

backport: feat: add lsusb details to diagnostics
…-7.2

fix: persist rclone config via rc.local with hardened init script
…-peer

Fix rc.sshd: auto-restart SSH daemon after network recovery
…lone-configs-7.2

Revert "fix: persist rclone config via rc.local with hardened init script"
- Purpose: backport the Docker ghost/dead container filtering change to the 7.2 release branch.

- Before: stale dead Docker entries could be included in the WebGUI container list and inspect failures could leak bad rows into the UI.

- Problem: Docker shutdown races can leave orphaned metadata that users cannot act on, which makes the Docker page show ghost containers.

- Change: skip invalid, dead, and uninspectable container entries while preserving normal container listing behavior.

- How: validate each container record before inspect, skip dead state/status rows, skip failed inspect payloads, and fall back to the list name when inspect omits Name.
- Purpose: backport the no-pool mover empty fix to the 7.2 branch.\n- Before: the UI disabled or hid mover controls when no cache/pool devices existed, even though the empty-array-disk action can still run without a pool assignment.\n- Why: users could not invoke mover to empty an array disk on systems with no configured pool.\n- What: keep mover controls available for the empty action when user shares are enabled and no pool devices exist.\n- How: update the scheduler button text/state and add matching Array Operation button handling for no-pool systems while preserving disabled states during parity, mover, and BTRFS operations.\n- Source: cherry-picked from fd5251a.
- Purpose: backport PR unraid#2600 to the 7.2 branch so Docker template changes clear old Tailscale Serve and Funnel exposure.\n- Before: switching a container from Funnel or Serve to No removed the env vars but left the persisted Tailscale serve/funnel config active after restart.\n- Why: the container hook only applied new serve settings when TAILSCALE_SERVE_PORT was present and never reset existing serve state stored in the Tailscale state directory.\n- What: reset both tailscale funnel and tailscale serve state after tailscale comes online, then reapply the current template-managed mode when configured.\n- How: add explicit reset commands before the Serve/Funnel capability check and before issuing any new serve or funnel command.\n- Source: cherry-picked from b90ca2f.
…ost-containers

fix(docker): filter ghost containers from WebGUI
fix: allow mover empty action without pools on 7.2
…-reset

fix: reset Tailscale Funnel state on 7.2 restarts
- Purpose: backport the Docker network reconnect helper work required by the fixed MAC assignment flow.
- Before: 7.2 rebuilt custom Docker networks with inline reconnect logic that did not preserve all endpoint details consistently.
- Problem: the later fixed MAC assignment fix depends on the helper path that restores primary and secondary network attachments predictably.
- Change: introduce the network restore helper flow from master before applying the MAC endpoint assignment fix.
- Implementation: collect restore entries with network, container, IP, and MAC data, reconnect them through a shared helper, and rebuild primary custom-network containers only when needed.
- Purpose: backport the Docker fixed MAC assignment fix from master to 7.2.
- Before: fixed MACs were handled through legacy container-level extra parameters or were lost during network reconnects.
- Problem: Docker endpoint MAC assignment needs to happen on the selected network endpoint so bridge and custom networks keep the intended address.
- Change: add a fixed MAC template field, normalize and migrate legacy extra parameters, and restore MACs during Docker network reconnects.
- Implementation: store MyMAC in templates, build endpoint-aware --network arguments for container creation, and use Docker network connect API calls when restoring fixed MAC endpoints.
- Purpose: backport the Docker MAC address display fix from master to 7.2.

- Before: the Docker container list only showed IP details, so assigned MAC addresses were not visible in the UI.

- Problem: users could not confirm fixed or runtime MAC assignments from the container list.

- Change: include MAC address data from Docker inspect output and render it with the container IP details.

- Implementation: pass endpoint MAC addresses through DockerClient and DockerContainers, then hide empty values for stopped containers.
limetech and others added 14 commits April 24, 2026 12:06
…nment

[7.2] Fix Docker fixed MAC assignment
- Purpose: keep Docker custom networks on VLAN and secondary interfaces from losing their configured gateway during automatic network recreation.

- Before: rc.docker only read the gateway from a default route on the interface, so VLANs without an interface-specific default route created Docker networks without --gateway.

- Why that was a problem: Docker could claim the first subnet address as the macvlan/ipvlan gateway, colliding with real VLAN gateways such as 192.168.10.1 and breaking DHCP or static-IP containers.

- What the new change accomplishes: automatic Docker network creation now falls back to the configured IPv4 or IPv6 gateway stored in network.ini when no live default route exists.

- How it works: configured_gateway maps br/bond network names back to their eth network.ini section, resolves VLAN IDs to their indexed entries, and returns the matching GATEWAY or GATEWAY6 value before network create arguments are assembled.

(cherry picked from commit d56c259)
Purpose:
- Backport the Discord notification newline normalization from 7.3 to 7.2.
- Keep Pujit Mehrotra credited as the original author of the fix.

Before:
- Discord status report payloads kept literal \n, \r\n, and \r sequences in DESCRIPTION and CONTENT values.

Why that was a problem:
- Multi-line Discord reports rendered escaped newline text instead of real line breaks.

What the new change accomplishes:
- Converts literal newline escape sequences before the Discord payload is generated.
- Adds a regression test that verifies generated Discord field text contains real line breaks.

How it works:
- Normalizes DESCRIPTION and CONTENT shell variables before link handling and payload construction.
- Extracts the Discord agent CDATA into a temporary script and stubs curl/date for deterministic test assertions.

Original PR: unraid#2527

(cherry picked from commit 309ae17)
Fixes clicking on a docker container when page has many containers the dropdown menu will be behind the footer and even outside the visible area because the scrollbar doesnt extend as far.
…way-fallback

fix: Backport Docker VLAN gateway fallback to 7.2
fix: normalize discord agent newlines on 7.2
…r-dropdown-7.2

fix: [ENG-424] Backport Docker dropdown spacer fix to 7.2
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 69eadcb5-06fd-4eb6-93fe-7417cbf7b287

📥 Commits

Reviewing files that changed from the base of the PR and between 982b3c2 and 6b01726.

⛔ Files ignored due to path filters (3)
  • emhttp/plugins/unRAIDServer/icons/eula.png is excluded by !**/*.png
  • emhttp/plugins/unRAIDServer/icons/license.png is excluded by !**/*.png
  • emhttp/plugins/unRAIDServer/images/unRAIDServer.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • emhttp/auth-request.php
  • emhttp/plugins/dynamix.docker.manager/javascript/docker.js
  • emhttp/plugins/dynamix.plugin.manager/scripts/language
  • emhttp/plugins/dynamix.vm.manager/VMMachines.page
  • emhttp/plugins/dynamix/include/FileUpload.php
  • emhttp/plugins/dynamix/include/ToggleState.php
  • emhttp/plugins/dynamix/scripts/monitor
  • emhttp/plugins/unRAIDServer/EULA.page
  • emhttp/plugins/unRAIDServer/README.md
  • emhttp/plugins/unRAIDServer/unRAIDServer.plg
  • etc/rc.d/rc.docker

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

This PR consolidates security hardening, new monitoring infrastructure, and the unRAIDServer plugin framework. It refactors authorization and file operations to use canonical paths and validated inputs, adds panelcontrol event payload generation, implements a comprehensive plugin install/remove procedure with version compatibility checks, and includes supporting features like EULA rendering and Docker network gateway fallback.

Changes

Security hardening, panelcontrol monitoring, and unRAIDServer plugin framework

Layer / File(s) Summary
Request path canonicalization and authorization
emhttp/auth-request.php
Auth logic now resolves request URIs to canonical filesystem paths via realpath, verifies containment within trusted docroot, detects unraid-components requests, and validates allowed public assets via strict mapping-based whitelist instead of inlined checks. Removed JSCache.php inclusion.
File operations safety and validation helpers
emhttp/plugins/dynamix/include/FileUpload.php, emhttp/plugins/dynamix.plugin.manager/scripts/language
Introduces recursive remove_tree() and valid_language_pack_name() helpers; refactors file save/delete to validate filenames against whitelists and resolve paths via realpath + safe-base prefix checks; replaces shell-based unzip in language pack install with PHP ZipArchive filtering and error-aware cleanup.
Shell command escaping hardening
emhttp/plugins/dynamix/include/ToggleState.php
Updates emcmd() to use escapeshellarg() for safer shell argument passing instead of unquoted interpolation.
VM countdown message HTML injection prevention
emhttp/plugins/dynamix.vm.manager/VMMachines.page
Builds countdown message as DOM nodes with jQuery, embedding message text via json_encode() instead of raw HTML interpolation to prevent injection.
Panelcontrol monitoring payload generation and persistence
emhttp/plugins/dynamix/scripts/monitor
Generates structured panelcontrol events (temperature thresholds, storage health, errors) with severity ranking; builds schema-conforming payload with per-target highest-severity states and summary counts; persists JSON output via temp-file write with change detection.
unRAIDServer plugin installation and removal framework
emhttp/plugins/unRAIDServer/unRAIDServer.plg
Defines complete plugin manifest with multi-stage install (unRAID-5 compatibility, ReiserFS blocking, CPU verification, network wait, infozip handling, artifact verification, Unraid Connect API checking) and post-install configuration adjustments (wireguard migration, SSL bundles, bootloader/cron/share configs, legacy artifact cleanup); implements removal with previous-release restoration.
Docker network gateway fallback configuration
etc/rc.d/rc.docker
Adds configured_gateway() helper to read network.cfg and derive gateway values for specified interfaces and VLAN segments; provides fallback gateway assignment in docker_network_start when ip route discovery returns empty for IPv4 and IPv6.
Docker container dropdown UI layering
emhttp/plugins/dynamix.docker.manager/javascript/docker.js
Adjusts container dropdown stacking by setting high z-index on dropdown element and appending invisible spacer list item for layout/overflow behavior control.
EULA page and documentation updates
emhttp/plugins/unRAIDServer/EULA.page, emhttp/plugins/unRAIDServer/README.md
Adds new EULA.page plugin page that reads and Markdown-renders /boot/license.txt for license viewing; updates README.md with Unraid OS credit to Lime Technology, Inc.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • unraid/webgui#2639: Updates the same addDockerContainerContext function to adjust dropdown z-index and layout in docker.js.

Suggested labels

7.3

Poem

🐰 Paths canonicalized, files locked down tight,
Shells now escape, and HTML's made right,
Gateways configured, the plugin takes flight—
Security hardens through each staged checkpoint.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.05.28.1124
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2653/webgui-pr-2653.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/auth-request.php
emhttp/plugins/dynamix.docker.manager/javascript/docker.js
emhttp/plugins/dynamix.plugin.manager/scripts/language
emhttp/plugins/dynamix.vm.manager/VMMachines.page
emhttp/plugins/dynamix/include/FileUpload.php
emhttp/plugins/dynamix/include/ToggleState.php
emhttp/plugins/dynamix/scripts/monitor
emhttp/plugins/unRAIDServer/EULA.page
emhttp/plugins/unRAIDServer/README.md
emhttp/plugins/unRAIDServer/icons/eula.png
emhttp/plugins/unRAIDServer/icons/license.png
emhttp/plugins/unRAIDServer/images/unRAIDServer.png
emhttp/plugins/unRAIDServer/unRAIDServer.plg
etc/rc.d/rc.docker

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2653, or run:

plugin remove webgui-pr-2653

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@SimonFair SimonFair closed this May 28, 2026
@SimonFair SimonFair deleted the feature/os-261-add-support-in-monitor-to-create-output-for-panel_backport branch May 28, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants