{{define "content"}} {{template "flash" .}} {{with .Data}} {{if .ApplyErr}}
Configuration saved but not applied: {{.ApplyErr}}
{{end}} {{range .Mountpoints}}

SMB (Windows / macOS network shares) {{if not .Svc.SMBInstalled}}not installed {{else if .Svc.SMBActive}}running {{.Svc.SMBSessions}} session(s) {{else}}stopped{{end}}

{{if not .Svc.SMBInstalled}}

Samba is not installed — run sudo apt install samba wsdd on the NAS (install.sh does it). Shares can be defined now and are applied once Samba is there.

{{end}}
 

Shares

{{range .C.SMB.Shares}} {{else}}{{end}}
NamePathAccessWhoConnect as
{{.Name}}{{if .Comment}} {{.Comment}}{{end}}{{if not .Browseable}} hidden{{end}} {{.Path}} {{if .ReadOnly}}read-only{{else}}read/write{{end}} {{if .Guest}}guest (no password){{else}}{{join .Users ", "}}{{end}} \\{{$.Data.Host}}\{{.Name}} edit ·
No SMB shares yet.
{{if .Form.New}}New share{{else}}Edit share {{.Form.Orig}}{{end}}
Allowed users (when guest access is off) {{range .Users}}{{else}}no SMB users yet — add one below{{end}}

Path: any folder on the NAS — a ZFS dataset, a USB disk under /mnt or /media, /srv… System directories (/etc, /usr, /var…) are refused.

Files are read and written as {{.Owner}} regardless of the SMB user, so containers and shares see the same ownership.

{{if not .Form.New}}cancel{{end}}

SMB users

{{range .Users}}{{else}}{{end}}
{{.}}
No SMB users. Guest shares work without users.
{{range .Users}}
 

Windows: \\{{.Host}}\share in Explorer, or map a network drive. macOS: Finder → Go → Connect to Server → smb://{{.Host}}/share. Note: Windows 10/11 Pro/Enterprise refuse guest shares by default (error 0x80070035 «network path not found») — use an SMB user with a password, or allow guest access on the PC (gpedit: Lanman Workstation → Enable insecure guest logons). If a password share still gives 0x80070035, connect explicitly: net use \\{{.Host}}\share /user:<name> * (Windows keeps one login per server — run net use * /delete first).

NFS (Linux / other NAS) {{if not .Svc.NFSInstalled}}not installed {{else if .Svc.NFSActive}}running {{else}}stopped{{end}}

{{if not .Svc.NFSInstalled}}

NFS server is not installed — run sudo apt install nfs-kernel-server on the NAS (install.sh does it).

{{end}}
 
{{range .C.NFS.Exports}} {{else}}{{end}}
PathClientsAccessSquashMount
{{.Path}} {{join .Clients ", "}} {{if .ReadOnly}}read-only{{else}}read/write{{end}}{{if .Async}} async{{end}} {{.Squash}} {{$.Data.Host}}:{{.Path}} edit ·
No NFS exports yet.
{{if .NForm.New}}New export{{else}}Edit export {{.NForm.Orig}}{{end}}

Filesystems mounted below the path (nested datasets, disks) are exported too (crossmnt). Clients: host names, IPs, networks like 192.168.101.0/24, or * for everyone.

{{if not .NForm.New}}cancel{{end}}

Linux: sudo mount -t nfs {{.Host}}:/nas_pool_1_8_gb/documents /mnt/nas; list exports with showmount -e {{.Host}}.

{{if .External}}

Shares of other services read-only

Defined by other software on this host in /etc/samba/smb.conf.d/*.conf (included into smb.conf) and /etc/exports.d/*.exports. Manage them in that software; nasmon keeps smbd / nfs-server running while any of them exist.

{{range .External}}{{end}}
TypeSourceNamePathClients
{{if eq .Kind "smb"}}SMB{{else}}NFS{{end}} {{if eq .Source "repoiso"}}{{if $.RepoISO}}RepoISO{{else}}RepoISO{{end}}{{else}}{{.Source}}{{end}} {{if .Name}}\\{{$.Data.Host}}\{{.Name}}{{else}}—{{end}} {{.Path}} {{.Clients}}
{{end}} {{end}} {{end}}