This commit is contained in:
Alexandre
2021-02-21 20:07:55 +01:00
parent fc2282f62e
commit db5582cb74
18 changed files with 113 additions and 219 deletions

View File

@@ -1,5 +1,5 @@
## 2.11.0
- Update to latest version from hurlenko/filebrowser-docker
- Added ssl
- New feature : mount smb share in protected mode

View File

@@ -6,12 +6,7 @@
"description": "filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files",
"url": "https://github.com/alexbelgium/hassio-addons",
"startup": "services",
"arch": [
"aarch64",
"amd64",
"armv7",
"armhf"
],
"arch": ["aarch64", "amd64", "armv7", "armhf"],
"ports": {
"8080/tcp": 8087
},
@@ -20,26 +15,19 @@
},
"apparmor": true,
"privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"],
"map": [
"media:rw",
"config:rw",
"addons:rw",
"backup:rw",
"share:rw",
"ssl"
],
"map": ["media:rw", "config:rw", "addons:rw", "backup:rw", "share:rw", "ssl"],
"webui": "[PROTO:ssl]://[HOST]:[PORT:8080]",
"environment": {
"FB_BASEURL": "/filebrowser"
"FB_BASEURL": "/filebrowser"
},
"options": {
"ssl": false,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"networkdisks": "//server/share",
"cifsusername": "username",
"cifspassword": "password",
"smbv1": false
"ssl": false,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"networkdisks": "//server/share",
"cifsusername": "username",
"cifspassword": "password",
"smbv1": false
},
"schema": {
"ssl": "bool",

View File

@@ -11,33 +11,32 @@ PGID=0
# MOUNT SMB SHARES v1.1 #
#########################
if bashio::config.has_value 'networkdisks'; then
# Mount CIFS Share if configured and if Protection Mode is active
bashio::log.info 'Mounting smb share(s)...'
# Mount CIFS Share if configured and if Protection Mode is active
bashio::log.info 'Mounting smb share(s)...'
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
# Allow SMB1
if bashio::config.true 'smbv1'; then
SMBVERS=",vers=1.0"
else
SMBVERS=",vers=2.1"
fi
# Allow SMB1
if bashio::config.true 'smbv1'; then
SMBVERS=",vers=1.0"
else
SMBVERS=",vers=2.1"
fi
# Mounting disks
for disk in ${MOREDISKS//,/ } # Separate comma separated values
do
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk##*/} # Get only last part of the name
rm -r /mnt/$diskname 2>/dev/null || true # Create dir
mkdir -p /mnt/$diskname # Create dir
chown -R root:root /mnt/$diskname # Permissions
mount -t cifs -o username=$CIFS_USERNAME,password=${CIFS_PASSWORD}${SMBVERS} $disk /mnt/$diskname \
&& bashio::log.info "... $disk successfully mounted to /mnt/$diskname" \
|| bashio::log.error "Unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD"
done || true
# Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk##*/} # Get only last part of the name
rm -r /mnt/$diskname 2>/dev/null || true # Create dir
mkdir -p /mnt/$diskname # Create dir
chown -R root:root /mnt/$diskname # Permissions
mount -t cifs -o username=$CIFS_USERNAME,password=${CIFS_PASSWORD}${SMBVERS} $disk /mnt/$diskname &&
bashio::log.info "... $disk successfully mounted to /mnt/$diskname" ||
bashio::log.error "Unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD"
done || true
fi
###################