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
6 changes: 6 additions & 0 deletions samba/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 12.8.1

- Normalize stored `enabled_shares` values to lower case at startup. Values
were already handled case-insensitively at runtime; this persists the
canonical form in preparation for a stricter schema in a future release.

## 12.8.0
- Add configuration option to disable NetBIOS. When disabled, the nmbd service is not started and only port 445 is allowed (port 139 is blocked.)

Expand Down
2 changes: 1 addition & 1 deletion samba/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 12.8.0
version: 12.8.1
slug: samba
name: Samba share
description: Expose Home Assistant folders with SMB/CIFS
Expand Down
15 changes: 15 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 @@ -8,6 +8,8 @@ declare password
declare username
declare config_username
declare samba_username
declare stored_options
declare migration_payload
declare -a interfaces=()
export HOSTNAME

Expand All @@ -21,6 +23,19 @@ 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.
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 ! 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
fi

# Read hostname from API or setting default "hassio"
HOSTNAME=$(bashio::info.hostname)
if bashio::var.is_empty "${HOSTNAME}"; then
Expand Down
Loading