From 5a0c357eb5369aae9c9f2c71c5a223c9daf325c1 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 28 Aug 2023 12:21:49 +0200 Subject: [PATCH] containers/ws: Enable beibooting and install standard cockpit pages This provides similar functionality as the Client, so that the ws bastion container can connect to machines which don't have any Cockpit packages installed. Install cockpit-system and cockpit-networkmanager into the container for now. We'll likely expand this in the future, but let's start small. https://issues.redhat.com/browse/COCKPIT-954 --- containers/ws/cockpit-auth-ssh-key | 4 +--- containers/ws/install.sh | 7 +++++-- test/ostree.install | 12 ++++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/containers/ws/cockpit-auth-ssh-key b/containers/ws/cockpit-auth-ssh-key index f9646b468b31..ceba79153f82 100755 --- a/containers/ws/cockpit-auth-ssh-key +++ b/containers/ws/cockpit-auth-ssh-key @@ -187,9 +187,7 @@ def main(args): {"password": "denied"}) return - # for the time being, we only support running an installed cockpit-bridge on the remote, - # and leave beibooting to the flatpak - os.execlpe("python3", "python3", "-m", "cockpit.beiboot", "--remote-bridge=always", host, os.environ) + os.execlpe("python3", "python3", "-m", "cockpit.beiboot", host, os.environ) if __name__ == '__main__': diff --git a/containers/ws/install.sh b/containers/ws/install.sh index 9cc9e38b886c..495b8d546803 100755 --- a/containers/ws/install.sh +++ b/containers/ws/install.sh @@ -12,9 +12,12 @@ rpm=$(ls /container/rpms/cockpit-ws-*$OSVER.*$arch.rpm /container/rpms/cockpit-b # If there are rpm files in the current directory we'll install those if [ -n "$rpm" ]; then - $INSTALL /container/rpms/cockpit-ws-*$OSVER.*$arch.rpm /container/rpms/cockpit-bridge-*$OSVER.*$arch.rpm + $INSTALL /container/rpms/cockpit-ws-*$OSVER.*$arch.rpm \ + /container/rpms/cockpit-bridge-*$OSVER.*$arch.rpm \ + /container/rpms/cockpit-system-*$OSVER.*$arch.rpm \ + /container/rpms/cockpit-networkmanager-*$OSVER.*$arch.rpm else - $INSTALL cockpit-ws cockpit-bridge + $INSTALL cockpit-ws cockpit-bridge cockpit-system cockpit-networkmanager fi rm -rf /build/var/cache/dnf /build/var/lib/dnf /build/var/lib/rpm* /build/var/log/* diff --git a/test/ostree.install b/test/ostree.install index 3f75f664814d..89ad443f1b9a 100644 --- a/test/ostree.install +++ b/test/ostree.install @@ -1,15 +1,19 @@ #!/bin/sh set -eu -# install/upgrade RPMs that apply to OSTree -# Note: cockpit-selinux would be desirable, but needs setroubleshoot-server which isn't installed cd /var/tmp/ +# install/upgrade RPMs that apply to OSTree +# Note: cockpit-selinux would be desirable, but needs setroubleshoot-server which isn't installed rpm-ostree install --cache-only cockpit-bridge-*.rpm \ cockpit-networkmanager-*.rpm cockpit-system-*.rpm cockpit-tests-*.rpm -# update cockpit-ws and install scripts in the container -for rpm in /var/tmp/cockpit-ws-*.rpm /var/tmp/cockpit-bridge-*.rpm; do +# update cockpit packages and install scripts in the container +for rpm in /var/tmp/cockpit-ws-*.rpm \ + /var/tmp/cockpit-bridge-*.rpm \ + /var/tmp/cockpit-networkmanager-*.rpm \ + /var/tmp/cockpit-system-*.rpm \ + /var/tmp/cockpit-tests-*.rpm; do rpm2cpio "$rpm" | cpio -i --make-directories --directory=/var/tmp/install done podman run --name build-cockpit -i \