mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 13:14:21 +01:00
Add support for Samba veto files (#783)
* Add support for Samba veto files * Clean up if statement per review * Update CHANGELOG.md
This commit is contained in:
committed by
Pascal Vizeli
parent
ab639b7427
commit
714bcfb34d
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 9.0
|
||||||
|
|
||||||
|
- New option `veto_files` to limit writing of specified files to the share
|
||||||
|
|
||||||
## 8.3
|
## 8.3
|
||||||
|
|
||||||
- Fixes a bug in warning log message, causing start failure
|
- Fixes a bug in warning log message, causing start failure
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ Add-on configuration:
|
|||||||
"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"
|
||||||
|
],
|
||||||
|
"veto_files": [
|
||||||
|
"._*",
|
||||||
|
".DS_Store",
|
||||||
|
"Thumbs.db"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -57,7 +62,9 @@ Change WORKGROUP to reflect your network needs.
|
|||||||
|
|
||||||
List of hosts/networks allowed to access your configuration.
|
List of hosts/networks allowed to access your configuration.
|
||||||
|
|
||||||
|
### Option: `veto_files` (optional)
|
||||||
|
|
||||||
|
List of files that are neither visible nor accessible. Useful to stop clients from littering the share with temporary hidden files (ex: macOS .DS_Store, Windows Thumbs.db)
|
||||||
|
|
||||||
## Known issues and limitations
|
## Known issues and limitations
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Samba share",
|
"name": "Samba share",
|
||||||
"version": "8.3",
|
"version": "9.0",
|
||||||
"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/",
|
||||||
@@ -30,6 +30,13 @@
|
|||||||
"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"
|
||||||
|
],
|
||||||
|
"veto_files": [
|
||||||
|
"._*",
|
||||||
|
".DS_Store",
|
||||||
|
"Thumbs.db",
|
||||||
|
"icon?",
|
||||||
|
".Trashes"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
@@ -39,7 +46,10 @@
|
|||||||
"interface": "str",
|
"interface": "str",
|
||||||
"allow_hosts": [
|
"allow_hosts": [
|
||||||
"str"
|
"str"
|
||||||
|
],
|
||||||
|
"veto_files": [
|
||||||
|
"str"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"image": "homeassistant/{arch}-addon-samba"
|
"image": "homeassistant/{arch}-addon-samba"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ INTERFACE=$(bashio::config 'interface')
|
|||||||
ALLOW_HOSTS=$(bashio::config "allow_hosts | join(\" \")")
|
ALLOW_HOSTS=$(bashio::config "allow_hosts | join(\" \")")
|
||||||
USERNAME=$(bashio::config 'username')
|
USERNAME=$(bashio::config 'username')
|
||||||
PASSWORD=$(bashio::config 'password')
|
PASSWORD=$(bashio::config 'password')
|
||||||
|
DELETE_VETO_FILES="no"
|
||||||
|
VETO_FILES=$(bashio::config "veto_files | join(\"/\")")
|
||||||
|
if bashio::config.has_value 'veto_files'; then
|
||||||
|
VETO_FILES="/$VETO_FILES/"
|
||||||
|
DELETE_VETO_FILES="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
WAIT_PIDS=()
|
WAIT_PIDS=()
|
||||||
|
|
||||||
@@ -27,6 +33,8 @@ sed -i "s|%%NAME%%|${NAME}|g" /etc/smb.conf
|
|||||||
sed -i "s|%%INTERFACE%%|${INTERFACE}|g" /etc/smb.conf
|
sed -i "s|%%INTERFACE%%|${INTERFACE}|g" /etc/smb.conf
|
||||||
sed -i "s|%%USERNAME%%|${USERNAME}|g" /etc/smb.conf
|
sed -i "s|%%USERNAME%%|${USERNAME}|g" /etc/smb.conf
|
||||||
sed -i "s#%%ALLOW_HOSTS%%#${ALLOW_HOSTS}#g" /etc/smb.conf
|
sed -i "s#%%ALLOW_HOSTS%%#${ALLOW_HOSTS}#g" /etc/smb.conf
|
||||||
|
sed -i "s|%%VETO_FILES%%|${VETO_FILES}|g" /etc/smb.conf
|
||||||
|
sed -i "s|%%DELETE_VETO_FILES%%|${DELETE_VETO_FILES}|g" /etc/smb.conf
|
||||||
|
|
||||||
# Init users
|
# Init users
|
||||||
addgroup "${USERNAME}"
|
addgroup "${USERNAME}"
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
valid users = %%USERNAME%%
|
valid users = %%USERNAME%%
|
||||||
force user = root
|
force user = root
|
||||||
force group = root
|
force group = root
|
||||||
|
veto files = %%VETO_FILES%%
|
||||||
|
delete veto files = %%DELETE_VETO_FILES%%
|
||||||
|
|
||||||
[addons]
|
[addons]
|
||||||
browseable = yes
|
browseable = yes
|
||||||
@@ -32,6 +34,8 @@
|
|||||||
valid users = %%USERNAME%%
|
valid users = %%USERNAME%%
|
||||||
force user = root
|
force user = root
|
||||||
force group = root
|
force group = root
|
||||||
|
veto files = %%VETO_FILES%%
|
||||||
|
delete veto files = %%DELETE_VETO_FILES%%
|
||||||
|
|
||||||
[ssl]
|
[ssl]
|
||||||
browseable = yes
|
browseable = yes
|
||||||
@@ -41,6 +45,8 @@
|
|||||||
valid users = %%USERNAME%%
|
valid users = %%USERNAME%%
|
||||||
force user = root
|
force user = root
|
||||||
force group = root
|
force group = root
|
||||||
|
veto files = %%VETO_FILES%%
|
||||||
|
delete veto files = %%DELETE_VETO_FILES%%
|
||||||
|
|
||||||
[share]
|
[share]
|
||||||
browseable = yes
|
browseable = yes
|
||||||
@@ -50,6 +56,8 @@
|
|||||||
valid users = %%USERNAME%%
|
valid users = %%USERNAME%%
|
||||||
force user = root
|
force user = root
|
||||||
force group = root
|
force group = root
|
||||||
|
veto files = %%VETO_FILES%%
|
||||||
|
delete veto files = %%DELETE_VETO_FILES%%
|
||||||
|
|
||||||
[backup]
|
[backup]
|
||||||
browseable = yes
|
browseable = yes
|
||||||
@@ -59,3 +67,5 @@
|
|||||||
valid users = %%USERNAME%%
|
valid users = %%USERNAME%%
|
||||||
force user = root
|
force user = root
|
||||||
force group = root
|
force group = root
|
||||||
|
veto files = %%VETO_FILES%%
|
||||||
|
delete veto files = %%DELETE_VETO_FILES%%
|
||||||
|
|||||||
Reference in New Issue
Block a user