Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samba: Update Samba add-on to allow selectively enabling folders #3701

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

as-kholin
Copy link
Contributor

@as-kholin as-kholin commented Jul 29, 2024

Fixes #3696. Fixes #3551. Adds 'enable' radio buttons for each share exposed by Samba plugin, to allow user to only enable the specific folders they want to expose.

Attempted to set sane defaults of what to expose. Directly upgrading may be viewed as a breaking change, as it would disable currently exposed folders.

Summary by CodeRabbit

  • New Features

    • Introduced multiple new configuration options for Samba, enhancing control over folder exposure related to HomeAssistant.
    • Enhanced flexibility in Samba configuration templates with conditional sections based on user-defined settings.
  • Bug Fixes

    • Updated version numbers and schemas to reflect the latest changes and ensure compatibility.
  • Documentation

    • Enhanced documentation for Samba configuration options, improving user guidance and clarity.
  • Chores

    • Updated changelog to reflect new version entry and significant enhancements in security and configurability.

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @as-kholin

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft July 29, 2024 01:42
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copy link
Contributor

coderabbitai bot commented Jul 29, 2024

Walkthrough

Walkthrough

The recent updates to Samba enhance user configurability for folder access related to HomeAssistant. New options allow for selective exposure of directories such as 'addons', 'backup', and 'media', significantly improving both security and functionality. These enhancements ensure that users can tailor their Samba configurations while maintaining safe defaults.

Changes

Files Change Summary
samba/DOCS.md, samba/config.yaml, samba/translations/en.yaml Introduced new configuration options for folder exposure, including enable_addons, enable_backups, and others. Added boolean flags for detailed control over Samba behavior.
samba/CHANGELOG.md Documented breaking changes to default shares and added features for selective sharing by users.
samba/rootfs/usr/share/tempio/smb.gtpl Added conditional checks to enable specific features based on user-defined flags, improving configuration flexibility.

Assessment against linked issues

Objective Addressed Explanation
Allow users to selectively disable default shares (3696)
Enable user-defined locations for sharing (3696) User-defined sharing locations are not implemented in this update.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 or @coderabbitai title 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
samba/DOCS.md (1)

132-140: Fix the grammatical issue.

Remove the comma before "because" to correct the grammatical issue.

- These are considered sensitive, because anyone who gets ahold of both parts can impersonate your HomeAssistant server,
+ These are considered sensitive because anyone who gets ahold of both parts can impersonate your HomeAssistant server,
Tools
LanguageTool

[formatting] ~136-~136: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...SL keys. These are considered sensitive, because anyone who gets ahold of both parts can...

(COMMA_BEFORE_BECAUSE)

@as-kholin as-kholin marked this pull request as ready for review July 29, 2024 01:48
@as-kholin as-kholin changed the title Update Samba add-on to allow selectively enabling folders Samba: Update Samba add-on to allow selectively enabling folders Jul 29, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
samba/CHANGELOG.md (1)

5-5: Enhance the breaking change notice with additional context.

To provide better clarity for users, consider adding more details about the impact and necessary actions.

- BREAKING CHANGE: Default shares will reduce to media and shared.  Other folders will have to be enabled by the end user.
+ BREAKING CHANGE: Default shares will be limited to "media" and "shared". Users must manually enable any other folders they wish to share. This change enhances security and user control but may require updating your configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (1)
samba/translations/en.yaml (1)

44-47: Consider mentioning that the option is disabled by default.

To maintain consistency with other options, mention that the option is disabled by default.

-      Enable SMB access to the Media folder
+      Enable SMB access to the Media folder.
+      This is disabled by default.

samba/translations/en.yaml Outdated Show resolved Hide resolved
samba/CHANGELOG.md Outdated Show resolved Hide resolved
samba/config.yaml Outdated Show resolved Hide resolved
samba/CHANGELOG.md Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft August 7, 2024 06:12
as-kholin and others added 2 commits August 14, 2024 00:52
- Updated CHANGELOG.md to remove breaking change notice.
- Updated config.yaml and en.yaml verbiage from 'enable' to 'allow'
@as-kholin as-kholin requested a review from frenck August 14, 2024 08:35
@as-kholin as-kholin marked this pull request as ready for review August 16, 2024 22:40
@as-kholin
Copy link
Contributor Author

I had addressed or replied to the comments listed. Was trying to hold off on resubmitting until the last conversation was resolved. I am not sure if that is where we are.

@frenck, it says you make the conversation resolved - on that basis I am resubmitting for review. Let me know if there is still conversation there, or if we want to dig into other ways to manage those folders, to minimize their impact/risk while also exposing them by default to address the security/convenience gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants