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 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d2fc1ef
Updating to add option to enable specific shares for exporting, and t…
as-kholin Jul 28, 2024
ae11735
Updating translations for descriptive titles for the different folders
as-kholin Jul 29, 2024
a3105fc
Update DOCS.md to explain settings. Update init-smbd to block startu…
as-kholin Jul 29, 2024
6f4c772
remove unintentional extra line
as-kholin Jul 29, 2024
09ef073
Updating grammer per coderabbitai
as-kholin Jul 29, 2024
537522e
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Jul 29, 2024
8a0d55d
Incrementing version number
as-kholin Jul 29, 2024
7d313cb
Added Changelog update, and changed the version update in config to m…
as-kholin Jul 29, 2024
8d6ccb5
Updating to account for coderabbitai feedback on CHANGELOG
as-kholin Jul 29, 2024
40ccb71
Rebase to home-assistant/addons PR #3704 - Samba: correct benign idma…
as-kholin Jul 30, 2024
f1417d3
Letsencrypt: Add support for noris network DNS provider (#3697)
nana-ska Jul 30, 2024
372c2a7
Rebasing CHANGELOG updates
as-kholin Jul 29, 2024
e3e3dd7
Merging in changes from upstream
as-kholin Jul 31, 2024
8e9b5bd
Correct YAMLLing errors in user-facing descriptions due to long lines
as-kholin Jul 31, 2024
d020619
Correct typo on user descriptions in translations
as-kholin Jul 31, 2024
d62e9db
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Aug 5, 2024
dae9c99
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Aug 6, 2024
26c70a7
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Aug 6, 2024
acc72b5
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Aug 14, 2024
58b754e
Per frenck's feedback:
as-kholin Aug 14, 2024
1093201
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Aug 16, 2024
0f8f768
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Aug 26, 2024
86699ce
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Aug 27, 2024
a8b41c3
Correct missed adjustment when config variable names were changed
as-kholin Aug 30, 2024
ed18112
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 2, 2024
5d6903b
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 5, 2024
0ed4082
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 11, 2024
f8322c4
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 12, 2024
15a5626
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 13, 2024
da6295e
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 23, 2024
9bc5fda
Correct unintended Translation adjustment
as-kholin Sep 24, 2024
7b4c04d
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 27, 2024
89bd885
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Sep 28, 2024
62492fb
Merge branch 'home-assistant:master' into smb_selective_enable
as-kholin Oct 4, 2024
6f8282f
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Oct 10, 2024
9f62db3
Revamped selective enable
as-kholin Oct 10, 2024
25b4758
Updated translation to 80 character line limit
as-kholin Oct 10, 2024
e830809
Updated documentation based on CodeRabbit Feedback
as-kholin Oct 10, 2024
11acf7b
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Oct 21, 2024
47495b8
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Oct 25, 2024
9fb8782
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Nov 3, 2024
a940a04
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Nov 15, 2024
0a1bc6d
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Dec 10, 2024
f3d3e59
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Dec 16, 2024
a91a047
Merge remote-tracking branch 'upstream/master' into smb_selective_enable
as-kholin Jan 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions samba/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,59 @@ when you absolutely need it and understand the possible consequences.

Defaults to `false`.

### Option: `enable_addons`

Setting this option to `true` will allow Samba to expose the 'addons' folder,
which is used for installing custom local plugins.

Defaults to `false`.

### Option: `enable_addon_configs`

Setting this option to `true` will allow Samba to expose the 'addon_configs' folder,
which is used for setting configuration of plugins.

defaults to `false`.

### Option: `enable_backups`

Setting this option to `true` will allow Samba to expose the 'backup' folder,
which is where HomeAssistant places its backups. These backups can contain any information
stored in your configurations for Homeassistant or any add-on, including secrets.

Defaults to `false`.

### Option: `enable_configs`

Setting this option to `true` will allow Samba to expose the 'config' folder,
which is where HomeAssistant stores it core configuration files and databases. This
includes secrets.

Defaults to `false`.

### Option: `enable_media`

This option will allow Samba to expose the 'media' folder, which is where HomeAssistant
expects you to store any local media files. This is generally safe to expose.

Defaults to `true`. If you want to not allow this access, change to `false`.

### Option: `enable_share`

This option will allow Samba to expose the 'share' folder, which is where HomeAssistant
stores information it expects to be shared between different plugins and HomeAssistant.

Defaults to `true`. If you want to not allow this access, change to `false`.

### Option: `enable_ssl`

Setting this option to `true` will allow Samba to expose the 'ssl' folder,
which is where HomeAssistant stores its public and private SSL keys. These are considered
sensitive, because anyone who gets ahold of both parts can impersonante your HomeAssistant server,
including using that to collect credentials.

Defaults to `false`.

## Support

Got questions?
Expand Down
14 changes: 14 additions & 0 deletions samba/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ options:
- 169.254.0.0/16
- fe80::/10
- fc00::/7
enable_addons: false
as-kholin marked this conversation as resolved.
Show resolved Hide resolved
enable_addon_configs: false
enable_backup: false
enable_config: false
enable_media: true
enable_share: true
enable_ssl: false
schema:
username: str
password: password
Expand All @@ -50,4 +57,11 @@ schema:
- str
allow_hosts:
- str
enable_addons: bool
enable_addon_configs: bool
enable_backup: bool
enable_config: bool
enable_media: bool
enable_share: bool
enable_ssl: bool
startup: services
6 changes: 6 additions & 0 deletions samba/rootfs/etc/s6-overlay/s6-rc.d/init-smbd/run
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ if ! bashio::config.has_value 'username' || ! bashio::config.has_value 'password
bashio::exit.nok "Setting a username and password is required!"
fi

if bashio::config.false 'enable_addons' && bashio::config.false 'enable_addon_configs' && bashio::config.false 'enable_backup' && \
bashio::config.false 'enable_config' && bashio::config.false 'enable_media' && bashio::config.false 'enable_share' && \
bashio::config.false 'enable_ssl'; then
bashio::exit.nok "No shares enabled for Samba to present!"
fi

# Read hostname from API or setting default "hassio"
HOSTNAME=$(bashio::info.hostname)
if bashio::var.is_empty "${HOSTNAME}"; then
Expand Down
14 changes: 14 additions & 0 deletions samba/rootfs/usr/share/tempio/smb.gtpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
dos charset = CP850
unix charset = UTF-8

{{ if .enable_config }}
[config]
browseable = yes
writeable = yes
Expand All @@ -34,7 +35,9 @@
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if .enable_addons }}
[addons]
browseable = yes
writeable = yes
Expand All @@ -45,7 +48,9 @@
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if .enable_addon_configs }}
[addon_configs]
browseable = yes
writeable = yes
Expand All @@ -56,7 +61,9 @@
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if .enable_ssl }}
[ssl]
browseable = yes
writeable = yes
Expand All @@ -67,7 +74,9 @@
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if .enable_share }}
[share]
browseable = yes
writeable = yes
Expand All @@ -78,7 +87,9 @@
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if .enable_backup }}
[backup]
browseable = yes
writeable = yes
Expand All @@ -89,7 +100,9 @@
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if .enable_media }}
[media]
browseable = yes
writeable = yes
Expand All @@ -100,3 +113,4 @@
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}
21 changes: 21 additions & 0 deletions samba/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,24 @@ configuration:
allow_hosts:
name: Allowed Hosts
description: List of hosts/networks allowed to access the shared folders.
enable_addons:
name: Enable Add-Ons folder
description: Enable SMB access to the Add-ons folder. This is disabled by default.
enable_addon_configs:
name: Enable Add-On Configs folder
description: Enable SMB access to the Add-on Configuraitons folder. This is disabled by default.
enable_backup:
name: Enable Backups folder
description: Enable SMB access to the folder where HomeAssistant keeps its backups. This is disabled by default.
enable_config:
name: Enable Configs folder
description: Enable SMB access to the HomeAssistant Core configuration folder. This is disabled by default.
enable_media:
name: Enable Media folder
description: Enable SMB access to the Media folder
enable_share:
name: Enable Share folders
description: Enable SMB access to the Share folder (which is shared with all HomeAssistant Add-ons).
enable_ssl:
name: Enable SSL folder
description: Enable SMB access to the ssl folder, where HomeAssistant keeps its SSL Keys. This is disabled by default.