ns-don: add session expiration, extension, and logging#1560
Closed
ns-don: add session expiration, extension, and logging#1560
Conversation
…ort tool Co-authored-by: stephdl <3164851+stephdl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve session management for DON remote support tool
ns-don: add session expiration, extension, and logging
Mar 5, 2026
Contributor
|
closed by #1554 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The DON remote support tool lacked session lifecycle management — no expiration, no extension, no audit trail. Sessions ran indefinitely with no automatic cleanup.
Core changes
files/donlog_message/log_errorfunctions write to syslog (daemon.info/daemon.err) on session start, stop, expiry, extension, and failuresession_startandsession_extendedtimestamp files written to/var/run/don/get_session_inforeplacesshow_credentials: reads expiry, shows time remaining orEXPIRED; full JSON supportexpirecommand: checks current time against 24h default (or extended) expiry; auto-callsdon stopif expired — intended for cronextendcommand: sets expiry to 7 days from now; rejects already-expired sessions with an error before writing anything; callsget_session_infoto confirm new state$ca,$sshd_conf,$auth_keys, password pipeline, ubus JSON interpolation)files/30_don-expire(new)UCI default script — idempotently adds an hourly cron entry with jittered delay:
Makefile30_don-expireas executable UCI defaultprermhook removes the cron entry on package removal:Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.