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

Updated documentation for adding support for addon target configuration #1974

Merged

Conversation

jgoakley
Copy link
Contributor

@jgoakley jgoakley commented Nov 10, 2023

Proposed change

Documentation change for pull request: (home-assistant/supervisor#4694)

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Removed stale or deprecated documentation

Additional information

Summary by CodeRabbit

  • Documentation

    • Updated configuration documentation to enhance clarity on the map property for the ports and apparmor sections.
    • Introduced new directory types like data with customizable paths for better flexibility in container configurations.
  • New Features

    • Added support for new directory types (share, ssl, homeassistant_config) with properties like read_only and customizable paths in the map property.

@jgoakley jgoakley force-pushed the add-support-for-addon-target-path branch from 611b1e9 to 521513a Compare January 16, 2024 19:07
@jgoakley
Copy link
Contributor Author

@pvizeli The related pull request for this documentation update has been merged and released with Supervisor 2023.12.1

Are there any more changes needed to the documentation for this to be merged?
Thanks!

@frenck frenck force-pushed the add-support-for-addon-target-path branch from 89fee91 to ff41dbf Compare July 9, 2024 07:01
Copy link
Contributor

coderabbitai bot commented Jul 9, 2024

Walkthrough

Walkthrough

The configuration.md documentation has been updated to include more detailed and flexible mappings for the map property in the ports and apparmor sections. These enhancements introduce new types (e.g., share, homeassistant_config) and attributes (e.g., read_only) that allow for configurable read/write permissions and custom paths, thereby giving users greater control over their container’s configuration.

Changes

File Change Summary
docs/add-ons/configuration.md Updated the map property in the ports section to include new types and attributes for directory mappings (e.g., share, homeassistant_config with read_only). Expanded the map property in the apparmor section with new directory types and configurable paths.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Configuration.md
    participant Ports_Section as Ports Section
    participant AppArmor_Section as AppArmor Section
    
    User->>Configuration.md: Modify configurations
    Configuration.md->>Ports_Section: Update map property
    Ports_Section->>User: Types (share, ssl, homeassistant_config), Attributes (read_only)
    Configuration.md->>AppArmor_Section: Expand map property
    AppArmor_Section->>User: Directory types (data), Configurable paths
Loading

Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between ff41dbf and fc32ff2.

Files selected for processing (1)
  • docs/add-ons/configuration.md (2 hunks)
Additional context used
LanguageTool
docs/add-ons/configuration.md

[misspelling] ~158-~158: Possible spelling mistake found.
Context: ...H, IPC_LOCK, NET_ADMIN, NET_RAW, PERFMON, SYS_ADMIN, SYS_MODULE, SYS_NICE`...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~158-~158: Possible spelling mistake found.
Context: ...CK, NET_ADMIN, NET_RAW, PERFMON, SYS_ADMIN, SYS_MODULE, SYS_NICE, SYS_...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~158-~158: Possible spelling mistake found.
Context: ...IN, NET_RAW, PERFMON, SYS_ADMIN, SYS_MODULE, SYS_NICE, SYS_PTRACE, SYS...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~158-~158: Possible spelling mistake found.
Context: ..., PERFMON, SYS_ADMIN, SYS_MODULE, SYS_NICE, SYS_PTRACE, SYS_RAWIO, `SYS_...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~158-~158: Possible spelling mistake found.
Context: ... SYS_ADMIN, SYS_MODULE, SYS_NICE, SYS_PTRACE, SYS_RAWIO, SYS_RESOURCE or...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~158-~158: Possible spelling mistake found.
Context: ...SYS_MODULE, SYS_NICE, SYS_PTRACE, SYS_RAWIO, SYS_RESOURCE or SYS_TIME. |...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~158-~158: Possible spelling mistake found.
Context: ... SYS_NICE, SYS_PTRACE, SYS_RAWIO, SYS_RESOURCE or SYS_TIME. | `full_access...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~158-~158: Possible spelling mistake found.
Context: ...PTRACE, SYS_RAWIO, SYS_RESOURCEorSYS_TIME. | full_access| bool |false`...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~159-~159: Possible spelling mistake found.
Context: ...OURCEorSYS_TIME. | full_access| bool |false` | Give full access to hardwar...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~159-~159: Possible spelling mistake found.
Context: ...nable this option, don't add devices, uart, usb or gpio as this is not needed...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~159-~159: Possible spelling mistake found.
Context: ...is option, don't add devices, uart, usb or gpio as this is not needed. | `ap...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~159-~159: Possible spelling mistake found.
Context: ..., don't add devices, uart, usb or gpio as this is not needed. | apparmor | ...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~160-~160: Possible spelling mistake found.
Context: ...usborgpioas this is not needed. |apparmor| bool/string |false` | Enable or di...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~160-~160: Possible spelling mistake found.
Context: ...as this is not needed. |apparmor| bool/string |false` | Enable or disable Ap...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~160-~160: Possible spelling mistake found.
Context: ...ol/string | false | Enable or disable AppArmor support. If it is enabled, you can also...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...t into your container. Possible values: homeassistant_config, addon_config, ssl, `addons...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...ossible values: homeassistant_config, addon_config, ssl, addons, backup, `sh...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...homeassistant_config, addon_config, ssl, addons, backup, share, media,...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...sistant_config, addon_config, ssl, addons, backup, share, media, all_addo...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ..., addons, backup, share, media, all_addon_configs, and data. Defaults to read-...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ... paths map to /<type-name> inside the addon container, but an optional path prope...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...que from any other path defined for the addon, and not the root path. Note that the `...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~163-~163: Possible spelling mistake found.
Context: ...les to run the add-on with. | audio | bool | false | Mark this add-on to use the...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~163-~163: Possible spelling mistake found.
Context: ..., you may need to install: Alpine Linux alsa-plugins-pulse or Debian/Ubuntu libasound2-plugins....

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~164-~164: Possible spelling mistake found.
Context: ...buntu libasound2-plugins. | video | bool | false | Mark this add-on to use the...

(MORFOLOGIK_RULE_EN_US)

Markdownlint
docs/add-ons/configuration.md

158-158: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


159-159: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


160-160: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


161-161: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


162-162: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


163-163: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


164-164: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @jgoakley 👍

../Frenck

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: 2

docs/add-ons/configuration.md Outdated Show resolved Hide resolved
@frenck frenck merged commit 7ac7af4 into home-assistant:master Jul 9, 2024
4 checks passed
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: 4

- type: ssl
- type: homeassistant_config
read_only: False
path: /custom/config/path
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure the path property is well-explained.

The path property is described, but consider adding a brief note about its purpose and constraints for clarity.

+  # The `path` property allows you to specify a custom path inside the container. Ensure it is unique and not empty.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
path: /custom/config/path
# The `path` property allows you to specify a custom path inside the container. Ensure it is unique and not empty.
path: /custom/config/path

Comment on lines +113 to +118
- type: share
read_only: False
- type: ssl
- type: homeassistant_config
read_only: False
path: /custom/config/path
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify the read_only property usage.

The documentation is clear but consider adding a brief explanation of the read_only property for users who might be unfamiliar with it.

+  # The `read_only` property specifies whether the directory is read-only. Set to `False` to allow write access.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- type: share
read_only: False
- type: ssl
- type: homeassistant_config
read_only: False
path: /custom/config/path
- type: share
read_only: False # The `read_only` property specifies whether the directory is read-only. Set to `False` to allow write access.
- type: ssl
- type: homeassistant_config
read_only: False
path: /custom/config/path

@@ -154,7 +158,7 @@ Avoid using `config.yaml` as filename in your add-on for anything other than the
| `privileged` | list | | Privilege for access to hardware/system. Available access: `BPF`, `DAC_READ_SEARCH`, `IPC_LOCK`, `NET_ADMIN`, `NET_RAW`, `PERFMON`, `SYS_ADMIN`, `SYS_MODULE`, `SYS_NICE`, `SYS_PTRACE`, `SYS_RAWIO`, `SYS_RESOURCE` or `SYS_TIME`.
| `full_access` | bool | `false` | Give full access to hardware like the privileged mode in Docker. Works only for not protected add-ons. Consider using other add-on options instead of this, like `devices`. If you enable this option, don't add `devices`, `uart`, `usb` or `gpio` as this is not needed.
| `apparmor` | bool/string | `false` | Enable or disable AppArmor support. If it is enabled, you can also use custom profiles with the name of the profile.
| `map` | list | | List of Home Assistant directories to bind mount into your container. Possible values: `homeassistant_config`, `addon_config`, `ssl`, `addons`, `backup`, `share`, `media`, and `all_addon_configs`. Defaults to `ro`, which you can change by adding `:rw` to the end of the name.
| `map` | list | | List of Home Assistant directory types to bind mount into your container. Possible values: `homeassistant_config`, `addon_config`, `ssl`, `addons`, `backup`, `share`, `media`, `all_addon_configs`, and `data`. Defaults to read-only, which you can change by adding the property `read_only: false`. By default, all paths map to `/<type-name>` inside the addon container, but an optional `path` property can also be supplied to configure the path (Example: `path: /custom/config/path`). If used, the path must not be empty, unique from any other path defined for the addon, and not the root path. Note that the `data` directory is always mapped and writable, but the `path` property can be set using the same conventions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify the data directory behavior.

The documentation mentions that the data directory is always mapped and writable. Consider adding a brief explanation about the typical usage scenarios for the data directory.

+  # The `data` directory is always mapped and writable. It is typically used for storing persistent data required by the add-on.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `map` | list | | List of Home Assistant directory types to bind mount into your container. Possible values: `homeassistant_config`, `addon_config`, `ssl`, `addons`, `backup`, `share`, `media`, `all_addon_configs`, and `data`. Defaults to read-only, which you can change by adding the property `read_only: false`. By default, all paths map to `/<type-name>` inside the addon container, but an optional `path` property can also be supplied to configure the path (Example: `path: /custom/config/path`). If used, the path must not be empty, unique from any other path defined for the addon, and not the root path. Note that the `data` directory is always mapped and writable, but the `path` property can be set using the same conventions.
| `map` | list | | List of Home Assistant directory types to bind mount into your container. Possible values: `homeassistant_config`, `addon_config`, `ssl`, `addons`, `backup`, `share`, `media`, `all_addon_configs`, and `data`. Defaults to read-only, which you can change by adding the property `read_only: false`. By default, all paths map to `/<type-name>` inside the addon container, but an optional `path` property can also be supplied to configure the path (Example: `path: /custom/config/path`). If used, the path must not be empty, unique from any other path defined for the addon, and not the root path. Note that the `data` directory is always mapped and writable, but the `path` property can be set using the same conventions.
# The `data` directory is always mapped and writable. It is typically used for storing persistent data required by the add-on.
Tools
LanguageTool

[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...t into your container. Possible values: homeassistant_config, addon_config, ssl, `addons...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...ossible values: homeassistant_config, addon_config, ssl, addons, backup, `sh...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...homeassistant_config, addon_config, ssl, addons, backup, share, media,...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...sistant_config, addon_config, ssl, addons, backup, share, media, all_addo...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ..., addons, backup, share, media, all_addon_configs, and data. Defaults to read-...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ... paths map to /<type-name> inside the addon container, but an optional path prope...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...que from any other path defined for the addon, and not the root path. Note that the `...

(MORFOLOGIK_RULE_EN_US)

Markdownlint

161-161: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)


Ensure the path property is well-explained.

The path property is described, but consider adding a brief note about its purpose and constraints for clarity.

+  # The `path` property allows you to specify a custom path inside the container. Ensure it is unique and not empty.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `map` | list | | List of Home Assistant directory types to bind mount into your container. Possible values: `homeassistant_config`, `addon_config`, `ssl`, `addons`, `backup`, `share`, `media`, `all_addon_configs`, and `data`. Defaults to read-only, which you can change by adding the property `read_only: false`. By default, all paths map to `/<type-name>` inside the addon container, but an optional `path` property can also be supplied to configure the path (Example: `path: /custom/config/path`). If used, the path must not be empty, unique from any other path defined for the addon, and not the root path. Note that the `data` directory is always mapped and writable, but the `path` property can be set using the same conventions.
| `map` | list | | List of Home Assistant directory types to bind mount into your container. Possible values: `homeassistant_config`, `addon_config`, `ssl`, `addons`, `backup`, `share`, `media`, `all_addon_configs`, and `data`. Defaults to read-only, which you can change by adding the property `read_only: false`. By default, all paths map to `/<type-name>` inside the addon container, but an optional `path` property can also be supplied to configure the path (Example: `path: /custom/config/path`). If used, the path must not be empty, unique from any other path defined for the addon, and not the root path. Note that the `data` directory is always mapped and writable, but the `path` property can be set using the same conventions.
# The `path` property allows you to specify a custom path inside the container. Ensure it is unique and not empty.
Tools
LanguageTool

[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...t into your container. Possible values: homeassistant_config, addon_config, ssl, `addons...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...ossible values: homeassistant_config, addon_config, ssl, addons, backup, `sh...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...homeassistant_config, addon_config, ssl, addons, backup, share, media,...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...sistant_config, addon_config, ssl, addons, backup, share, media, all_addo...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ..., addons, backup, share, media, all_addon_configs, and data. Defaults to read-...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ... paths map to /<type-name> inside the addon container, but an optional path prope...

(MORFOLOGIK_RULE_EN_US)


[misspelling] ~161-~161: Possible spelling mistake found.
Context: ...que from any other path defined for the addon, and not the root path. Note that the `...

(MORFOLOGIK_RULE_EN_US)

Markdownlint

161-161: Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
Table pipe style

(MD055, table-pipe-style)

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.

4 participants