-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement session recording and playback support in Cockpit #4
Comments
To implement playback resizing we can make tlog-play output resize control sequences (see Scribery/tlog#94) and make the term.js library interpret them. This way we won't need any other channel to communicate the resizes. |
Rough plan for the start:
Later:
|
Rather than invent file storage and write all the management code around it, and write custom tests for journal performance I just went ahead and implemented recording and playback to/from journal in tlog. Seems to work so far, and wasn't hard. I'll go ahead and start writing Cockpit code for listing sessions from the journal now. |
fyi, we're currently working on providing a demo out of tree plugin for Cockpit. We're tracking this effort on trello and we're using subscription-manager-cockpit as the case study. |
Thanks a lot, @dperpeet! I'll look into making an out-of-tree plugin when I figure out more about Cockpit. So far I'm just trying to make something work :) |
If you have a working installation of cockpit, you should be able to:
And after the next cockpit login you should see the sample page. Otherwise I recommend building from cockpit's git repo and editing the playground. But that is more complex: https://github.com/cockpit-project/cockpit/blob/master/HACKING.md. |
Thank you. So far I've been adding my page directly to the cockpit tree, borrowing from systemd/logs and systemd/terminal. I'll try the plugin route too. |
Whatever works for you! The plugin is definitely a work in progress, so if you have something that works, you can definitely stick to that for now. |
I got some basic list of sessions to appear in Cockpit based on the journal contents, but found a systemd problem, apparently related to systemd/systemd#1347, which manifests in some required fields missing in last entries tlog produces right before exit. Will need to add them in tlog itself, even though systemd normally adds them anyway. |
We will likely need to distinguish separate tlog recordings using the combination of boot ID, recording process PID and start time. We might have to implement Scribery/tlog#95 and Scribery/tlog#103. |
I got a very rudimentary "Session Recording" page working in Cockpit in this branch: https://github.com/Scribery/cockpit/tree/hacking This still needs a lot of work and likely changes in tlog, but we got a proof that something is possible. I'll make a short video demo soon. |
A video demo I made a while back: https://youtu.be/BPiqFKvW0q4 |
I implemented logging a "recording ID" which would let us uniquely identify a recording on a host. This was necessary, because just audit session ID is not enough, such as across reboots. |
See https://github.com/Scribery/cockpit/milestone/3 for detailed tracking. |
Implement support for session recording and playback in Cockpit, for the
controlled machine.
For the start don't implement configuring session recording in Cockpit.
Leave that to users to do manually, then add that to SSSD configuration when
it is added to Cockpit.
Implement local session recording in tlog, so that actual recorded sessions
could be listed.
For example, consider recording to journal with extra meta-data, so that it is
then possible to list all recorded sessions and play them back. See
Scribery/tlog#88.
If that doesn't work, consider recording to per-session files in some
directory in the filesystem.
Implement an interface in Cockpit listing available recorded sessions, where
you could click on and play back a specific session.
Implement playback by running tlog-play on the local machine and showing its
output in a JavaScript terminal emulator, similarly to how it's done with
local console in Cockpit. Try to reach @dperpeet for that.
Also, support forwarding recordings somewhere else using the regular logging
channel. If not recording to journal, implement support for multiple writers
(Scribery/tlog#76).
This might also need support for rewind/fast-forward in tlog-play (see Scribery/tlog#90).
The text was updated successfully, but these errors were encountered: