3 Commits

Author SHA1 Message Date
darroyo d3d59b4e45 fix: nil slice -> empty slice in list API responses
Backend:
- ListStorageJobs, ListSambaShares, ListNFSExports, ListUsers,
  ListDirty, ListApplyLog, ListWatchedMounts: initialize with
  make([]T, 0) instead of var x []T to avoid JSON null on empty.
  Fixes "Cannot read properties of null" crash on /storage.

Frontend:
- Storage.tsx: defensive setJobs(res.jobs ?? []) to guard against
  API returning null.

Tests:
- Add TestListStorageJobsEmptyReturnsSlice.

Version: 0.7.1
2026-07-06 23:31:03 -04:00
darroyo 03e9368a91 feat: add invalid_users directive for Samba shares
Samba shares now support an 'invalid users' list (deny list), written
as 'invalid users = u1,u2' in smb.conf. The UI shows a ChipPicker
for valid_users and invalid_users, mutually exclusive, sourced from
the system user list.

feat: add ImportSystemUsers for fresh installations

When NASCTL_IMPORT_ON_BOOT=true, nasctl now imports existing system
users from /etc/passwd (UID 1000-60000) and /etc/group (supplemental
groups), and detects which have Samba accounts via 'pdbedit -L'.
Imported users are marked dirty so the admin can review before applying.
New POST /api/import/users endpoint for manual re-import.

This mirrors the existing import-on-boot flow for smb.conf and /etc/exports.
2026-07-06 15:37:01 -04:00
darroyo 4f0754ecc5 Add nasctl: Go NAS control plane with React frontend 2026-07-05 17:37:19 -04:00