Differential ShellCheck / shellcheck (push) Waiting to run
Cockpit manifests / validate-manifests (push) Waiting to run
Cockpit manifests / validate-schemas (push) Waiting to run
This got removed from the template with e51cf81cd2 ("unit tests: Don't
load cockpit.js in the qunit HTML template") but we've been deadcode
expanding it ever since. Drop it.
This plugin assumes that the 'po' directory is located at `$SRCDIR/po`
or `./po` if `$SRCDIR` is unset. That conflicts with our desire to be
able to run `build.js` from other directories and is also a little bit
"evil" in terms of hardcoding information about project layout.
Add an optional `podir` option to the plugin which should be set to the
`po/` path. Set it from `build.js` for Cockpit itself. For other users
of the plugin, we preserve the fallback of using `$SRCDIR/po` or `./po`
so that we don't break them on the next cockpitlib upgrade. The
expectation is that everyone will migrate to providing the `podir`
option, however.
Between `build.js` and `file.js` we determine the location of `pkg` (and
various tools that we need to invoke) in one of two ways, neither of
them particularly good:
- they're assumed to be relative to '.', which only works if ./build.js
is invoked from the automake srcdir. That happens to be the case
when pkg/Makefile.am does the invocation (it does a 'cd' first) but
it breaks if you try to run build.js manually from a different
directory.
- redundantly, if `$SRCDIR` is set, this will be used in some (but not
all) places
Let's standardize on looking at `import.meta.dirname`. This is how node
resolves imports, so it's pretty much guaranteed to be correct (or else
the script itself wouldn't be running in the first place). This is
an absolute pathname derived from argv[1] as passed to node (ie:
build.js itself).
For the qunit plugin, `import.meta.dirname` is the path of the plugin
itself, which makes it perfect for finding the `.template.html.in` file
located immediately adjacent to itself, saving some path gymnastics.
During our computation to create `runtime-npm-modules.txt` we need to be
careful: pathnames are based on `import.meta.dirname` now and are
therefore always absolute: we need to adjust our logic for finding paths
starting with `node_modules` to consider the relative pathname.
Stop hardcoding 'dist/' all over the place. We already do it once in
the esbuild configuration blob, and that's enough. The other places
(and particularly the plugins) should be reading it from there.
For the qunit plugin, remove a hardcoded instance of 'qunit/'.
This was added back when PatternFly 4 was used and there was no clear
visual separation of the alert and the page background. In PatternFly 6
alerts are distinct enough that we no longer need this.
chronyd runs as an unprivileged system user. With a tight umask,
Cockpit created /etc/chrony/sources.d and cockpit.sources as 750/640
root:root, so chronyd could not read NTP servers set in the UI.
Force 755/644 independently of the session umask, matching the
timesyncd fix. Cover it in testTimeServersChronyd with umask 077.
Resolves: RHEL-253609
Assisted-by: LLM
Co-authored-by: Freya Gustavsson <freya@venefilyn.se>
Use the `update_packages` abstraction in the Software Updates page so
Cockpit can support dnf5daemon as well. This does not re-use
`get_running_updates` emits the same callbacks in `update_packages` now.
This to prevent us racing with `update_packages` to obtain the
transaction or as alternative having to expose PackageKit's internal
transaction DBus path.
The extra code duplication in the end isn't that much to consider the
alternatives.
Move the initial watching of updates to a new method which can be
implemented by PackageKit or DNF5Daemon. The current implementation
still returns a transaction_path which is PackageKit specific but for
now this is temporary until the next commit moves update_packages over
to the PackageManager API.
The DNF5Daemon implementation will have to wait until we have
update_packages() available.
While we have `atob` and `btoa` it doesn't support anything other than
Latin1, which causes issues for mountpoint names that exceed what Latin1
supports - such as Chinese.
Tests were updated with a new Chinese name, this caused a reordering of
the modal and subsequently had to be updated in the tests. The Chinese
mount name "数据资料" roughly translates to data and information
according to DeepL.
Fixes: https://github.com/cockpit-project/cockpit/issues/23783
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
In pixel-test changes on new tasks container (2026-10-03) our hack to
hide scrollbars in pixeltests stopped working.
Setting `overflow-y: clip` both on `main` and on .pf-v6-c-page__main-container
makes this hack work again.
Presuming that .po files are an untrusted input, the "Language" string
in the .po file header could easily be set to something like
" + console.log("pwned") + "
which would escape the naive application of double quotes to either side
of it by the plugin when inserting it into the header of the .po.js
file. Use JSON.stringify() to make sure we get the quoting right.
This might have been done in a separate file but cockpit-po-plugin is
currently standalone, so let's keep it that way. This file is imported
into external projects.
Add a test case that runs once on module import: it's cheap (~1-2ms).
CVE-2026-92769
Fixes: https://redhat.atlassian.net/browse/RHEL-219811
This prevents updates to source strings in pot file that only changes
the order in which the strings appear when a string is used in multiple
files.
Fixes: https://github.com/cockpit-project/cockpit/issues/23754
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
We should not try to control the "display" style of PatternFly
elements. They might have their own CSS rules for it with unknown
specificity.
Specifically, a DropdownItem has "display: flex" from PatternFly with
the same specificity as our "display: none" from the
".file-chooser-hide-on-wide" class. Which one is in effect seems to
be decided by the roll of a dice.
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>
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.
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>
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.
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: [
...
]
}
}
/>
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.
dnf5 5.4.3 provides a new org.rpm.dnf.v0.History.list method with which
we can retrieve a list of transactions. The software updates page only
shows updates not newly installed packages or other transactions which
are available.
Some font-weight rules needed to use `--default` as part of the CSS
variable usage as the font-weight without it no longer exists.
We had instances of `<h1>` and `<h2>` that used the incorrect font and
didn't get any font-weight changes which made it not match the rest of
Cockpit. Updating it to Patternfly's Title component fixes it.
Overview page's "running on" will remain Red Hat Text while getting the
size reduced to `md` even for larger screens. RH text works better with
smaller sizes and RH Display works better with bigger ones. It would
either be keeping the size large or we proper subtitles with RH Text instead.
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Patternfly 6.6.0 introduced a migration from `break-word` to
`overflow-wrap` as the former is deprecated. However, Patternfly did not
update the value correctly and assumed it to be the same. This caused
text with long unbroken strings to not break to match the content width
and instead overflowed the page.
Fix for this is to change the `overflow-wrap` value from `break-word` to
`anywhere`.
Related-to: https://github.com/patternfly/patternfly/issues/8484
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
PF's numeric font used to have a slashed zero that we tried to remove.
But that has been changed at some point and it no longer contains the
slashed zero.
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Debouncing was controlled in the wrong place in the API, during
validation and when starting asynchronous computations for new field
values. Instead, it should be specified when handling the event that
causes a dialog field to change. When the event is the result of
keyboard input, it should be debounced, but when it comes from a
dropdown menu, it should not be.
This matters when a dialog field is changed by different events, for
example when a file can either be typed by the user, or selected from
the FileChooser dialog. We want to debounce the former but not the
latter. (It's not a huge problem if the FileChooser selection is also
debounced, but it is still not something we want, we just tolerate
because the API can't do it otherwise.)
A better example is when a single function should run when any of a
number of fields changes. Some fields should cause debounce the
calling of that function, but other should not.
Thus, the "debounce" arguments of "handle.validate_async",
"handle.set_async", and "handle.get_async" have been removed.
Instead, there is a new "handle.set_debounced" function. This
function is used by DialogTextInput and DialogPasswordInput and should
in general be used by all events that result from keyboard input.
There are no "handle.add_debounced" or "handle.remove_debounced"
functions although theoretically there should be, since they are
special cases of "handle.set".
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>
Namely support for secondary actions and an "excuse".
Also allow isDisabled and isAriaDisabled to be passed to
DialogActionButton and DialogCancelButton.
Our SimpleSelect, TypeaheadSelect, etc components use regular,
disabled SelectOptions for headers and style them to look like PF
groups headers.
With the update to PF 6.5 we also need to copy the font weight style.
We don't want to use the "id" attribute with values like
"dialog-field-name" since that is not automatically unique when
multiple dialogs are displayed at the same time. Instead, we want to
use something like
#my-dialog [data-id=dialog-field-name]
to find elements for a field called "name". And if we are using a
data attribute, why not use the one specified by OUIA. It has
dedicated support from Patternfly.
(Maybe Patternfly makes us fully OUIA compliant, or maybe not. This is
not important to us.)