cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.2k stars 1.11k forks source link

systemd: Hide "limited access mode" banner without superuser bridges #21135

Closed martinpitt closed 1 week ago

martinpitt commented 1 week ago

When a user configures shell.override.json to disable superuser bridges ({ "bridges": [] }), then the banner in the overview is just inactionable noise. Hide it then.

Fixes #21134

katodo commented 1 week ago

Thanks! I see the patch is still under review, in the meantime I'll try it out by hand on my system.

martinpitt commented 1 week ago

ah yes - Debian has a motd by default, which is also an alert.

martinpitt commented 1 week ago

@katodo You are welcome to try the RPMs: https://copr.fedorainfracloud.org/coprs/packit/cockpit-project-cockpit-21135/

katodo commented 1 week ago

@katodo You are welcome to try the RPMs: https://copr.fedorainfracloud.org/coprs/packit/cockpit-project-cockpit-21135/

Next week I'll try to install a Fedora VM, right now I only have Debian machines (and if I want Ubuntu but that's another story :) )

katodo commented 1 week ago

@katodo You are welcome to try the RPMs: https://copr.fedorainfracloud.org/coprs/packit/cockpit-project-cockpit-21135/

I couldn't resist :)

I installed a Fedora 40, created a second user "user" without privileges and in its home I created the file ~/.config/cockpit/shell.override.json with { "bridges": [] } inside

At this point if I log in as "user" I see the screen below without the banner, if I log in with my user it allows me to escalate privileges.

image

Great job!

martinpitt commented 1 week ago

Oh, you mean the ?? operator? I copied that from pkg/shell/superuser.jsx, but indeed it was me who changed it, in commit b4e33ead1dbbf604e.