Skip to content

feat: NFS export write path — SharePrivilege load/save (#057 Phase C)#9

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feat/nfs-write-path
Jun 20, 2026
Merged

feat: NFS export write path — SharePrivilege load/save (#057 Phase C)#9
ChrisonSimtian merged 1 commit into
mainfrom
feat/nfs-write-path

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Implements the NFS-export write path — the last, highest-risk SynoSharp capability (plan #057 Phase C, ADR-0002).

What

  • Specs: NfsRuleSpec, NfsExportSpec, NfsExports on SynologyDesiredState.
  • SynoNfsTool: LoadAsync (read rules), SaveCommand (whole-list replace), EnableServiceCommand — via synowebapi SYNO.Core.FileServ.NFS.SharePrivilege over SSH.
  • Reconciler: NFS planning (load → diff → save), dry-run by default, idempotent; Present=false clears.
  • CLI: synosharp exec <argv> raw passthrough (diagnostics).
  • 6 unit tests (argv shaping, rule parsing, reconciler create/skip). 24/24 pass.

Key finding

security_flavor is a bool-flag object ({sys, kerberos, kerberos_integrity, kerberos_privacy}), not an array — and root_squash=all_admin is the all-squash-to-admin model (anonuid=1024/anongid=100).

Verification

Reverse-engineered + proven on a DSM 7.x Virtual DSM (desktop-01): create → idempotent-skip → reversible-clear, producing /etc/exports lines identical to the production NAS. No production NAS writes.

🤖 Generated with Claude Code

Adds declarative NFS-export reconciliation, the last/highest-risk SynoSharp
write capability:

- NfsRuleSpec / NfsExportSpec (+ NfsExports on SynologyDesiredState)
- SynoNfsTool: load (read rules), SaveCommand (whole-list replace), and
  EnableServiceCommand, over `synowebapi SYNO.Core.FileServ.NFS.SharePrivilege`.
  security_flavor is encoded as the bool-flag OBJECT DSM expects (not an array).
- Reconciler NFS planning: load -> diff -> save, dry-run by default, idempotent;
  Present=false clears the share's rules.
- `synosharp exec <argv>` raw passthrough (diagnostics; used to reverse-engineer
  the API).
- 6 unit tests (SaveCommand argv, rule parsing, reconciler create/skip).

Reverse-engineered + proven on a DSM 7.x Virtual DSM: create/skip/clear lifecycle
yields /etc/exports lines identical to the production NAS. 24/24 tests pass.
@ChrisonSimtian
ChrisonSimtian merged commit b31541a into main Jun 20, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feat/nfs-write-path branch June 20, 2026 09:10
ChrisonSimtian added a commit to Chrison-Homelab/Homelab that referenced this pull request Jun 20, 2026
Fast-forwards the `vendor/SynoSharp` submodule to main after merging
Chrison-dev/SynoSharp#9 (NFS export write path). Makes the repo's
`synosharp` NFS-capable — prerequisite for #1 (managing the volume4
export declaratively via `synosharp apply`).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant