Commit graph

374 commits

Author SHA1 Message Date
Jelle van der Waa
ad4176e4ca treewide: Enable strict equality everywhere
Making test-functions strict required some test adjustments where we
incorrectly expected an number while we receive in fact a string. As
getAttribute() returns either a string or null.
2026-11-03 17:37:17 +01:00
Freya Gustavsson
f360268f3b test: Stable Flatpak server field
Flatpak made assertions where a field could be present but not visible
which can cause race conditions where we would input values before the
flatpak browser had a chance to render it.

It was also possible to click the login button before the browser had
registered an input, which could make the button still disabled.

Likewise when logging out we could be loading a page and then executing
logout before the shell had a chance to render, meaning the logout
button doesn't exist.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-10-19 12:55:50 +02:00
Freya Gustavsson
11cc344f59 test: Increase flatpak JS timeout
Some tests are verging on timeouts and sometimes encounter them during
tests. This was in particular true during initial experimentation on why
ubuntu-latest runner migration show failed tests for flatpak tests.

Related-to: https://github.com/cockpit-project/cockpit/pull/23713
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-10-19 12:55:50 +02:00
Jelle van der Waa
0548f9dfa9 containers/ws: Move to Fedora 44 2026-10-19 09:35:44 +02:00
Freya Gustavsson
b9ed76508c flatpak: Update to Gnome v51
Flatpak runner shows a warning that v51 is now available to use and
should be migrated to.

Fixes: https://github.com/flathub/org.cockpit_project.CockpitClient/issues/98
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-09-25 15:49:22 +02:00
Freya Gustavsson
b1433d5e8c doc: Fix links for Antora
Several files, including the deployment guide index page, link to the
old AsciiDoc guide on our website whereas our new docs site is published
under docs subdomain using Antora. While these links will work in the
future thanks to redirects we should update the links where we can to
avoid this unnecessary redirect.

Other changes include changing links from being header anchors within a
single-page to a multi-page navigation with asciidoctor's xref. This
change only applies to links within the same module and doesn't change
any links from guide to manpage for example. That will be tackled in a
future commit as it also has to deal with compiling to manpages.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-07-14 15:47:27 +02:00
Freya Gustavsson
7c2d83093f
flatpak: Update to Gnome SDK v50 (#23297) 2026-05-29 14:19:08 +02:00
Jelle van der Waa
263f616496 containers: set opencontainers labels for cockpit-ws
Many popular containers set standardised annotations as a label to allow
container UI's to display additional container image details. Set a
subset of annotations which are useful for administrators running a
cockpit-ws container.

https://specs.opencontainers.org/image-spec/annotations/
2026-02-18 18:17:56 +01:00
Jelle van der Waa
bb2daaae60 containers: re-use release.sh for building the ws-container
In a future commit we want to add labels to our ws-container, this
becomes easier when if we have a centralised location where we build the
cockpit-ws image.
2026-02-18 18:17:56 +01:00
Martin Pitt
a7ae147258 REUSE: Convert license headers to SPDX format
Replace full LGPL/GPL/MIT/BSD license header with
SPDX-License-Identifier in all source files. This is more concise and
makes the license information machine readable.

Keep the full text of ISC for src/common/cockpitbase64.[hc], it's small
enough and only used in this pair of files. Also keep the CC-BY-SA
paragraph in pkg/storaged/icons/gnome-icons.jsx as explained in the
previous commit.

See https://reuse.software/spec-2.0/#2-include-a-copyright-notice-and-license-in-each-file

https://issues.redhat.com/browse/COCKPIT-1742
2026-02-04 10:24:11 +01:00
Allison Karlitskaya
0f957193a7 containers/ws: Run cockpit-tls in front of cockpit-ws
This complicates the run script quite a bit, so port it to Python.
Add explicit handling for each of the options that we used to pass
through to cockpit-ws.

We handle fact that we don't have systemd inside of the container by
pretending to be systemd: we bind the unix socket for cockpit-ws and
pass it through via the LISTEN_FDS mechanism: this avoids needing to add
support for unix sockets to cockpit-ws.  We also handle the binding of
the TCP socket ourselves and pass it through to either cockpit-tls or
cockpit-ws depending on if we're using TLS or not.

The container was the last user of the native TLS support in cockpit-ws,
which means we can now remove it, reducing the amount of work we need to
do in order to support post-quantum cryptography.

https://issues.redhat.com/browse/COCKPIT-1330
2026-01-28 11:58:16 +01:00
Allison Karlitskaya
c85c69ddf2 containers/ws: improve caching for incremental builds
When iterating locally it helps if we can avoid having to repeat the
"download the packages from the Fedora servers" step, which is currently
run every time.

We can do that by separating it to a separate step that runs *before* we
copy in the entire contents of what becomes the /container directory
(which changes on every iteration).

We install cockpit-bridge and cockpit-ws up front now even though they
will still be installed later by install.sh because we want the
dependencies (and I couldn't find any easy way to say "just install the
runtime dependencies of these packages).

We don't bother with any "layer avoidance" techniques here because this
is just the builder container which doesn't become part of the final
result.
2026-01-28 11:58:16 +01:00
Martin Pitt
dbb75c5a98 containers/ws: Add quick iteration developer target
Add a `make ws-container-build-tree` target which copies the bundles and
binaries from the build tree into the container image. This is much
faster than a full image-prepare and building rpms in a VM.

This could be optimized further to not always reinstall the rpms during
each container build, but reuse these layers. However, the Containerfile
currently does the `ADD .` before the dnf install, and all the install
steps happen in an order which breaks efficient caching. This is
annoyingly hard to fix (cue: `COPY` and `ADD` barf with nonexisting
files/directories, even with globbing).

Only use when you know what you are doing -- if it breaks, you get to
keep both halves.
2026-01-23 16:09:26 +01:00
Martin Pitt
8b64023c95 containers/ws: Document building image with local rpms
Also drop the `$` prefix, it just breaks copy&paste.
2026-01-23 16:09:26 +01:00
Martin Pitt
92c4634277 containers/ws: Move to Fedora 43 2026-01-16 09:53:43 +01:00
rugk
a504a7184a
doc: Adjust SSH config installation guide to only enable password authentication for localhost for more security (#22500)
Allows authentication to be `localhost`-only.

This is a minor security feature that allows you to use public key authentication for SSH
while keeping Cockpit-based authentication to username and password.

Related-to: https://github.com/ublue-os/ucore/issues/275
Related-to: https://github.com/ublue-os/ucore/pull/286
Co-authored-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-18 19:30:53 +01:00
Freya Gustavsson
70bc884ce0
flatpak: Bump Gnome runtime to v49 (#22633)
Bumps to the latest stable release

See-also: https://release.gnome.org/calendar/

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-01 13:21:56 +01:00
Martin Pitt
094c5c8815 tools: Create -node tarball
Update `make-dist` and `release` to produce a runtime node_modules tarball.
`tools/node-modules runtime-tar` uses `jq`, so add that as a packit
source build dependency.

Adjust the consumers of `make-dist` accordingly. This isn't being used for
anything yet, this will be a follow-up.
2025-11-27 12:32:45 +01:00
Freya Gustavsson
9898ff3492 flatpak: Compose URL for screenshots mirror
We started getting errors for our flatpak CI runs a few weeks ago. Which
coincided with an upstream infrastructure issue which would explain the
screenshots error. After infra was fixed and the fact that we didn't get
any successful runs, something else was going on.

Turns out that `flatpak-builder` had a release which changed the
behaviour of `--compose-url-policy` to default to `partial` instead of
`full` which was used before. Our fix is simple, just change it back to
`full`

Fixes: https://github.com/cockpit-project/cockpit/issues/22444
Related-to: https://github.com/flatpak/flatpak-builder/pull/652
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-10-13 16:39:13 +02:00
Freya Gustavsson
618cbdc713
flatpak: Bump GNOME runtime to 48 (#22322)
Previously on 47 which is EOL next month.

Related-to: https://github.com/flathub/org.cockpit_project.CockpitClient/pull/67

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-08-18 15:33:40 +02:00
Martin Pitt
bf47bb9282 containers/ws: Move to Fedora 42 2025-07-09 09:43:48 +02:00
Martin Pitt
a34513940a containers/ws: Dockerfile → Containerfile 2025-07-09 09:43:48 +02:00
Marvin A. Ruder
c26c92ffaf
containers/ws: Provide image for arm64
* Run build on both x86_64 and arm64 runners, merge results in manifest
* Make registry repository and tag configurable
* Remove `push` command from `release.sh` script
2025-05-20 07:58:00 +02:00
Martin Pitt
2276088be3 flatpak: Dump HTML on test failures
This makes it a bit easier to debug/understand failures which only
happen in CI. It goes directly to stdout, as it's not easy to write that
into a file -- so it's awkward, but better than nothing.
2025-05-15 09:57:42 +02:00
Martin Pitt
85b0de3345 flatpak: Enable screenshots URL mirror
Flathub already mirrors our screenshots to https://dl.flathub.org/media.
Tell flatpak builder to rewrite the manifests to actually point to the
mirror. This fixes the recent `appstream-external-screenshot-url` error.

Fixes #21643
2025-02-24 11:18:19 +02:00
Martin Pitt
91ad819959 containers/ws: Include cockpit-files
This brings the ws container closer to the Client flatpak. In beiboot
mode, Files works everywhere including RHEL 8 [1].

[1] https://github.com/cockpit-project/cockpit-files/pull/917
2025-01-29 11:02:04 +01:00
Martin Pitt
eb0d8d1b39 containers/ws: Clean /var/cache/libdnf5
This currently contains 84 MB of dead weight (repository indexes).
That made the container balloon from 57 to 116 MB.
2024-12-20 14:05:45 +02:00
Martin Pitt
7ebd5992f4 containers/ws: Fix build on Fedora 41
dnf5 changed `--installroot` behaviour that it now only considers the
repositories in the root instead of the host. This broke the container
build.

Unfortunately my fix for that [1] got lost in a git pilot failure, mea
culpa!

[1] https://github.com/cockpit-project/cockpit/pull/21360#issuecomment-2511242349
2024-12-18 13:24:31 +01:00
Martin Pitt
b1c8d57344 containers/ws: Support using an external SSH agent
In unprivileged mode, support connecting to an already running SSH agent
for sharing SSH private keys.

Thanks to Anton Engelhardt <engelhardt.anton@gmail.com> for the idea and
initial implementation sketch!

Fixes #21170
2024-12-13 11:19:43 +01:00
Martin Pitt
b1bc4c092f containers, test: Convert obsolete /var/run paths to /run/ 2024-12-10 09:51:41 +01:00
Martin Pitt
a82b4bf08e Use raw strings with re functions
Fixes lots of complaints with ruff 0.8 like

> RUF039 First argument to `re.match()` is not raw string
2024-12-10 09:38:58 +01:00
Martin Pitt
d76cadd590 containers/ws: Move to Fedora 41 2024-12-02 14:54:58 +01:00
Martin Pitt
035dc2d9be containers/ws: Drop cockpit-session
`cockpit-session` isn't meant to work in the container: ws runs with
`--local-ssh` and everything happens via SSH, so we can just as well
drop it. This gets rid of the useless initial cockpit-session call for
the opportunistic "Negotiate" (Kerberos) authentication.

We temporarily also have to remove the program in
test/ws-container.install, until our Fedora 40 image gets a cockpit/ws
version which doesn't have it installed any more, i.e. when this commit
lands, gets released, published to quay.io, and into the fedora-40 image
rebuild.
2024-11-20 14:52:00 +01:00
Martin Pitt
bfc4a81e06 containers/ws: Drop obsolete install checks for cockpit
Since commit ab36148467 the cockpit/ws container offers beibooting, so
we don't require the bridge and cockpit pages on the host any more.
2024-10-22 16:29:18 +02:00
Martin Pitt
b795dde4cf containers/ws: Drop bad checks from uninstall script
This was copy-pasted from the install script, but these checks are
entirely irrelevant for uninstalling.
2024-10-22 16:29:18 +02:00
Martin Pitt
64ec91c2ff test: Split ostree and cockpit/ws install scripts
This makes the ws build script reusable for other scenarios.
2024-10-22 16:29:18 +02:00
Martin Pitt
6af58ad665 containers/ws: Install our other Cockpit pages
Kdump, Networking, SELinux, Storaged, and Software Updates are all fine
and useful for beiboot mode. Apps doesn't, but that's hidden by the
manifest condition.
2024-10-15 09:38:42 +03:00
Martin Pitt
474f74cd23 Revert "containers/ws: Rename Dockerfile to Containerfile"
Our build-ws-container workflow uses docker, which doesn't understand
"Containerfile".

This reverts commit afad67198e.
2024-10-11 09:28:46 +03:00
Martin Pitt
d1724d1267 appstream: Move icons to type stock and standard directory
type="local" has been invalid for AppStream for a long time now, only
"stock" or "remote" are valid. Also, app specific icons must be placed
into /usr/share/icons/hicolor/, not /usr/share/pixmaps/. See [1] for
details.

Debian's latest lintian started to complain about invalid AppStream
metadata more loudly (via `appstreamcli validate`), causing a cockpit
build failure on our CI as we fail the build on lintian warnings.

[1] https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/#icons
2024-10-10 14:50:04 +02:00
Allison Karlitskaya
7c7ab45e3f src/bridge: drop the C bridge
Nothing is using this code anymore.  All that's left in this directory
are a few test resources: we'll deal with those in the next commit.

Clean up a few stray references in the build system and packaging: in
paticular, remove --enable flags for both PCP and PolKit.
2024-10-07 15:10:54 +02:00
Martin Pitt
ab36148467 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
(we'll likely expand this in the future, but let's start small). Take
care to only unpack the RPMs, to avoid installing e.g. NetworkManager
and other big dependencies into the container -- they are useless there.

Update the documentation accordingly. While at it, add an introduction
paragraph what Cockpit is.

https://issues.redhat.com/browse/COCKPIT-954
2024-10-01 11:08:11 +02:00
Martin Pitt
86bf3626e2 ssh: Drop cockpit-ssh
Nothing uses this any more, superseded by cockpit-beiboot. This gets rid
of the libssh build dependency.

Drop the `Provides: cockpit-ssh` from Debian. No package ever related to
that virtual package name, and it's meaningless these days.
2024-09-30 09:36:34 +02:00
Martin Pitt
98a19742f5 ws: Use cockpit-beiboot for direct remote connections
cockpit.beiboot has feature parity with cockpit-ssh, so switch the
default direct remote session program to that. Use
`--remote-bridge=always` mode for the time being in ws and the
container; we are going to support that eventually, but let's not change
everything at once.

Change ws' detection of remote login availability to "cockpit-bridge and
ssh are available". This involves forking a shell now (for running the
`command` shell builtin), add an expected message to
`TestConnection.testHttpsInstanceDoS`.

Drop the `COCKPIT_SSH_BRIDGE_COMMAND` env var documentation,
cockpit-beiboot does not use that.

Rename `testLoginSshBeiboot` to `testSSH`. This test covers a few corner
cases that other tests don't, and it's very convenient for development
to have a nondestructive test which covers all aspects of bastion host
SSH login.

Adjust some error messages in the tests.

https://issues.redhat.com/browse/COCKPIT-1029
2024-09-30 09:36:34 +02:00
Martin Pitt
aea13e9f26 bridge: Implicitly accept 127.0.0.1's SSH host key in beiboot
That key is never interactively validated with cockpit-ssh in the
default configuration: That reads cockpit.conf's [Ssh-Login] host=
option (defaulting to 127.0.0.1) and ignores that host's key. This is
fine for 127.0.0.1, but dangerous and unexpected for external hosts:
These should *always* use proper SSH host key validation and change
detection.

That cockpit.conf option is normally meant to set the default remote
host for the login page (evaluated in ws), and either way isn't even
documented in our manpage.

cockpit-beiboot does not read this option, and really shouldn't. So just
hardcode 127.0.0.1 there.

Adjust the flatpak test accordingly.
2024-09-30 09:36:34 +02:00
Martin Pitt
f540cfaef3 containers/ws: Move to Fedora 40 2024-09-27 10:51:56 +03:00
Martin Pitt
afad67198e containers/ws: Rename Dockerfile to Containerfile 2024-09-27 10:51:56 +03:00
benniekiss
b33deff3bd containers/ws: Support host-specific ssh keys 2024-09-27 08:03:30 +02:00
Martin Pitt
5a73281076 beiboot: Handle ssh host key prompts
Stop treating host key prompts as generic conversation messages. We want
the UI to handle them properly, with some verbiage/buttons and the
UI/recipe for confirming/validating host keys, instead of letting the
user type "yes". The login page recognizes these through the presence of
the `host-key` authorize field.

We can't use ferny's builtin `do_hostkey()` responder for this, as that
requires `ferny.Session(handle_host_key=True)`, and that API is not
flexible enough to handle our ssh command modifications and the extra
beiboot_helper handler. This needs some bigger redesign, see #19668.

So just recognize and parse SSH's host key prompts, and rely on our
integration tests to spot breakage in future distro releases.

While cockpit-ssh gave us the full host key right away during
conversation, ssh (and thus ferny/beiboot) don't work that way: During
conversation we only get the fingerprint. So for the sending direction,
utilize the recently introduced temporary UserKnownHostsFile feature of
beiboot, and send the known_hosts entry for the given host as part of
the `Authorization:` header. For the receiving direction we need to
handle three cases:

 * For a previously unknown host and a successful login, we only get the
   full host key as part of the GET /login's `login-data` response. So
   defer updating our localStorage's `known_hosts` database during the
   conversation until that happens.

 * For a failed login (like wrong password) after already confirming the
   key change, get the host key from the protocol error message.

 * ssh (and thus ferny/beiboot) don't report changed host keys as part
   of conversation, but immediatley abort. So remember that state in
   `ssh_host_key_change_host`, and re-attempt the login without sending
   known_hosts data. Our usual logic in `do_hostkey_verification()` will
   notice the change and present the correct dialog.

Adjust TestLogin.testLoginSshBeiboot to only expect the host key on the
first login attempt. Add testing of changed host key behaviour.
2024-09-23 09:50:29 +02:00
Allison Karlitskaya
b0aa6fbd36 flatpak: bump GNOME depend to 47
The new Sdk drops the old appstream-util command for favour of
appstreamcli, so move to using it to validate our files.
2024-09-19 13:58:28 +02:00
Martin Pitt
c016cf302e all: Move gnu.org/license URLs to https://
To skip the automatic redirect.

This was done mechanically with:
```sh
git grep -l http://www.gnu.org/licenses/ | xargs sed  -i 's@http://www.gnu.org@https://www.gnu.org@g'
```
2024-08-19 09:23:02 +02:00