diff --git a/samba/CHANGELOG.md b/samba/CHANGELOG.md index 111b12f53..3db6c2fbe 100644 --- a/samba/CHANGELOG.md +++ b/samba/CHANGELOG.md @@ -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 diff --git a/samba/DOCS.md b/samba/DOCS.md index 12a67c804..80be4ecb8 100644 --- a/samba/DOCS.md +++ b/samba/DOCS.md @@ -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: @@ -39,8 +45,8 @@ username: homeassistant password: YOUR_PASSWORD workgroup: WORKGROUP enabled_shares: - - addons - - addon_configs + - local_apps + - app_configs - backup - config - media diff --git a/samba/build.yaml b/samba/build.yaml index 4cec96470..c9284064c 100644 --- a/samba/build.yaml +++ b/samba/build.yaml @@ -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 diff --git a/samba/config.yaml b/samba/config.yaml index 5b641f332..e80769372 100644 --- a/samba/config.yaml +++ b/samba/config.yaml @@ -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 @@ -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 @@ -24,8 +24,8 @@ options: password: null workgroup: WORKGROUP enabled_shares: - - addons - - addon_configs + - local_apps + - app_configs - backup - config - media @@ -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 apple_compatibility_mode: bool netbios: bool diff --git a/samba/rootfs/etc/s6-overlay/s6-rc.d/init-smbd/run b/samba/rootfs/etc/s6-overlay/s6-rc.d/init-smbd/run index 8bf03527d..28e4633e6 100755 --- a/samba/rootfs/etc/s6-overlay/s6-rc.d/init-smbd/run +++ b/samba/rootfs/etc/s6-overlay/s6-rc.d/init-smbd/run @@ -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 diff --git a/samba/rootfs/etc/s6-overlay/s6-rc.d/smbd/finish b/samba/rootfs/etc/s6-overlay/s6-rc.d/smbd/finish index e60184ba4..4fb2dc554 100755 --- a/samba/rootfs/etc/s6-overlay/s6-rc.d/smbd/finish +++ b/samba/rootfs/etc/s6-overlay/s6-rc.d/smbd/finish @@ -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 diff --git a/samba/rootfs/usr/share/tempio/smb.gtpl b/samba/rootfs/usr/share/tempio/smb.gtpl index df72fcca1..9efcae874 100644 --- a/samba/rootfs/usr/share/tempio/smb.gtpl +++ b/samba/rootfs/usr/share/tempio/smb.gtpl @@ -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" + + 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 @@ -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 diff --git a/samba/translations/en.yaml b/samba/translations/en.yaml index 73a6a0eb4..1fa6c1e83 100644 --- a/samba/translations/en.yaml +++ b/samba/translations/en.yaml @@ -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: >-