feat(nfs): add root_squash option per share, default true for security
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "NFS Server",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"slug": "nfs_server",
|
||||
"description": "Expose Home Assistant media folder via NFS.",
|
||||
"arch": [
|
||||
@@ -26,7 +26,8 @@
|
||||
{
|
||||
"folder": "media",
|
||||
"allowed_network": "192.168.1.0/24",
|
||||
"read_only": false
|
||||
"read_only": false,
|
||||
"root_squash": true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -35,7 +36,8 @@
|
||||
{
|
||||
"folder": "str",
|
||||
"allowed_network": "str",
|
||||
"read_only": "bool"
|
||||
"read_only": "bool",
|
||||
"root_squash": "bool"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
11
nfs/run.sh
11
nfs/run.sh
@@ -15,12 +15,19 @@ else
|
||||
FOLDER=$(jq -r ".shares[${i}].folder" "${CONFIG}")
|
||||
NETWORK=$(jq -r ".shares[${i}].allowed_network" "${CONFIG}")
|
||||
READ_ONLY=$(jq -r ".shares[${i}].read_only" "${CONFIG}")
|
||||
ROOT_SQUASH=$(jq -r ".shares[${i}].root_squash" "${CONFIG}")
|
||||
MOUNT_PATH="/${FOLDER}"
|
||||
|
||||
if [ "${READ_ONLY}" = "true" ]; then
|
||||
OPTIONS="ro,no_root_squash"
|
||||
OPTIONS="ro"
|
||||
else
|
||||
OPTIONS="rw,no_root_squash"
|
||||
OPTIONS="rw"
|
||||
fi
|
||||
|
||||
if [ "${ROOT_SQUASH}" = "true" ]; then
|
||||
OPTIONS="${OPTIONS},root_squash"
|
||||
else
|
||||
OPTIONS="${OPTIONS},no_root_squash"
|
||||
fi
|
||||
|
||||
bashio::log.info "Exporting ${MOUNT_PATH} to ${NETWORK} (${OPTIONS})..."
|
||||
|
||||
Reference in New Issue
Block a user