-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
samba: 12.6.1 #4468
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
base: master
Are you sure you want to change the base?
samba: 12.6.1 #4468
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # macOS | ||
| ._* | ||
| .DS_Store | ||
| .AppleDouble | ||
|
|
||
| .Spotlight-V100 | ||
| .Trashes | ||
| .fseventsd | ||
|
|
||
| .AppleDB | ||
| .AppleDesktop |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| --- | ||
| version: 12.6.0 | ||
| version: 12.6.1 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say this is at least a new feature, so warrants a 12.7.0. |
||
| slug: samba | ||
| name: Samba share | ||
| description: Expose Home Assistant folders with SMB/CIFS | ||
|
|
@@ -12,18 +12,31 @@ | |
| image: homeassistant/{arch}-addon-samba | ||
| init: false | ||
| map: | ||
| - addons:rw | ||
| - all_addon_configs:rw | ||
| - backup:rw | ||
| - homeassistant_config:rw | ||
| - media:rw | ||
| - share:rw | ||
| - ssl:rw | ||
| - type: addons | ||
| read_only: false | ||
| path: "/smbshare/addons" | ||
| - type: all_addon_configs | ||
| read_only: false | ||
| path: "/smbshare/addon_configs" | ||
| - type: backup | ||
| read_only: false | ||
| path: "/smbshare/backup" | ||
| - type: homeassistant_config | ||
| read_only: false | ||
| path: "/smbshare/homeassistant" | ||
| - type: media | ||
| read_only: false | ||
| path: "/smbshare/media" | ||
| - type: share | ||
| read_only: false | ||
| path: "/smbshare/share" | ||
| - type: ssl | ||
| read_only: false | ||
| path: "/smbshare/ssl" | ||
| options: | ||
| username: homeassistant | ||
| password: null | ||
| workgroup: WORKGROUP | ||
| local_master: true | ||
| enabled_shares: | ||
| - addons | ||
| - addon_configs | ||
|
|
@@ -32,9 +45,11 @@ | |
| - media | ||
| - share | ||
| - ssl | ||
| local_master: true | ||
| compatibility_mode: false | ||
| apple_compatibility_mode: true | ||
| server_signing: "default" | ||
| netbios: true | ||
| veto_files: | ||
| - ._* | ||
| - .DS_Store | ||
|
|
@@ -52,14 +67,21 @@ | |
| username: str | ||
| password: password | ||
| workgroup: str | ||
| local_master: bool | ||
| enabled_shares: | ||
| - "match(^(?i:(addons|addon_configs|backup|config|media|share|ssl))$)" | ||
| local_master: bool | ||
| compatibility_mode: bool | ||
| apple_compatibility_mode: bool | ||
| server_signing: list(default|auto|mandatory|disabled) | ||
| netbios: bool | ||
| veto_files: | ||
| - str | ||
| allow_hosts: | ||
| - str | ||
| startup: services | ||
| ports: | ||
| 445/tcp: null | ||
| 139/tcp: null | ||
| ports_description: | ||
| 445/tcp: SMB over IP | ||
| 139/tcp: SMB over NetBIOS | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/command/with-contenv bashio | ||
| # vim: ft=bash | ||
| # shellcheck shell=bash | ||
|
|
||
|
|
||
| if bashio::var.true "$(bashio::addon.host_network)"; then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since |
||
| bashio::log.info "Host network detected. Configuring mDNS" | ||
|
|
||
| # Read hostname from API or setting default "hassio" | ||
| HOSTNAME=$(bashio::info.hostname) | ||
| if bashio::var.is_empty "${HOSTNAME}"; then | ||
| bashio::log.warning "Can't read hostname, using default." | ||
| HOSTNAME="hassio" | ||
| fi | ||
|
|
||
| declare -r smbfile="/etc/mdns.d/smb.service" | ||
| declare -r adiskfile="/etc/mdns.d/adisk.service" | ||
| declare -r _TMP="$(mktemp -d -t mdnsd.XXXXXX)" | ||
| rm -f -v "${smbfile}" "${adiskfile}" | ||
|
|
||
| # Generate JSON configuration for tempio | ||
| jq -c " | ||
| .ports = $(bashio::addon.network) | ||
| | .sambaversion = \"$(smbstatus --version | cut -d '[ \t]+' -F 2)\" | ||
| " /data/options.json > "${_TMP}/options.json" | ||
|
|
||
| # Generate _smb._tcp service advertisement | ||
| tempio \ | ||
| -conf "${_TMP}/options.json" \ | ||
| -template /usr/share/tempio/smb.service.gtpl \ | ||
| -out ${smbfile} | ||
|
|
||
| # Generate _adisk._tcp service advertisement | ||
| tempio \ | ||
| -conf "${_TMP}/options.json" \ | ||
| -template /usr/share/tempio/adisk.service.gtpl \ | ||
| -out ${adiskfile} | ||
|
|
||
| builtin exec $(which mdnsd) -n -i $(bashio::network.name) | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| longrun |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /etc/s6-overlay/s6-rc.d/discovery/run |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,12 @@ | |
| # ============================================================================== | ||
| # Start nmbd service | ||
| # ============================================================================== | ||
| exec nmbd \ | ||
|
|
||
| if ! bashio::config.true 'netbios'; then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a cleaner way to enable/disable services, have a look at |
||
| builtin exec sleep infinity | ||
| fi | ||
|
|
||
| builtin exec nmbd \ | ||
| --foreground \ | ||
| --debug-stdout \ | ||
| --no-process-group | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # /etc/mdns.d/adisk.service -- mDNS-SD _adisk._tcp for macOS Finder | ||
| # macOS uses _adisk._tcp TXT records to discover SMB shares and honours | ||
| # the port from the companion _smb._tcp SRV record. | ||
| name {{ env "HOSTNAME" }} | ||
| type _adisk._tcp | ||
| port 9 | ||
| txt sys=adVF=0x100 | ||
| {{ range $i, $share := .enabled_shares -}} | ||
| txt dk{{ $i }}=adVN={{ $share }},adVF=0x80 | ||
| {{ end -}} |
Uh oh!
There was an error while loading. Please reload this page.