-
-
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 2 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 @@ host_network: true | |
| 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 @@ options: | |
| - 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 @@ schema: | |
| 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 -}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| [global] | ||
| netbios name = {{ env "HOSTNAME" }} | ||
| dns hostname = {{ env "HOSTNAME" }}.local | ||
| additional dns hostnames = {{ env "HOSTNAME" }}._smb._tcp.local | ||
| workgroup = {{ .workgroup }} | ||
| server string = Samba Home Assistant | ||
| local master = {{ .local_master | ternary "yes" "no" }} | ||
| preferred master = {{ .local_master | ternary "yes" "auto" }} | ||
| server role = standalone | ||
| {{ $smb_port := default 445 (index .ports "445/tcp") -}} | ||
| {{ $nbt_port := default 139 (index .ports "139/tcp") -}} | ||
| smb ports = {{ cat $smb_port (ternary $nbt_port nil .netbios) }} | ||
iamGavinJ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| security = user | ||
| idmap config * : backend = tdb | ||
| idmap config * : range = 1000000-2000000 | ||
|
|
||
| load printers = no | ||
| disable spoolss = yes | ||
| {{ if .netbios -}} | ||
| server services = smb nbt | ||
| {{ else -}} | ||
| disable netbios = yes | ||
| server services = smb | ||
| {{ end -}} | ||
| dns proxy = no | ||
|
|
||
| log level = 1 | ||
|
|
||
| bind interfaces only = yes | ||
| interfaces = lo {{ .interfaces | join " " }} | ||
| hosts allow = 127.0.0.1 {{ .allow_hosts | join " " }} | ||
|
|
||
| {{ if .compatibility_mode -}} | ||
| client min protocol = NT1 | ||
| server min protocol = NT1 | ||
| lanman auth = yes | ||
| ntlm auth = yes | ||
| {{ end -}} | ||
|
|
||
| mangled names = no | ||
| dos charset = CP850 | ||
| unix charset = UTF-8 | ||
|
|
||
| {{ if .apple_compatibility_mode -}} | ||
| vfs objects = catia fruit streams_xattr | ||
| {{ end -}} | ||
|
|
||
| server signing = {{ .server_signing }} | ||
| allow dns updates = disabled | ||
|
|
||
| {{ range $i, $share := .enabled_shares -}} | ||
| [{{ $share }}] | ||
| path = /smbshare/{{ ternary "homeassistant" $share ( eq $share "config" ) }} | ||
| include = /etc/samba/smb.conf.inc | ||
| {{ end -}} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| browseable = yes | ||
| writeable = yes | ||
|
|
||
| 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" }} |
Uh oh!
There was an error while loading. Please reload this page.