Hello,
recently I fixed a small bug in cockpit [1]. The fix is rather trivial but it was
quite difficult to test it and verify that it really fixes the problem.
ALP Prerequisites
=================
1. Install ALP from https://download.opensuse.org/repositories/SUSE:/ALP/images/,
see the previous mails about the installation and configuration
2. Install cockpit with "transactional-update pkg install cockpit",
then reboot the system
(the backend packages are already preinstalled in the ALP image, this will
install the web frontend)
3. Start the cockpit service: "systemctl enable --now cockpit.socket"
Now you will have the standard cockpit installed and ready to run, you might
test it by connecting to https://localhost:9090
Development
===========
Note: I needed to patch a cockpit plugin which is basically a JS code + HTML + CSS.
If you would need to patch the cockpit core (the C code) it would be more
difficult, see the suggestion in the end.
I did the development directly on my workstation (Leap 15.4), the ALP instance was
running in a VM.
Development Prerequisites
-------------------------
For patching a cockpit plugin you should not need much libraries installed, but the
the Makefile (generated by autotools) requires the libraries also for the C part.
On my workstation I had to additionally install these packages:
zypper install json-glib-devel krb5-devel sassc nodejs16
You might actually need some more libraries or tools (autotools), I use my
workstation as a development machine and it already contains a lot of libraries.
Check that nodejs and npm default versions are 16, esp. if you have multiple versions
installed. Originally I probably did something wrong and got some strange failures...
Then you can checkout the sources from GitHub
git clone git@github.com:cockpit-project/cockpit.git
and checkout the version used in ALP
cd cockpit
git checkout -b 276
Check https://build.opensuse.org/package/show/SUSE:ALP/cockpit, it might change in
the future.
To build the sources use:
# this installs the npm packages using "npm install"
./autogen.sh
# autogen.sh runs configure but it will very likely fail, by default it needs
# some additional libraries, if you want to patch just a plugin then run
./configure --disable-doc --disable-ssh --disable-pcp --disable-polkit
make
Now the compiled plugins are available in ./dist/ subdirectory. Now we need to
transfer these changed file to the ALP system.
There are several possibilities to do this. You can run an "scp" command after each
edit/build or you can use some network file system.
I tested that with sshfs. The disadvantage is that the sshfs packages are not
available for ALP, as a workaround I installed the "sshfs" and "fuse3" packages from
Tumbleweed. That works currently because ALP is based on TW, but that will probably
not work later when ALP is branched from TW. The clean solution would be to provide a
container for that...
To mount a directory over sshfs run
sshfs <user>@<machine>: