No description
Find a file
Jelle van der Waa 9dce9b02e3 package.json: drop po2json
The cockpit-po-plugin was reworked to use gettext-parser directly
instead of po2json in 1e92eb6815eb48aab590790ecd67.
2023-09-20 14:20:57 +02:00
.fmf Add FMF tests and test scripts 2023-04-28 11:28:25 -04:00
.github/workflows Workaround git permission check gh actions bug 2023-05-17 11:29:49 -04:00
packaging build.js: support flags 2023-07-26 10:14:26 -04:00
plans fmf: Plumb through $TEST_* variables for unexpected messages 2023-08-28 15:13:02 -04:00
po Bring up to date with cockpit starter kit 2023-04-27 14:47:24 -04:00
src Player: Stop making the Terminal object state 2023-07-27 14:01:40 -04:00
test fmf: Plumb through $TEST_* variables for unexpected messages 2023-08-28 15:13:02 -04:00
.eslintignore Bring up to date with cockpit starter kit 2023-04-27 14:47:24 -04:00
.eslintrc.json Makefile: bump our test/common dependency 2023-05-31 08:36:26 -04:00
.gitignore Bring up to date with cockpit starter kit 2023-04-27 14:47:24 -04:00
.stylelintrc.json Bring up to date with cockpit starter kit 2023-04-27 14:47:24 -04:00
build.js build.js: support flags 2023-07-26 10:14:26 -04:00
LICENSE Initial commit with a LICENSE and README 2017-06-14 18:19:15 +02:00
Makefile Makefile: Update Cockpit lib to 9c73bec7e1dc2395a00aa0c510fd7210 2023-09-14 14:21:49 -04:00
org.cockpit-project.session-recording.metainfo.xml Update org.cockpit-project.session-recording.metainfo.xml 2023-07-18 13:51:31 -04:00
package.json package.json: drop po2json 2023-09-20 14:20:57 +02:00
packit.yaml Automate the release process 2023-05-11 11:48:09 -04:00
README.md build.js: support flags 2023-07-26 10:14:26 -04:00

Cockpit Session Recording

Module for Cockpit which provides session recording configuration and playback. It requires tlog to record terminal sessions. SSSD is required to manage which users / groups are recorded. Systemd Journal is used to store recordings. Ansible role for session-recording is here.

Demos & Talks:

GitHub Organization:

This project is based on the Cockpit Starter Kit. See Starter Kit Intro for details.

Getting and building the source

Make sure you have npm available (usually from your distribution package). These commands check out the source and build it into the dist/ directory:

git clone https://github.com/Scribery/cockpit-session-recording.git
cd cockpit-session-recording
make

Installing

make install compiles and installs the package in /usr/local/share/cockpit/. The convenience targets srpm and rpm build the source and binary rpms, respectively. Both of these make use of the dist target, which is used to generate the distribution tarball. In production mode, source files are automatically minified and compressed. Set NODE_ENV=production if you want to duplicate this behavior.

For development, you usually want to run your module straight out of the git tree. To do that, run make devel-install, which links your checkout to the location were cockpit-bridge looks for packages. If you prefer to do this manually:

mkdir -p ~/.local/share/cockpit
ln -s `pwd`/dist ~/.local/share/cockpit/session-recording

After changing the code and running make again, reload the Cockpit page in your browser.

You can also use watch mode to automatically update the bundle on every code change with

$ ./build.js -w

or

$ make watch

When developing against a virtual machine, watch mode can also automatically upload the code changes by setting the RSYNC environment variable to the remote hostname.

$ RSYNC=c make watch

When developing against a remote host as a normal user, RSYNC_DEVEL can be set to upload code changes to ~/.local/share/cockpit/ instead of /usr/local.

$ RSYNC_DEVEL=example.com make watch

To "uninstall" the locally installed version, run make devel-uninstall, or remove manually the symlink:

rm ~/.local/share/cockpit/starter-kit

Running eslint

Cockpit Starter Kit uses ESLint to automatically check JavaScript code style in .js and .jsx files.

eslint is executed within every build.

For developer convenience, the ESLint can be started explicitly by:

$ npm run eslint

Violations of some rules can be fixed automatically by:

$ npm run eslint:fix

Rules configuration can be found in the .eslintrc.json file.

Running stylelint

Cockpit uses Stylelint to automatically check CSS code style in .css and scss files.

styleint is executed within every build.

For developer convenience, the Stylelint can be started explicitly by:

$ npm run stylelint

Violations of some rules can be fixed automatically by:

$ npm run stylelint:fix

Rules configuration can be found in the .stylelintrc.json file.

During fast iterative development, you can also choose to not run eslint/stylelint. This speeds up the build and avoids build failures due to e. g. ill-formatted css or other issues:

$ ./build.js -es

Running tests locally

Run make check to build an RPM, install it into a standard Cockpit test VM (centos-8-stream by default), and run the test/check-application integration test on it. This uses Cockpit's Chrome DevTools Protocol based browser tests, through a Python API abstraction. Note that this API is not guaranteed to be stable, so if you run into failures and don't want to adjust tests, consider checking out Cockpit's test/common from a tag instead of main (see the test/common target in Makefile).

After the test VM is prepared, you can manually run the test without rebuilding the VM, possibly with extra options for tracing and halting on test failures (for interactive debugging):

TEST_OS=centos-8-stream test/check-application -tvs

It is possible to setup the test environment without running the tests:

TEST_OS=centos-8-stream make prepare-check

You can also run the test against a different Cockpit image, for example:

TEST_OS=fedora-34 make check