samba: Fixes startup error and some minor cleanups (#778)

This commit is contained in:
Franck Nijhof
2019-10-13 14:56:20 +02:00
committed by GitHub
parent c5a8f91e21
commit f652c2573f
5 changed files with 44 additions and 18 deletions

View File

@@ -1,30 +1,44 @@
# Changelog # Changelog
## 8.3
- Fixes a bug in warning log message, causing start failure
- Minor code cleanups
## 8.2 ## 8.2
- Update from bash to bashio - Update from bash to bashio
## 8.1 ## 8.1
- Update Samba to version 4.8.8 - Update Samba to version 4.8.8
## 8.0 ## 8.0
- Fix access to /backup - Fix access to /backup
## 7.0 ## 7.0
- Remove guest access - Remove guest access
- Cleanup structure - Cleanup structure
- Use hostname for samba device name - Use hostname for samba device name
## 6.0 ## 6.0
- Enable ntlm auth for Windows10 - Enable ntlm auth for Windows10
## 5.0 ## 5.0
- Update Samba to version 4.8.4 - Update Samba to version 4.8.4
## 4.1 ## 4.1
- Bugfix sed command - Bugfix sed command
## 4.0 ## 4.0
- New option `allow_hosts` to limit access - New option `allow_hosts` to limit access
## 3.0 ## 3.0
- Update base image - Update base image

View File

@@ -6,7 +6,9 @@ ENV LANG C.UTF-8
# Setup base # Setup base
RUN apk add --no-cache \ RUN apk add --no-cache \
curl samba-server samba-common-tools curl \
samba-common-tools \
samba-server
# Copy data # Copy data
COPY run.sh / COPY run.sh /

View File

@@ -19,12 +19,10 @@ The installation of this add-on is straightforward and easy to do.
## How to use ## How to use
In the configuration section, define a username and password and save the configuration 1. In the configuration section, set a username and password.
2. Save the configuration.
3. Start the add-on.
1. Start the add-on. 4. Check the add-on log output to see the result.
2. Have some patience and wait a couple of minutes.
3. Check the add-on log output to see the result.
## Configuration ## Configuration

View File

@@ -1,23 +1,35 @@
{ {
"name": "Samba share", "name": "Samba share",
"version": "8.2", "version": "8.3",
"slug": "samba", "slug": "samba",
"description": "Expose Hass.io folders with SMB/CIFS", "description": "Expose Hass.io folders with SMB/CIFS",
"url": "https://home-assistant.io/addons/samba/", "url": "https://home-assistant.io/addons/samba/",
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], "arch": [
"armhf",
"armv7",
"aarch64",
"amd64",
"i386"
],
"startup": "services", "startup": "services",
"boot": "auto", "boot": "auto",
"host_network": true, "host_network": true,
"map": ["config:rw", "ssl:rw", "addons:rw", "share:rw", "backup:rw"], "map": [
"config:rw",
"ssl:rw",
"addons:rw",
"share:rw",
"backup:rw"
],
"options": { "options": {
"workgroup": "WORKGROUP", "workgroup": "WORKGROUP",
"username": "hassio", "username": "hassio",
"password": null, "password": null,
"interface": "", "interface": "",
"allow_hosts": [ "allow_hosts": [
"10.0.0.0/8", "10.0.0.0/8",
"172.16.0.0/12", "172.16.0.0/12",
"192.168.0.0/16" "192.168.0.0/16"
] ]
}, },
"schema": { "schema": {
@@ -25,7 +37,9 @@
"username": "str", "username": "str",
"password": "str", "password": "str",
"interface": "str", "interface": "str",
"allow_hosts": ["str"] "allow_hosts": [
"str"
]
}, },
"image": "homeassistant/{arch}-addon-samba" "image": "homeassistant/{arch}-addon-samba"
} }

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env bashio #!/usr/bin/env bashio
set -e
WORKGROUP=$(bashio::config 'workgroup') WORKGROUP=$(bashio::config 'workgroup')
INTERFACE=$(bashio::config 'interface') INTERFACE=$(bashio::config 'interface')
@@ -8,7 +7,6 @@ USERNAME=$(bashio::config 'username')
PASSWORD=$(bashio::config 'password') PASSWORD=$(bashio::config 'password')
WAIT_PIDS=() WAIT_PIDS=()
NAME=
# Check Login data # Check Login data
if ! bashio::config.has_value 'username' || ! bashio::config.has_value 'password'; then if ! bashio::config.has_value 'username' || ! bashio::config.has_value 'password'; then
@@ -18,7 +16,7 @@ fi
# Read hostname from API or setting default "hassio" # Read hostname from API or setting default "hassio"
NAME=$(bashio::info.hostname) NAME=$(bashio::info.hostname)
if bashio::var.is_empty "${NAME}"; then if bashio::var.is_empty "${NAME}"; then
bashio::log.warn "Can't read hostname, using default." bashio::log.warning "Can't read hostname, using default."
NAME="hassio" NAME="hassio"
fi fi
bashio::log.info "Hostname: ${NAME}" bashio::log.info "Hostname: ${NAME}"