Skip to content

File Manager and SMB style fixes#2150

Merged
limetech merged 17 commits into
unraid:masterfrom
bergware:master
Apr 21, 2025
Merged

File Manager and SMB style fixes#2150
limetech merged 17 commits into
unraid:masterfrom
bergware:master

Conversation

@bergware

@bergware bergware commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Expanded file management flexibility to support additional user share types, ensuring smoother file and folder operations.
    • Improved directory browsing now presents a more comprehensive view, making share navigation clearer.
    • Enhanced wireless network configuration to support multiple prioritized WPA2/WPA3 security profiles for better connectivity and security.
  • Style

    • Refined the text area layout for better spacing and a cleaner interface.
    • Improved code readability with consistent spacing and formatting adjustments.
  • Bug Fixes

    • Updated path validation to correctly handle new user share types, preventing potential file operation errors.
  • User Interface

    • Disabled autocomplete and spellcheck on sensitive wireless configuration fields to enhance input accuracy and user experience.

@coderabbitai

coderabbitai Bot commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request updates the file management system by modifying regular expressions in the file move functions to include additional user share paths (disks and remotes) instead of rootshare. It also improves code readability through formatting changes in several PHP functions, introduces new functions in the file tree handler to streamline directory listings and filtering, and adjusts CSS styling of a textarea element. Additionally, the wireless configuration script was enhanced to support multiple WPA2/WPA3 network profiles with refined security parameter handling and unified wpa_supplicant restarts. The wireless form input attributes were also adjusted to disable autocomplete and spellcheck on the form element. Overall, the changes focus on validating and handling paths more flexibly, enhancing code clarity, and improving wireless network configuration support.

Changes

File(s) Change Summary
emhttp/plugins/dynamix/Browse.page Updated regex patterns in doAction and doActions to allow paths with disks and remotes, replacing the previous rootshare allowance.
emhttp/plugins/dynamix/include/Browse.php Applied formatting improvements by adding spaces in function calls and conditions, enhancing readability without changing functionality.
emhttp/plugins/dynamix/include/FileTree.php Added new functions no_dots and my_dir, modified directory logic to include UD shares, and consolidated filtering of directory entries.
emhttp/plugins/dynamix/sheets/SMBExtras.css Adjusted textarea styling by reducing its width from 63% to 60% and added a margin: 0 property to refine the UI layout.
etc/rc.d/rc.wireless Refined WPA configuration generation to support multiple prioritized network blocks for WPA2/WPA3 mixed environments, improved security parameter handling, and unified wpa_supplicant restarts.
emhttp/plugins/dynamix/include/Wireless.php Modified form element in saveAttr() to include autocomplete="off" and spellcheck="false"; removed these attributes from individual input fields.
emhttp/plugins/dynamix/scripts/open_ssl Enhanced sanitization of manufacturer string by broadening character replacement in sed command to include all non-alphanumeric characters except dot, underscore, and hyphen.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant BP as Browse.page (doAction/doActions)
    participant FS as File System
    U->>BP: Initiate file/folder move
    BP->>BP: Validate path using updated regex
    alt Valid Path
        BP->>FS: Perform move operation
        FS-->>BP: Return success
        BP-->>U: Confirm success
    else Invalid Path
        BP-->>U: Return error message
    end
Loading
sequenceDiagram
    participant U as User
    participant FT as FileTree
    participant MD as my_dir
    participant ND as no_dots
    U->>FT: Request directory listing
    FT->>MD: Determine directory path based on UD shares
    MD-->>FT: Provide updated directory path
    FT->>ND: Filter out '.' and '..' entries
    ND-->>FT: Return cleaned directory list
    FT-->>U: Send final listing
Loading
sequenceDiagram
    participant U as User
    participant RC as rc.wireless
    participant WPA as wpa_supplicant
    U->>RC: Request WiFi join with security mode
    RC->>RC: Generate WPA config for multiple network blocks based on security mode
    RC->>WPA: Restart wpa_supplicant with new config
    WPA-->>RC: Confirm restart
    RC-->>U: Confirm WiFi join success
Loading

Possibly related PRs

Suggested reviewers

  • ljm42

Poem

I'm a bunny in the code burrow, so spry,
Hopping through regex with a keen eye.
I skipped old roots for disks and remotes in play,
Cleared out dots in directories along the way.
With tidy code and neat CSS delight,
I twirl my ears—hop on, code, into the night! 🐰✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between b722fc3 and dfb65de.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix/scripts/open_ssl (1 hunks)
🔇 Additional comments (1)
emhttp/plugins/dynamix/scripts/open_ssl (1)

22-22: Improved input sanitization for encryption key generation.

The updated sed command now uses extended regular expressions with the -r flag and replaces any non-alphanumeric characters (except dot, underscore, and hyphen) with an underscore. This enhances security by ensuring a more robust sanitization of the manufacturer string used in encryption key generation.

The change properly handles characters that could potentially cause issues in cryptographic operations, making the key generation process more reliable across different hardware with varying manufacturer string formats.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

- Make WPA3 enterprise work
- Create mix configuration for WPA2/WPA3 networks (WPA3 preferred)
- Improve automatic security selection

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
etc/rc.d/rc.wireless (1)

144-148: Clarify the logic for multi-network file creation
Currently, $FILE is assigned to either $WPA or $WPA.s, but then subsequent lines within the same function (e.g., line 152, 156, etc.) append configuration data to $WPA. This works in practice, thanks to line 171 appending $WPA back into $WPA.s. However, it can be confusing to new readers. Consider either using $FILE consistently or adding a clarifying comment on why $WPA remains the main interim file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 18edd99 and c2139bc.

📒 Files selected for processing (1)
  • etc/rc.d/rc.wireless (2 hunks)
🔇 Additional comments (5)
etc/rc.d/rc.wireless (5)

141-141: No issues found for the new WPA3 Enterprise comment line
This added comment line is self-explanatory and doesn't introduce any problems.


152-152: Ensure comprehensive testing of WPA/Enterprise parameter assignments
These lines correctly separate open, PSK, SAE, and IEEE-based flows, including ieee80211w for WPA3 or 802.1X/SHA-256. Verify in real-world testing that all security combinations (e.g., WPA2 vs. WPA3, 802.1X vs. SAE) work as intended and handle edge cases like older drivers or clients.

Also applies to: 156-156, 162-162, 164-167, 171-171


263-269: Check priority ordering for the 'auto' security case
The block sets WPA3 Enterprise with the highest priority (25), followed by WPA2 Enterprise (18), WPA3 Personal (15), and WPA2 Personal (12). Confirm that this order matches the desired fallback logic for your environment.


270-279: WPA2/WPA3 Enterprise and Personal multi-network blocks
Generating multiple network blocks for WPA2/WPA3 modes ensures a seamless fallback from WPA3 to WPA2. The approach of writing to a temporary “.s” file and then moving it into $WPA is straightforward for configuring multiple security profiles.


283-284: Restarting wpa_supplicant
Killing any existing wpa_supplicant instance before spawning a new one provides a clean transition and avoids potential conflicts in reconfiguration.

@limetech limetech merged commit d2ab135 into unraid:master Apr 21, 2025
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.

2 participants