Skip to content

Commit

Permalink
Update SambaNAS to v10.0.2-nas4c
Browse files Browse the repository at this point in the history
## 10.0.2-nas4c

###  ✨ Features
- Move addon config in `addons_config`
- Move homeassistant config in `homeassistant_config`

### 💥 BREAKING CHANGE
- Drop support for `armhf` and `i386`
- **This is the last version with** `mqtt_use_legacy_entities`. Legacy implementation will be removed in next version.

### 🏗 Chore
- [Full Changelog from official addon 12.1.0][changelog_12.1.0]
  - Use the new Home Assistant folder for the config share
  - Add support for accessing public add-on configurations
- [Full Changelog from official addon 12.0.0][changelog_12.0.0]
  - Adjust location of Home Assistant config to match latest dev/beta Supervisor
- [Full Changelog from official addon 11.0.0][changelog_11.0.0]
  - Add support for accessing public add-on configurations
  - Update Based Image to 14.3.2 (Alpine 3.18.4)
  - Adds HEALTCHECK support
- [Full Changelog from official addon 10.0.2][changelog_10.0.2]
  - Already Implemented: Enable IPv6 ULA and IPv4 link-local addresses by default

###  🩹 BugFix

[changelog_12.1.0]: home-assistant/addons#3312
[changelog_12.0.0]: home-assistant/addons#3311
[changelog_11.1.0]: home-assistant/addons#3001
[changelog_11.0.0]: home-assistant/addons#3297
[changelog_10.0.2]: home-assistant/addons#3062
[changelog_10.0.1]: home-assistant/addons#2997
[changelog_12.2.0]: home-assistant/addons#3002
  • Loading branch information
danveitch76 committed Feb 25, 2024
1 parent d9d568d commit bd59936
Show file tree
Hide file tree
Showing 50 changed files with 67 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
* text=auto eol=lf
Empty file modified build.sh
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/cron/finish
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/cron/run
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/init-scan/finish
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/init-scan/up
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/install-pialert/finish
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/install-pialert/up
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/lighttpd/finish
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/s6-rc.d/lighttpd/run
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/etc/s6-overlay/scripts/install-pialert.sh
100644 → 100755
Empty file.
Empty file modified pialert/rootfs/root/pialert/back/update_vendors.sh
100644 → 100755
Empty file.
Empty file.
Empty file.
36 changes: 35 additions & 1 deletion sambanas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
# Changelog

## 10.0.2-nas4a
## 10.0.2-nas4c

### ✨ Features
- Move addon config in `addons_config`
- Move homeassistant config in `homeassistant_config`

### 💥 BREAKING CHANGE
- Drop support for `armhf` and `i386`
- **This is the last version with** `mqtt_use_legacy_entities`. Legacy implementation will be removed in next version.

### 🏗 Chore
- [Full Changelog from official addon 12.1.0][changelog_12.1.0]
- Use the new Home Assistant folder for the config share
- Add support for accessing public add-on configurations
- [Full Changelog from official addon 12.0.0][changelog_12.0.0]
- Adjust location of Home Assistant config to match latest dev/beta Supervisor
- [Full Changelog from official addon 11.0.0][changelog_11.0.0]
- Add support for accessing public add-on configurations
- Update Based Image to 14.3.2 (Alpine 3.18.4)
- Adds HEALTCHECK support
- [Full Changelog from official addon 10.0.2][changelog_10.0.2]
- Already Implemented: Enable IPv6 ULA and IPv4 link-local addresses by default

### 🩹 BugFix


[changelog_12.1.0]: https://github.com/home-assistant/addons/pull/3312
[changelog_12.0.0]: https://github.com/home-assistant/addons/pull/3311
[changelog_11.1.0]: https://github.com/home-assistant/addons/pull/3001
[changelog_11.0.0]: https://github.com/home-assistant/addons/pull/3297
[changelog_10.0.2]: https://github.com/home-assistant/addons/pull/3062
[changelog_10.0.1]: https://github.com/home-assistant/addons/pull/2997
[changelog_12.2.0]: https://github.com/home-assistant/addons/pull/3002

## 10.0.2-nas4b
### ✨ Features
- Added additional architectures

Expand Down
23 changes: 15 additions & 8 deletions sambanas/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ARG CLI_VERSION
RUN apk add --no-cache \
samba-common-tools \
samba-server \
samba-client \
dbus \
exfatprogs \
btrfs-progs \
Expand All @@ -80,7 +81,9 @@ RUN apk add --no-cache \
wsdd \
udisks2 \
libcap \
hd-idle
hd-idle \
fuse3 \
py3-pip

# HDDTEMP
ARG HDDTEMP_VERSION
Expand All @@ -90,7 +93,6 @@ RUN curl http://download.savannah.nongnu.org/releases/hddtemp/hddtemp.db -Lso /
# WSDD2
COPY --from=builder /wsdd2-master/wsdd2 /usr/sbin


# SAMBA Config
RUN mkdir -p /var/lib/samba \
&& touch \
Expand All @@ -103,16 +105,21 @@ RUN mkdir -p /var/lib/samba \
RUN curl -Lso /usr/bin/ha "https://github.com/home-assistant/cli/releases/download/${CLI_VERSION}/ha_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/ha


#RUN echo "devtmpfs /dev_ devtmpfs rw,relatime,size=1965288k,nr_inodes=182901,mode=755 0 0" >> /etc/fstab

# Copy data
COPY rootfs /
RUN for f in $(find . -name 'run'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
for f in $(find . -name 'finish'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
for f in $(find . -name 'down'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
for f in $(find . -name 'up'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
for f in $(find . -name '*.sh'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done

# Fix for Windows Permissions to run scripts
# RUN for f in $(find . -name 'run'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
# for f in $(find . -name 'finish'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
# for f in $(find . -name 'down'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
# for f in $(find . -name 'up'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done && \
# for f in $(find . -name '*.sh'); do (cd "$(dirname $f)" && chmod 0755 "$(basename $f)") done

HEALTHCHECK \
CMD smbclient -L '\\localhost' -U '%' -m SMB3

# Labels
LABEL \
io.hass.name="${BUILD_NAME}" \
Expand Down
8 changes: 3 additions & 5 deletions sambanas/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/base:14.0.1
amd64: ghcr.io/hassio-addons/base:14.0.1
armhf: ghcr.io/hassio-addons/base:14.0.1
armv7: ghcr.io/hassio-addons/base:14.0.1
i386: ghcr.io/hassio-addons/base:14.0.1
aarch64: ghcr.io/hassio-addons/base:15.0.7
amd64: ghcr.io/hassio-addons/base:15.0.7
armv7: ghcr.io/hassio-addons/base:15.0.7
codenotary:
signer: [email protected]
base_image: [email protected]
Expand Down
7 changes: 4 additions & 3 deletions sambanas/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Samba NAS
version: 10.0.2-nas4b
version: 10.0.2-nas4c
slug: sambanas
description: Expose Home Assistant disc with SMB/CIFS
url: https://github.com/danveitch76/hassio-addons/tree/master/sambanas
Expand All @@ -17,9 +17,10 @@ hassio_api: true
hassio_role: admin
host_network: true
map:
- config:rw
- homeassistant_config:rw
- addon_config:rw
- ssl:rw
- addons:rw
- all_addon_configs:rw
- share:rw
- backup:rw
- media:rw
Expand Down
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/avahi/finish
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/avahi/run
100644 → 100755
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion sambanas/rootfs/etc/s6-overlay/s6-rc.d/cifs-supervisor-mount/finish
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [ -f /tmp/cifs_network ]; then
available_shares=$(awk '/\[(.*)\]/{ DISK=substr($1,2,length($1)-2); next } /.*path =(.*)/{ printf "%s\n",DISK,$0 }' /etc/samba/smb.conf)

while read -r -a device; do
[[ "share config addons ssl backup media" =~ $device ]] && continue
[[ "share config addons ssl backup media all_addon_configs homeassistant" =~ $device ]] && continue
status=$(bashio::api.supervisor DELETE /mounts/${device})
bashio::log.info "Return from Umount ${status}"
done <<<"${available_shares}"
Expand Down
5 changes: 3 additions & 2 deletions sambanas/rootfs/etc/s6-overlay/s6-rc.d/cifs-supervisor-mount/run
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ if [ -f /tmp/cifs_network ]; then

bashio::log "Wait Samba Server to going up..(max 30s)"
timeout 30 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' ${ipaddress/\/*/} 445

smbstatus

while read -r -a device; do
[[ "share config addons ssl backup media" =~ $device ]] && continue
[[ ${device,,} == @(share|config|addons|ssl|backup|media|addon_config|all_addon_configs|homeassistant) ]] && continue
usage=$(jq -r --arg xshare "$device" '.acl[] | select(.share==$xshare) | .usage // "media"' <<<"$(bashio::addon.config)")
cmdshare=$(jq -nrc --arg usage "${usage:-media}" --arg share "$device" --arg ip "${ipaddress/\/*/}" --arg user "$username" --arg pwd "$password" '.name=$share|.usage=$usage|.type="cifs"|.server=$ip|.share=$share|.username=$user|.password=$pwd')
#bashio::log.info "${cmdshare}"
Expand Down
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/cifs-supervisor-mount/up
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/hd-idle/finish
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/hd-idle/run
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/down
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/finish
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/run
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function reserved_mount_name () { # $1 cleanmountdisks
reservedmoutdisks=()
tomountdisks=()
removed_reserved_names=false
reserved_names=(config addons ssl share backup media)
reserved_names=(config addons ssl share backup media all_addon_configs homeassistant)
for disk in "${reserved_names[@]}"; do
if [[ ${cleanmountdisks[@]} =~ $disk ]]; then
cleanmountdisks=("${cleanmountdisks[@]/$disk}")
Expand Down
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/up
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-mqtt/run
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-mqtt/up
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-samba/run
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-samba/up
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-smartd/run
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-smartd/up
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/mqtt-disk-handler/finish
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion sambanas/rootfs/etc/s6-overlay/s6-rc.d/mqtt-disk-handler/run
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ -f /root/.config/mosquitto_pub ]; then
hw_version: $addon,
sw_version: $smbv,
model: "SambaNas",
manufacturer: "danveitch76",
manufacturer: "@danveitch76",
via_device: $topic
}}')

Expand Down
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/mqtt-handler/finish
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion sambanas/rootfs/etc/s6-overlay/s6-rc.d/mqtt-handler/run
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [ -f /root/.config/mosquitto_pub ]; then
hw_version: $addon,
sw_version: $smbv,
model: "SambaNas",
manufacturer: "danveitch76",
manufacturer: "@danveitch76",
via_device: $topic
}}')

Expand Down
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/nmbd/finish
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/nmbd/run
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/smbd/finish
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/smbd/run
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/wsdd/finish
100644 → 100755
Empty file.
Empty file modified sambanas/rootfs/etc/s6-overlay/s6-rc.d/wsdd/run
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion sambanas/rootfs/usr/local/bin/mqtt_daemon.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ -f /root/.config/mosquitto_pub ] && ! bashio::config.true "autodiscovery.di
a=({a..z})
if ! bashio::config.true "autodiscovery.disable_persistent"; then prs="-r"; fi
bashio::log.info "Sending MQTT autodiscovery..."
device="\"device\":{\"identifiers\":[\"${topic}\"],\"name\": \"Samba Nas Sensors\", \"model\": \"Samba $(smbd -V)\", \"manufacturer\": \"danveitch76\"},\"icon\":\"mdi:harddisk\""
device="\"device\":{\"identifiers\":[\"${topic}\"],\"name\": \"Samba Nas Sensors\", \"model\": \"Samba $(smbd -V)\", \"manufacturer\": \"@danveitch76\"},\"icon\":\"mdi:harddisk\""
for disk in $(awk '/^ path = .*/g { print $3 }' /etc/samba/smb.conf); do
ldisk=${disk##*/}
mosquitto_pub ${prs} -t "homeassistant/sensor/${topic}/${a}_size/config" -m \
Expand Down
2 changes: 1 addition & 1 deletion sambanas/rootfs/usr/share/tempio/smb.gtpl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
fruit:locking = none{{ end }}
{{ end }}
{{- $dfdisk := list "config" "addons" "ssl" "share" "backup" "media" }}
{{- $dfdisk := list "config" "addons" "ssl" "share" "backup" "media" "addon_configs" }}
{{- $disks := concat $dfdisk (compact .moredisks|default list) -}}
{{- $root := . -}}
{{- range $disk := $disks -}}
Expand Down
Empty file modified speedtest/rootfs/etc/s6-overlay/s6-rc.d/speedtest/finish
100644 → 100755
Empty file.
Empty file modified speedtest/rootfs/etc/s6-overlay/s6-rc.d/speedtest/run
100644 → 100755
Empty file.

0 comments on commit bd59936

Please sign in to comment.