May 18May 18 @zapbranagann PM as they are the owners of the samba version..https://forums.unraid.net/topic/195826-plugin-custom-smb-shares/By using their GitHub and example plugin code project...By using the smb custom github as a base for the plugin...https://github.com/cslemieux/unraid-custom-smb-sharesHere is a generic base setup to redeploy a similar plugin... I made a first-pass Unraid Custom NFS Shares scaffold based on the GitHub page SMB plugin:What it does now:Adds a new plugin namespace: custom.nfs.sharesAdds Unraid pages:NFSShares.pageNFSSharesAdd.pageNFSSharesUpdate.pageNFSSharesSettings.pageStores persistent share definitions here:/boot/config/plugins/custom.nfs.shares/shares.jsonGenerates a persistent export file here:/boot/config/plugins/custom.nfs.shares/custom-nfs-shares.exportsMirrors the runtime export drop-in here:/etc/exports.d/custom-nfs-shares.exportsApplies changes with:exportfs -raShows status with:exportfs -vThat matches the NFS-utils behavior: after /etc/exports, exportfs also reads extra export tables from /etc/exports.d, but only files ending in .exports are considered. The exportfs -ra reload path is also the right mechanism for re-exporting definitions without a full service restart. Some Important caveats before this touches a real Unraid box:Treat this as a development scaffold, not a release-ready plugin.I ported the core CRUD/config/reload shape, but the full test suite from the SMB plugin is not ported.Test quoted export paths.The generator currently emits paths using PHP escapeshellarg(), like:'/mnt/user/media' 192.168.1.0/24(rw,sync,no_subtree_check,root_squash)If Unraid’s NFS-utils rejects quoted paths in /etc/exports.d, we should switch that function to backslash-escape spaces instead.Confirm Unraid NFS service behavior.The scaffold assumes NFS service is enabled already. If NFS is disabled in Unraid Settings, exportfs -ra may fail or do nothing useful.The plugin XML still has placeholder release metadata.In custom.nfs.shares.plg, replace:<!ENTITY github "YOUR_GITHUB_USER/unraid-custom-nfs-shares"> <!ENTITY md5 "00000000000000000000000000000000">*For Deployment...Build script included.From the scaffold root:./build.sh 2026.05.17-devThe core file to review first is:source/usr/local/emhttp/plugins/custom.nfs.shares/include/lib.phpThat is where the NFS export line generation, validation, /etc/exports.d writing, exportfs -ra, and exportfs -v status logic live...This is more to add custom sub folder sharing to nfs by adding to the /etc/exports.d/ .......On modern Linux systems, you cannot use a direct "include" directive within the /etc/exports file itself. Instead, the NFS server automatically supports multiple configuration files via a drop-in directory located at /etc/exports.d/Using the /etc/exports.d/ DirectoryThe exportfs command, which maintains the kernel's export table, is designed to read both the master /etc/exports file and any files ending in .exports within the /etc/exports.d/ directory.How to use it: Create a new file in that directory (e.g., /etc/exports.d/additional_shares.exports) and add your share definitions there using the standard exports syntax.Applying changes: After adding or modifying files in this directory, run the following command to refresh the export table without restarting the service:bashexportfs -ra Use code with caution.The -r flag re-exports all directories, synchronizing the kernel's table with /etc/exports and everything under /etc/exports.d/I really don't want to support a plugin repo... but think that nfs should have a similar option as samba does on unraid...
May 18May 18 Hey @bmartino1, I replied via PM but I'll mention it here as well, I'll use your skeleton as a base and roll out a NFS version as well as a separate plugin.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.