mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-18 18:38:17 +01:00
prettify
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
###################
|
||||
|
||||
Reference in New Issue
Block a user