The REST API reads and changes the hosts-file list and shows each file's load status #176

Open
opened 2026-10-31 12:42:20 -04:00 by claude · 0 comments
Owner
  • Draft: PN-32
  • Priority: medium
  • Agent: coder
  • Depends on: #174
  • Decisions: Q-PN-11

Why

Operators set the paths from the console and need to see whether each file loaded.

What changes

  • New src/dotnet/src/Ninlil.Web/Controllers/HostsFilesSettingsController.cs at api/hosts-files-settings, shaped like the delivery settings controller (WebhookDeliverySettingsController.cs:38-150, renamed in #152): GET and PATCH (hostsfilessettings:read / hostsfilessettings:write), written to the runtime settings file (RuntimeConfigurationOptions, src/dotnet/src/Ninlil.Web/Options/RuntimeConfigurationOptions.cs:19-31), returning a RuntimeSettingsWriteResult that says the change is hot-reloaded.
  • GET api/hosts-files-settings/status (hostsfilessettings:read) returns the #174 status per path.
  • Validation: absolute paths only, at most 32 entries, ExpandDomain a valid name, TTL and interval in range (as SettingsRangeCheckTests expects of other settings). A path that does not exist yet is accepted and shows as missing in the status.
  • Technical call: not cluster-synced (paths are node-local), unlike the settings ClusterConfigSyncSettingsRecorder sends (Program.cs:522-525).
  • Models and examples. README.md: the permission lets a holder make the server read any file the service account can read; give it to administrators only.

Acceptance

  • This test fails first: Patch_WithARelativePath_Returns400 in src/dotnet/tests/Ninlil.Web.Tests.
  • Tests: a patch of Paths shows up in status without a restart; permissions; range checks.
  • Gate: dotnet test src/dotnet/tests/Ninlil.Web.Tests.

Source

audit-feature-parity.md §2A #15.
Owner decision 2026-10-31: Q-PN-11.

- **Draft:** PN-32 - **Priority:** medium - **Agent:** coder - **Depends on:** #174 - **Decisions:** Q-PN-11 ### Why Operators set the paths from the console and need to see whether each file loaded. ### What changes - New `src/dotnet/src/Ninlil.Web/Controllers/HostsFilesSettingsController.cs` at `api/hosts-files-settings`, shaped like the delivery settings controller (`WebhookDeliverySettingsController.cs:38-150`, renamed in #152): `GET` and `PATCH` (`hostsfilessettings:read` / `hostsfilessettings:write`), written to the runtime settings file (`RuntimeConfigurationOptions`, `src/dotnet/src/Ninlil.Web/Options/RuntimeConfigurationOptions.cs:19-31`), returning a `RuntimeSettingsWriteResult` that says the change is hot-reloaded. - `GET api/hosts-files-settings/status` (`hostsfilessettings:read`) returns the #174 status per path. - Validation: absolute paths only, at most 32 entries, `ExpandDomain` a valid name, TTL and interval in range (as `SettingsRangeCheckTests` expects of other settings). A path that does not exist yet is accepted and shows as missing in the status. - Technical call: not cluster-synced (paths are node-local), unlike the settings `ClusterConfigSyncSettingsRecorder` sends (`Program.cs:522-525`). - Models and examples. README.md: the permission lets a holder make the server read any file the service account can read; give it to administrators only. ### Acceptance - [ ] This test fails first: `Patch_WithARelativePath_Returns400` in `src/dotnet/tests/Ninlil.Web.Tests`. - [ ] Tests: a patch of `Paths` shows up in `status` without a restart; permissions; range checks. - [ ] Gate: `dotnet test src/dotnet/tests/Ninlil.Web.Tests`. ### Source `audit-feature-parity.md` §2A #15. Owner decision 2026-10-31: Q-PN-11.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#176
No description provided.