fix(nfs)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.19
|
||||
FROM ghcr.io/hassio-addons/base:latest
|
||||
RUN apk add --no-cache nfs-utils
|
||||
COPY run.sh /
|
||||
RUN chmod +x /run.sh
|
||||
|
||||
@@ -2,10 +2,11 @@ name: NFS Server
|
||||
version: "1.0.0"
|
||||
slug: nfs_server
|
||||
description: Expose Home Assistant media folder via NFS.
|
||||
arch: [aarch64, amd64, armv7, i386, x86_64]
|
||||
arch: [aarch64, amd64, armv7]
|
||||
privileged: [SYS_ADMIN]
|
||||
apparmor: false
|
||||
host_network: true
|
||||
kernel_modules: true
|
||||
map:
|
||||
- media:rw
|
||||
ports: {}
|
||||
@@ -1,8 +1,3 @@
|
||||
[
|
||||
{
|
||||
"name": "allowed_network",
|
||||
"type": "string",
|
||||
"description": "The network allowed to access the NFS share (e.g., 192.168.1.0/24)",
|
||||
"default": "0.0.0.0/0"
|
||||
"allowed_network": "str"
|
||||
}
|
||||
]
|
||||
@@ -8,6 +8,10 @@ bashio::log.info "Exporting /media folder to ${NETWORK}..."
|
||||
echo "/media ${NETWORK}(rw,sync,no_subtree_check,no_root_squash)" > /etc/exports
|
||||
cat /etc/exports
|
||||
|
||||
# Load NFS kernel module
|
||||
bashio::log.info "Loading nfsd kernel module..."
|
||||
modprobe nfsd 2>/dev/null || bashio::log.warning "nfsd module not available, assuming built-in..."
|
||||
|
||||
# Start NFS services
|
||||
bashio::log.info "Starting NFS services..."
|
||||
rpcbind
|
||||
@@ -15,6 +19,7 @@ exportfs -ra
|
||||
|
||||
# Start rpc.statd for file locking
|
||||
rpc.statd &
|
||||
|
||||
# Start the NFS server kernel threads
|
||||
rpc.nfsd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user