Commit graph

24378 commits

Author SHA1 Message Date
Freya Gustavsson
556a0ba1e6 lib(dnf5daemon): Reset if pkgs are installed
Resets the transaction and returns if the problems found are only that
the packages are already installed. Since `check_missing_packages` just
checks and doesn't install it shouldn't fail if all packages that are
being checked are installed.

Fixes: https://github.com/cockpit-project/cockpit/issues/23717
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-09-18 13:23:53 +02:00
Jelle van der Waa
fd3bf8f3ef tools: Drop dist tarball exclude
Fixed in https://github.com/react-dropzone/react-dropzone/issues/1447
2026-09-18 11:32:13 +02:00
Jelle van der Waa
5efa4af065 packagekit: Sanitize PackageKit urls
It is very unlikely that vendor/bug/cve urls can be tempered with, it
requires messing with a Bodhi update or repodata. But we already have a
function to validate urls so do our due diligence and also filter out
invalid urls from the package update information.
2026-09-18 08:46:27 +02:00
Jelle van der Waa
86f93e3393 packagekit: Initialize bug/cve/vendor urls
Simplify the code by creating new variables for urls and use them
consistently through the code. In a follow up commit we will make use of
this to filter bad/malicious urls.
2026-09-18 08:46:27 +02:00
Jelle van der Waa
6e76c96272 packagekit: Sanitize markdown urls
Our Remarkable (markdown parser) link_open copied the package update
description urls directly into the DOM allowing cross site scripting via
for example mouse or click handlers. This issue is prevented by our
Content Security Policy but sanitizing is still an additional measure we
should apply.

Setting the href via `setAttribute` properly escapes extra options such
as `onmouseover`. Additionally this commit will filter out unwanted URL
schemes such as `javascript:` to prevent those from becoming another
exploit vector. Other code constructing anchor elements can also reuse
this helper to filter out unwanted URL schemes.

Resolves: COCKPIT-1899
Resolves: CVE-2026-91148
2026-09-18 08:46:27 +02:00
tomasmatus
78afe1d587 ws: don't crash when urlroot has no trailing slash
Resolves: CVE-2026-91147
Resolves: https://redhat.atlassian.net/browse/COCKPIT-1896
2026-09-16 09:17:58 +03:00
Jelle van der Waa
d29ab66bfd lib: Stop using promises for the PO Plugin
The whole plugin uses synchronous IO apis and without the promise
overhead it seems to be slightly faster (3%).
2026-09-15 20:54:10 +02:00
Jelle van der Waa
4527aa12de lib: Pre-compute PO file writing direction
This saves at least doing it twice per PO file, additionally make the
RTL languages a constant.
2026-09-15 20:54:10 +02:00
Jelle van der Waa
fdeaddeb8d lib: Use async I/O APIs in RemoveRHIconsPlugin
This function is async so use asynchronous I/O functions.
2026-09-15 20:54:10 +02:00
Jelle van der Waa
f64ac24714 lib: Read and parse PO files once with gettext-parser
After the introduction of generating JavaScript translation files for
manifest files we now parse our PO files twice. Additionally we also
parse them again for every `config.subdirs` although parsing PO files
does not depend that configuration option. With these two improvements
building is now 2x as fast.
2026-09-15 20:54:10 +02:00
Freya Gustavsson
27d94bab8b lib: Kbps->kbps to match standard
We didn't adhere to the standard fully and missed one spot where we used
capital K instead of lowercase one. Although the style is that all
suffixes use capital letter, kilobit is special in that it would
otherwise showcase Kelvin in it - which is why it is lowercase k.

Fixes: https://github.com/cockpit-project/cockpit/issues/23716
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-09-15 16:40:49 +02:00
Vojtech Trefny
d78df9b9eb storaged: Disable Stratis Tang encryption in Anaconda mode
Anaconda and Blivet currently don't support using Clevis/Tang
encryption with Stratis so we shouldn't allow users creating
Stratis pools with Clevis encryption.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-15 15:32:18 +03:00
Jelle van der Waa
608c12864f test: Fix udisks missing vgcreate events on Ubuntu
On Ubuntu TestStorageResize flakes waiting on the "TEST" volume group to
be created likely missing an udev event. Apply the same workaround from
`testUnsupported` to resolve this, we are testing resizing not udev
events in this test.
2026-09-15 14:40:42 +03:00
Jelle van der Waa
a371f8ff29 test: Drop storaged_version < 2.8.0 checks
RHEL 8.10 ships with UDisks 2.9.0 and that is our oldest image.
2026-09-15 14:40:42 +03:00
Cockpit Project
7e6d981257 cockpit-ci: Update container to 2026-09-12
Closes: #23726
2026-09-14 14:58:20 +02:00
dependabot[bot]
896114ad62 bump stylelint from 17.14.1 to 17.15.0 in the stylelint group
Bumps the stylelint group with 1 update: [stylelint](https://github.com/stylelint/stylelint).

Updates `stylelint` from 17.14.1 to 17.15.0
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/17.14.1...17.15.0)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-version: 17.15.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: stylelint
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-14 14:02:40 +02:00
Marius Vollmer
54742e64a3 test: Don't replace package archive files with pipes
This is asking for trouble, and the test has indeed started to fail
with

  Cannot seek to the begin of the file. lseek(13, 0, SEEK_SET) error: Illegal seek

on rhel-8-10.
2026-09-11 16:27:52 +03:00
Marius Vollmer
30ea8d1f78 systemd: Explicitly focus terminal after most actions
Using buttons or menus will remove the focus from the terminal, but we
want it to keep it, just like with the Reset button.
2026-09-11 13:37:36 +02:00
Marius Vollmer
b9b97703f1 lib: Don't focus terminal during prop updates
Some of the manipulations triggered by property updates might
accidentally remove the focus, so we put it back at the end, but only
when we had the focus at the start.
2026-09-11 13:37:36 +02:00
Jelle van der Waa
3e23c9c8fc test: Type check-networkmanager-mac 2026-09-11 09:42:07 +02:00
Jelle van der Waa
fa997cfa2e test: Make MAC tests nondestructive
Switch to a virtual network interface so the test can run without an
extra virtual machine. DHCP isn't required for the tests as they just
test changing a MAC address.
2026-09-11 09:42:07 +02:00
Marius Vollmer
1c5c77efa9 test: Update pixel references for new image
The rogue fifo_fifo SELinux alert has disappeared.
2026-09-09 13:05:20 +02:00
Cockpit Project
a9e11ce5d5 cockpit-ci: Update container to 2026-09-05
Closes: #23693
2026-09-09 10:36:22 +02:00
Jelle van der Waa
f2f6ae2a73 packagekit: Don't mutate restartPackages.daemons
Array.prototype.sort mutates the array in-place which is a React
property so modifies the parent's state.
2026-09-08 16:23:32 +02:00
Jelle van der Waa
14e0f7924a packagekit: Rename RestartServices to RestartServicesDialog
The component is a Dialog so name it as such, this makes it easier to
recognize when reading.
2026-09-08 16:23:32 +02:00
Jelle van der Waa
d854546435 packagekit: Split out the RestartServices modal 2026-09-08 16:23:32 +02:00
Jelle van der Waa
1545aa0efb packagekit: Split TwoColumn components in a separate file
This allows us in the next commit to move the RestartServices component
out to its own file with the goal to shrink `updates.jsx` to a more
reasonable line and component count.
Added benefit is that the two components are now in TypeScript making it
easier to convert `updates.jsx` to TypeScript.
2026-09-08 16:23:32 +02:00
Allison Karlitskaya
dd80c35f70 .github/workflows: change gh-project approach
Make some changes to the gh-project workflows:

 - merge them into one.  We're gonna be copying this around a lot, so we
   may as well make it a bit easier.  Keeps things as DRY as they can
   be, given the circumstances.

 - use the `gh-project` environment (there has never been a global
   `GH_PROJECTS` secret and we don't want to add one)

 - change to using `pull_request_target` instead of `pull_request`: we
   don't get access to the environment (and secret) otherwise.  This is
   generally considered bad practice but it's pretty safe here since we
   never check out the PR's code.

 - add a comment about the 3 other approaches we tried/considered
2026-09-08 15:40:13 +02:00
Jelle van der Waa
7d08a019b0 test: Lazily load storaged_version/default_crypto_type
Skip two DBus calls for tests which don't request either of these
properties. Only a handful of tests use these properties out of the 120
storage tests.
2026-09-08 15:12:06 +02:00
Marius Vollmer
35ae5abfe8 cockpit: Add file chooser component
This is a "standard" desktopy File Chooser dialog.

It can be used directly with Dialogs.show:

    Dialogs.show(
      <FileChooser
         title={"Select a file that starts with \"foo\""}
         actionLabel="Load"
         action={loadFile}
         filters={
             [
                 {
                     label: "TXT files",
                     filter: (name, type) => type === "reg" && !!name.match("\\.txt$")
                 },
             ]
         }
         shortcuts={
           ...
         }
         collections={
           ...
         }
      />
    )

Or as part of a specialized TextInput that can replace the
FileAutoComplete component:

    <DialogFileChooserInput
        label="File"
        field={dlg.field("file")}
        fileChooserProps={
            {
                title: "Select a file",
                superuser: "try",
                filters: [
                   ...
                ],
                shortcuts: [
                   ...
                ],
                collections: [
                   ...
                ]
            }
        }
    />
2026-09-08 12:46:09 +03:00
hanjinpeng
869f9049ef samples: Skip only the current sensor on a zero temperature reading
CPUTemperatureSampler.sample() uses `return` where it means `continue`.
A reading of 0 is not recorded, but instead of skipping just that one
value the `return` aborts the whole loop, so every sensor after it in
os.listdir() order is dropped as well.

Since that order is not guaranteed, the CPU temperature graph loses a
varying number of lines from one boot to the next — possibly all of
them.

Add a regression test with a hwmon device that reports 0.
2026-09-07 14:38:11 +02:00
Jelle van der Waa
d4050d92f1 test: Only run TestRunTest on Fedora CoreOS
These tests test the TAP / run-tests API so don't need to be run on
every image, especially as TestRunTest.testRetry takes 5 minutes to run.
2026-09-07 12:05:56 +02:00
Jelle van der Waa
c2db7b3682 test: Split uptime test out of TestSystemInfo.testBasic
The new AWS infrastructure runs more tests in parallel so converting a
long test in two and making it non destructive should help with that
added parallelism. Additionally it benefits developers running
`TestSystemInfo.testBasic` locally without having to wait for 147
seconds for it to complete, it now takes 22 seconds in a X1 carbon (2025
model).
2026-09-07 10:55:51 +02:00
Jelle van der Waa
e56e521e99 dependabot: Update GitHub actions monthly
Some workflows update quite often like codeql-action, updating almost
every week. To reduce the weekly churn update everything monthly.
2026-09-07 10:27:35 +02:00
Jelle van der Waa
83d974b143 dependabot: Group all GitHub Actions updates together
Reduce the amount of open pull requests for GitHub actions and group
these together.
2026-09-07 10:27:35 +02:00
Léon Avic Simmons
15e32d07c9 files.js: Fix grammar in the non-variable font comment
"This are the fonts" -> "These are the fonts".
2026-09-07 08:28:15 +02:00
Léon Avic Simmons
4761a367a7 lib: Fix LongRunningProcess spelling in reset() error message
The error thrown by reset() said "LongRuningProcess" with a single 'n'.
The two sibling errors in run() and terminate(), and the class itself,
all spell it "LongRunningProcess".

codespell does not catch this because pyproject.toml excludes ./pkg from
its scan.
2026-09-07 08:28:15 +02:00
Freya Gustavsson
e2cc3d5401 dependabot: Add bot labeling to PRs
Adds `bot` label so it gets picked up by workflows that utilize the
`bot` label, such as `gh-project-add-prs`

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-09-04 19:10:47 +02:00
Freya Gustavsson
2f7ec931d5 workflows: Auto-add new issues to GH project
Adds all new issues to GH project as-is. Any filtering that needs to be
done should be done so through labels that are added to issues or their
linked PRs.

Bot PRs are added when they are labeled with `bot` label as well since
they are very frequent and rarely lack separate issue tracking.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-09-04 19:10:47 +02:00
Allison Karlitskaya
74ea8f23c2 test/verify: drop check-bots-api
This test got added in f72324702d ("bots: Allow arbitrary destination
image names with image-customize") and expanded a couple of times.  This
was before the `bots/` directory got split out from the main Cockpit
repository in 91d73df7df ("bots: Move bots and related tasks over to
cockpit-project/bots").

Whether this was overlooked or intentionally left (because the test
required /dev/kvm and we didn't want to run full tests runs in the bots
repo) isn't clear.  What is clear is that this test is entirely testing
things that exist in the bots repository (image-customize and the
machines API) and should be run when changes are made to those things,
not whenever a change is made to Cockpit.

Since we now have `/dev/kvm` in GitHub Actions runners, we can run
virtual machine tests there.  We have ported this test over in
https://github.com/cockpit-project/bots/pull/9394 and can drop it from
here.
2026-09-04 14:57:21 +02:00
dependabot[bot]
1b2643be27 build(deps): bump github/codeql-action from 4.37.8 to 4.37.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.8 to 4.37.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.8...v4.37.9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-04 14:37:04 +02:00
dependabot[bot]
6d5a89db3d build(deps): bump sourcemeta/jsonschema from 16.8.0 to 16.9.0
Bumps [sourcemeta/jsonschema](https://github.com/sourcemeta/jsonschema) from 16.8.0 to 16.9.0.
- [Release notes](https://github.com/sourcemeta/jsonschema/releases)
- [Commits](https://github.com/sourcemeta/jsonschema/compare/v16.8.0...v16.9.0)

---
updated-dependencies:
- dependency-name: sourcemeta/jsonschema
  dependency-version: 16.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-04 14:36:48 +02:00
Jelle van der Waa
a186780ed7 test: Skip Anaconda tests on RHEL 10 / CentOS 9 & 10
RHEL 10 / CentOS 9 & 10 won't get the new Anaconda WebUI so skip
expensive storage tests there too.
2026-09-03 09:29:22 +02:00
Jelle van der Waa
6e61663431 test: Fix RHEL exclusion for Anaconda tests 2026-09-03 09:29:22 +02:00
Marius Vollmer
3dde38e6b0 test: Update pixel references 2026-09-02 13:24:58 +03:00
Marius Vollmer
8c260b80d2 bump the patternfly group across 1 directory with 5 updates
Bumps the patternfly group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@patternfly/react-core](https://github.com/patternfly/patternfly-react) | `6.6.0` | `6.6.1` |
| [@patternfly/react-icons](https://github.com/patternfly/patternfly-react) | `6.6.0` | `6.6.1` |
| @patternfly/react-styles | `6.6.0` | `6.6.1` |
| [@patternfly/react-table](https://github.com/patternfly/patternfly-react) | `6.6.0` | `6.6.1` |
| [@patternfly/react-tokens](https://github.com/patternfly/patternfly-react) | `6.6.0` | `6.6.1` |

Updates `@patternfly/react-core` from 6.6.0 to 6.6.1
- [Release notes](https://github.com/patternfly/patternfly-react/releases)
- [Commits](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@6.6.0...@patternfly/react-core@6.6.1)

Updates `@patternfly/react-icons` from 6.6.0 to 6.6.1
- [Release notes](https://github.com/patternfly/patternfly-react/releases)
- [Commits](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-icons@6.6.0...@patternfly/react-icons@6.6.1)

Updates `@patternfly/react-styles` from 6.6.0 to 6.6.1

Updates `@patternfly/react-table` from 6.6.0 to 6.6.1
- [Release notes](https://github.com/patternfly/patternfly-react/releases)
- [Commits](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@6.6.0...@patternfly/react-table@6.6.1)

Updates `@patternfly/react-tokens` from 6.6.0 to 6.6.1
- [Release notes](https://github.com/patternfly/patternfly-react/releases)
- [Commits](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-tokens@6.6.0...@patternfly/react-tokens@6.6.1)

---
updated-dependencies:
- dependency-name: "@patternfly/react-core"
  dependency-version: 6.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patternfly
- dependency-name: "@patternfly/react-icons"
  dependency-version: 6.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patternfly
- dependency-name: "@patternfly/react-styles"
  dependency-version: 6.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patternfly
- dependency-name: "@patternfly/react-table"
  dependency-version: 6.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patternfly
- dependency-name: "@patternfly/react-tokens"
  dependency-version: 6.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patternfly
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-02 13:24:58 +03:00
dependabot[bot]
00c8031885 Bump argparse from 3.0.0 to 3.0.1
Bumps [argparse](https://github.com/nodeca/argparse) from 3.0.0 to 3.0.1.
- [Changelog](https://github.com/nodeca/argparse/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/argparse/compare/3.0.0...3.0.1)

---
updated-dependencies:
- dependency-name: argparse
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-02 11:37:07 +03:00
Marius Vollmer
63ee509363 debian: Add PSF-2.0 license to copyright.template 2026-09-02 11:37:07 +03:00
dependabot[bot]
babc0ec40c build(deps): bump github/codeql-action from 4.37.6 to 4.37.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.6 to 4.37.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.6...v4.37.8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-02 11:36:16 +03:00
dependabot[bot]
f0e747b98d build(deps): bump sourcemeta/jsonschema from 16.7.0 to 16.8.0
Bumps [sourcemeta/jsonschema](https://github.com/sourcemeta/jsonschema) from 16.7.0 to 16.8.0.
- [Release notes](https://github.com/sourcemeta/jsonschema/releases)
- [Commits](https://github.com/sourcemeta/jsonschema/compare/v16.7.0...v16.8.0)

---
updated-dependencies:
- dependency-name: sourcemeta/jsonschema
  dependency-version: 16.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-02 09:43:02 +02:00