Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions samba/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 12.10.0

- Rename the `addons` and `addon_configs` shares to `local_apps` and `app_configs` to match Home Assistant's app terminology. Existing `enabled_shares` configurations are migrated automatically on start (extending the lower-case normalization added in 12.8.1).
- Both the new (`local_apps`/`app_configs`) and legacy (`addons`/`addon_configs`) share names stay exposed, so existing SMB connections keep working while you move to the new names.
- Log a warning when a client connects to a deprecated `addons`/`addon_configs` share, indicating which new share to switch to.
- Exit cleanly with code 0 on shutdown instead of 143, so the Supervisor no longer warns about the add-on not handling `SIGTERM`.
- Migrate to the new `local_apps` and `all_app_configs` folder mappings introduced in Home Assistant Supervisor.
- Update base image to 3.24-2026.06.1

## 12.9.0

- Add configuration option to disable WSDD. When disabled, the wsdd service is
Expand Down
14 changes: 10 additions & 4 deletions samba/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@ This app exposes the following directories over smb (samba):

Directory | Description
-- | --
`addons` | This is for your local apps.
`addon_configs` | This is for the configuration files of your apps.
`local_apps` | This is for your local apps.
`app_configs` | This is for the configuration files of your apps.
`backup` | This is for your backups.
`config` | This is for your Home Assistant configuration.
`media` | This is for local media files.
`share` | This is for your data that is shared between apps and Home Assistant.
`ssl` | This is for your SSL certificates.

The `local_apps` and `app_configs` shares were previously named `addons` and
`addon_configs`. Existing configurations are migrated to the new names
automatically. Both the new and legacy share names stay exposed and point to
the same directories, so existing connections keep working while you move to
the new names.

## Configuration

App configuration:
Expand All @@ -39,8 +45,8 @@ username: homeassistant
password: YOUR_PASSWORD
workgroup: WORKGROUP
enabled_shares:
- addons
- addon_configs
- local_apps
- app_configs
- backup
- config
- media
Expand Down
4 changes: 2 additions & 2 deletions samba/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base:3.23-2026.02.0
amd64: ghcr.io/home-assistant/amd64-base:3.23-2026.02.0
aarch64: ghcr.io/home-assistant/aarch64-base:3.24-2026.06.1
amd64: ghcr.io/home-assistant/amd64-base:3.24-2026.06.1
12 changes: 6 additions & 6 deletions samba/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 12.9.0
version: 12.10.0
slug: samba
name: Samba share
description: Expose Home Assistant folders with SMB/CIFS
Expand All @@ -12,8 +12,8 @@ host_network: true
image: homeassistant/{arch}-addon-samba
init: false
map:
- addons:rw
- all_addon_configs:rw
- local_apps:rw
- all_app_configs:rw
- backup:rw
- homeassistant_config:rw
- media:rw
Expand All @@ -24,8 +24,8 @@ options:
password: null
workgroup: WORKGROUP
enabled_shares:
- addons
- addon_configs
- local_apps
- app_configs
- backup
- config
- media
Expand Down Expand Up @@ -55,7 +55,7 @@ schema:
password: password
workgroup: str
enabled_shares:
- "match(^(?i:(addons|addon_configs|backup|config|media|share|ssl))$)"
- "match(^(?i:(local_apps|app_configs|addons|addon_configs|backup|config|media|share|ssl))$)"
compatibility_mode: bool
Comment on lines 57 to 59
apple_compatibility_mode: bool
netbios: bool
Expand Down
31 changes: 24 additions & 7 deletions samba/rootfs/etc/s6-overlay/s6-rc.d/init-smbd/run
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,31 @@ fi

bashio::config.require "enabled_shares" "Samba is a tool for sharing folders. Starting it without sharing any folders defeats the purpose."

# Migrate stored enabled_shares values to lower case. Values have always
# been treated case-insensitively at runtime; persisting them lower case
# prepares for a future release that restricts the schema to the exact
# share names.
# Migrate stored enabled_shares values: normalize to lower case and rename the
# legacy `addons`/`addon_configs` share names to `local_apps`/`app_configs` to
# match Home Assistant's app terminology. Values have always been treated
# case-insensitively at runtime; persisting the canonical, renamed form keeps
# the stored configuration current and prepares for a future release that can
# drop the legacy names from the schema. The `addons` and `addon_configs`
# shares stay exposed for backward compatibility (see smb.gtpl).
stored_options=$(bashio::api.supervisor GET /addons/self/info false | jq '.options')
if jq -e '(.enabled_shares // []) | any(. != ascii_downcase)' <<< "${stored_options}" > /dev/null; then
bashio::log.info "Migrating enabled_shares configuration values to lower case"
migration_payload=$(jq -c '{options: (.enabled_shares |= map(ascii_downcase))}' <<< "${stored_options}")
if jq -e '(.enabled_shares // []) | any(
ascii_downcase as $s
| (. != $s) or ($s == "addons") or ($s == "addon_configs")
)' <<< "${stored_options}" > /dev/null; then
bashio::log.info "Migrating enabled_shares configuration values"
migration_payload=$(jq -c '
def migrate:
(. // [])
| map(ascii_downcase)
| map(
if . == "addons" then "local_apps"
elif . == "addon_configs" then "app_configs"
else . end
)
| reduce .[] as $s ([]; if index($s) then . else . + [$s] end);
{options: (.enabled_shares |= migrate)}
' <<< "${stored_options}")
if ! bashio::api.supervisor POST /addons/self/options "${migration_payload}"; then
bashio::log.warning "Could not migrate enabled_shares values; will retry on next start"
fi
Expand Down
5 changes: 4 additions & 1 deletion samba/rootfs/etc/s6-overlay/s6-rc.d/smbd/finish
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ bashio::log.info \
"(by signal ${exit_code_signal})"

if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
# SIGTERM (15) is how s6-overlay brings the service down during a normal
# container shutdown; halt the supervision tree but keep the container exit
# code at 0. Record any other (unexpected) signal as the failure code.
if [[ "${exit_code_signal}" -ne 15 && "${exit_code_container}" -eq 0 ]]; then
echo $((128 + exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
Expand Down
36 changes: 32 additions & 4 deletions samba/rootfs/usr/share/tempio/smb.gtpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,38 @@
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if (has "addons" .enabled_shares) }}
{{ if or (has "local_apps" .enabled_shares) (has "addons" .enabled_shares) }}
[local_apps]
browseable = yes
writeable = yes
path = /local_apps

valid users = {{ .username }}
force user = root
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if or (has "local_apps" .enabled_shares) (has "addons" .enabled_shares) }}
[addons]
browseable = yes
writeable = yes
path = /addons
path = /local_apps
preexec = /usr/bin/logger -s -t smbd -p local0.warning "%u connected to deprecated share %S from %m (%I), please switch to the local_apps share"

Comment thread
agners marked this conversation as resolved.
valid users = {{ .username }}
force user = root
force group = root
veto files = /{{ .veto_files | join "/" }}/
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if or (has "app_configs" .enabled_shares) (has "addon_configs" .enabled_shares) }}
[app_configs]
browseable = yes
writeable = yes
path = /app_configs

valid users = {{ .username }}
force user = root
Expand All @@ -66,11 +93,12 @@
delete veto files = {{ eq (len .veto_files) 0 | ternary "no" "yes" }}
{{ end }}

{{ if (has "addon_configs" .enabled_shares) }}
{{ if or (has "app_configs" .enabled_shares) (has "addon_configs" .enabled_shares) }}
[addon_configs]
browseable = yes
writeable = yes
path = /addon_configs
path = /app_configs
preexec = /usr/bin/logger -s -t smbd -p local0.warning "%u connected to deprecated share %S from %m (%I), please switch to the app_configs share"

valid users = {{ .username }}
force user = root
Expand Down
8 changes: 5 additions & 3 deletions samba/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ configuration:
enabled_shares:
name: >-
Enabled Shares - allowed values are:
addons, addon_configs, backup, config, media, share, or ssl.
local_apps, app_configs, backup, config, media, share, or ssl.
description: >-
List of file shares to make available.
Adding a share requires typing its name to add it.
The listed values are the only allowed values.
The configuration cannot be saved if any non-allowed value is in the list.
The legacy names addons and addon_configs are still accepted and map to
local_apps and app_configs for backward compatibility.
Only these values are allowed;
the configuration cannot be saved if any other value is in the list.
compatibility_mode:
name: Enable Compatibility Mode
description: >-
Expand Down
Loading