Add key expiry disable/enable toggle#554
Conversation
c377674 to
c700a04
Compare
|
This fails integration testing and I'd also hold off as I'm changing things somewhat significantly. |
I'm not entirely sure since I haven't looked that much into it, but I believe the tests are failing since the CI is using the latest release version of headscale. The PR adding this headscale feature however hasn't actually made it into a release version yet.. If you don't mind, I'll keep the PR update as best as I can. The changes are few enough for me to adapt them to the changes happening upstream. |
f8a0bd3 to
b373eaa
Compare
|
@tale This PR now passes integration tests for headscale versions 0.29.0+. Please tell me if you'd like anything changed about the implementation, such that it meets your requirements for integration 😉 |
|
@pullfrog review |
There was a problem hiding this comment.
Important
The new key-expiry toggle needs two fixes before merge: the API parameter is sent in the wrong place, and the version capability is never used in the UI.
Reviewed changes — add a UI toggle for disabling/enabling node key expiry for Headscale 0.29+.
- Add
keyExpiryCanBeDisabledcapability gated to Headscale >= 0.29.0 inapp/server/headscale/api/capabilities.ts. - Add
toggleExpiryAPI call toapp/server/headscale/api/resources/nodes.ts. - Wire a machine-menu action in
app/routes/machines/components/menu.tsxandapp/routes/machines/machine-actions.tsto toggle expiry. - Add integration/unit tests for the new capability and API in
tests/integration/api/nodes.test.tsandtests/unit/headscale/server-version.test.ts.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
b373eaa to
c864551
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the latest commit gates the key-expiry toggle behind the keyExpiryCanBeDisabled capability and threads that flag from the machine loaders down through MachineRow to MachineMenu.
- Wired
supportsDisablingKeyExpirythrough the machine loaders inapp/routes/machines/machine.tsxandapp/routes/machines/overview.tsx. - Passed the capability prop through
MachineRowtoMachineMenuinapp/routes/machines/components/machine-row.tsx. - Conditionally rendered the toggle menu item in
app/routes/machines/components/menu.tsxbased onsupportsDisablingKeyExpiry, addressing the prior review feedback about the capability not being used in the UI. - Verified the API call shape in
app/server/headscale/api/resources/nodes.ts;disableExpiryis sent as a query parameter, which matches the Headscale 0.29.2 OpenAPI spec.
Kimi K2 (free via Pullfrog for OSS) | 𝕏

This PR adds a button to the node menu to disable (and re-enable) node key expiry, as requested by #553. Since headscale does not store the key expiry toggle state separately from the actual expiry date, re-enabling key expiry sadly currently will result in a node that expired at the time of re-enabling the key expiry. This is not the case with official tailscale, which seems to pick up the original key expiry date from before key expiry was disabled. Hence, I'm actually unsure myself if this feature adds much to the UX of headplane 🤷