Commit graph

715 commits

Author SHA1 Message Date
tomasmatus
8a7f961c1d anaconda doc: drop extra word 2026-10-16 15:02:45 +02:00
tomasmatus
9401f45cce doc: add networking page section to anaconda.md 2026-10-14 15:30:10 +02:00
Marius Vollmer
e12c37897d tls: Limit concurrent connections
Resolves: COCKPIT-1905, RHEL-263070, RHEL-263066
2026-09-21 15:28:29 +03:00
Jelle van der Waa
bbdf74044d treewide: Fix typos discovered by codespell 2026-08-18 11:58:12 +02:00
Freya Gustavsson
29b3ae68a8 doc: Correct link to cockpit-dbus
Incorrectly had a link to cockpit-spawn which was the current file, it
should've been cockpit-dbus file instead.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-07-27 16:55:50 +02:00
Freya Gustavsson
d9ba262e51 doc: Add cockpit-version from playbook
We had set the cockpit-version attribute from the antora file which is
used by playbooks. This makes the attribute become locked and can't be
modified beforehand (that easily).

Proper usage, for us at least, is to update the cockpit-version through
an extension in cockpit-docs repo instead. This is only really a hack we
have to do due to publishing through tags instead of branches.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-07-20 13:07:14 +02:00
Freya Gustavsson
acf9af315c asciidoc: Add inline manpage macro extension
Adds a new extension for AsciiDoctor in
`doc/extensions/man-inline-macro.rb` followed by a README in the same
directory. This changes the links to manpages during compilation from
asciidoc files into HTML or Manpages so that links work within HTML
pages as well as being properly formatted within manpages.

This started as an initial workaround to handle Antora xref extension to
AsciiDoctor wherein it introduces resource ids such as module,
version, and component. Ultimately this breaks AsciiDoctor parsing of
xref and makes it think that it is a strange URI and not a URL. However
as Cockpit guide only has links to manpages and the fact that this also
improves system manpages a macro `man` suits better.

Using this is fairly straightforward, when you want to reference a
manpage within the Cockpit Guide or within a manpage you define it using
`man:manpage-name[sub-volume]` which will then be translated to an
anchor link in HTML or bold text in Manpage format with the text
`manpage-name(sub-volume)`.

This does not fix the links within Antora and building them locally
within Cockpit repo using our instructions in doc/README.md will make
the links show as unformatted text `man:manpage-name[sub-volume]`. This
is not an issue within our cockpit-docs repo as we have an extension
there that replaces the manpage macros with the proper xref module link
for Antora.

See-also: https://docs.antora.org/antora/latest/page/xref/#structure
See-also: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/main/lib/man-inline-macro/extension.rb
Related-to: https://github.com/cockpit-project/cockpit-docs/pull/8
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-07-14 15:47:27 +02:00
Freya Gustavsson
853335bea8 manpages: Incorrect volume 8 instead of 1
The referral of cockpit-desktop(1) was set to (8) by accident at some
point.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-07-14 15:47:27 +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
8cbbef0df1 doc: JSON schema for cockpit manifest.json
Our `manifest.json` is currently only documented through our docs, and
in there it can be quite confusing. We tend to instead copy from other
repos or pages and I assume other projects do too. But modifying it can
be tedious.

Setting this JSON schema as a `$schema` property in your `manifest.json`
file will make all properties validated against.

For usage within manifest files the schema will be published under
Antora as an attachment and will therefore be versioned. This can be
accessed using the following for example:
- https://docs.cockpit-project.org/cockpit-guide/latest/_attachments/schema.json
- https://docs.cockpit-project.org/cockpit-guide/363/_attachments/schema.json

Assisted-by: AI
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-07-13 20:30:40 +02:00
Jelle van der Waa
c1676a0d7c doc: Document new fsinfo options introduced in 339
Support for querying access was introduced in 339.
2026-07-03 11:01:15 +02:00
Freya Gustavsson
b5d1b40b5b asciidoc: Match Antora nav with old guide
There was a mismatch between old docs and the new Antora docs in the
navigation structure. This fixes that and makes a slight modification
where the manual pages are listed separately from the deployment guide.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-06-30 15:00:19 +02:00
Freya Gustavsson
7127825f31 README: Add Antora preview commands
To preview Antora on this repo is just a few commands, lets add it to
the doc README so it makes it easier to work with.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-06-30 15:00:19 +02:00
Freya Gustavsson
6363bd1226 readme: Light/dark theme for screenshots
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-06-24 18:43:18 +02:00
Jelle van der Waa
aa6209efba doc: Remove certificate/key tls options from http channel
These channel options are no longer implemented in the Python bridge and
would require writing certificates passed from JavaScript to a temporary
file as `load_cert_chain` does not support passing data via
string/bytes.

No known plugins used this option, most of them talk to a local UNIX
socket.

Related: https://github.com/python/cpython/issues/118557
2026-06-17 09:36:41 +02:00
Marius Vollmer
3b4624ff0f bridge, shell: Robust session idle timeouts
Previously, only the Shell would participate in implementing session
idle timeouts.  This means that a session was not guaranteed to time
out when the browser decided to suspend JavaScript execution.

Now the main actor for session idle timeout is the bridge: When
JavaScript starts, it will instruct the bridge to start the session
idle timeout timer.  When it expires, the bridge will exit and end the
session even if JavaScript has been stopped.

While waiting for the timers to elapse, the bridge will send events
out over a new "session-control" channel type that inform the pages
when the final countdown has started, and when it is time to logout.

User activity is also reported over such a channel.
2026-04-24 15:30:02 +03:00
Freya Gustavsson
c3d192098b doc: Remove unused py-asciidoc code
As part of a previous PR we dropped `py-asciidoc` completely in favor of
pre-bundling the documentation for distros where AsciiDoctor is not
available. At the time none of the code for building with `asciidoc` was
removed as I was unsure whether we'd need `py-asciidoc` or not.

With little reason to keep `py-asciidoc` as the maintenance burden to be
compatible with both `py-asciidoc` and `asciidoctor` is high, and it
making the integration with Antora more difficult, this commit drops all
code related to the Automake config and technical implmenetation
differences between the two.

This also drops the leveloffset helper as it was added as a way to
handle `py-asciidoc` and `asciidoctor` discrepancies when it comes to
going up and down the level offset for headings. Since we no longer use
AsciiDoc this is no longer relevant and can be dropped completely.

Related-to: https://github.com/cockpit-project/cockpit/pull/22693
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-04-10 16:51:46 +02:00
Freya Gustavsson
556097e052 doc: Add Antora configs
Adds Antora configuration so that a dedicated Cockpit Doc repo can
access the various docs in Cockpit as well as an `antora-playbook.yml`
file for local development purposes (without relying on Cockpit Doc).

Partials in manpages were also renamed and restructured as Antora has a
dedicated partial import mechanism to allow for more functionality.

There were a few links in the nav files thar were not valid or pointed
to wrong files. Most of these were just naming mismatches and has been
changed to work with Antora. Nav files themselves also got the section
anchors removed as there is little reason to showcase specific
navigation items - instead section anchors should be used within pages
themselves.

Related-to: https://docs.antora.org/antora/latest/family-directories/
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-04-10 16:51:46 +02:00
Freya Gustavsson
bc62cb3709 doc: Restructure prep for Antora support
Antora uses a dedicated folder structure which we need to adhere to for
it to work as it should. Makefiles has moved to `doc/` root to simplify
the approach needed with Antora and AsciiDoctor.

Existing bundling of documentation with help of AsciiDoctor works as
normal and does not interfere with the directory change.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2026-04-10 16:51:46 +02:00
Jelle van der Waa
2ba4dac251 ws: support loading a custom login page
Anaconda wants to allow users to remotely log in Cockpit's WebUI
using a PIN for authentication. Instead of adding an Anaconda mode to
`cockpit.conf` allow Anaconda to bring its own login.html, JavaScript
and CSS. This gives Anaconda full flexibility over the login process
combined with implementing their own handler for basic auth.
2026-03-30 15:57:33 +02:00
Jelle van der Waa
522ee46bb5 doc: fix spelling mistakes 2026-03-04 16:15:37 +02:00
Jelle van der Waa
bb47a29381 doc: fix #brand selector 2026-03-04 13:28:52 +01:00
Jelle van der Waa
2008c676c1 doc: update cockpit/ws container registory location
The container was moved to quay.io.
2026-02-18 18:17:56 +01:00
Jelle van der Waa
b1ef3c0879 ws: drop crypt1 authorize challenge support
This has been kept for compatibility with old bridges since 2017.
2026-02-03 21:05:17 +01:00
Martin Pitt
fc960bf348 doc: Explain how to write IPv6 addresses in Origins = configuration
Add a corresponding test to `TestConnection.testConfigOrigins`.
2026-01-30 15:09:11 +01:00
Martin Pitt
198b48a3d2 ws: Drop TLS support
That has been deprecated since 2019 when we introduced cockpit-tls in
commit ace21c8879. It's now getting in the way with the upcoming
support for post-quantum certificates, which we'll only do in c-tls.

Now the only thing that the `--no-tls` option does is to disable the TLS
redirection.

Part of https://issues.redhat.com/browse/COCKPIT-1330
2026-01-28 11:58:16 +01:00
Alice Brooks
ee1123bd6f doc: fix dbus .addEventListener("signal"... casing 2026-01-23 09:02:10 +01:00
Martin Pitt
74cc1933f6 doc: Login process
While the existing document describes the protocol, it is hard to see
how all the moving parts communicate together. Describe the steps for
user/password, Kerberos, and client certificate authentication schemes.

Assisted-By: Claude code (initial mermaid diagram and proofreading)
2026-01-11 20:44:10 +01:00
Freya Gustavsson
6a0da46280 doc: Prebundle docs on RHEL & CentOS
With this we can get rid of asciidoc-py dependency altogether and
instead rely on the docs being prebundled before installation.

Include the built guide and manpages into the release tarball for that.

Fixes #22670
https://issues.redhat.com/browse/COCKPIT-1370

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
Co-Authored-By: Martin Pitt <mpitt@redhat.com>
2026-01-08 13:02:15 +01:00
Freya Gustavsson
7b108ff319
doc: Add cockpit-version to AsciiDoctor (#22692)
Regressed during migration from DocBook to AsciiDoc, version should now
show up correctly in the documentation pages themselves.

Fixes: https://github.com/cockpit-project/cockpit/issues/22671

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-16 20:06:34 +01:00
Freya Gustavsson
106023dd13 doc: Remove outdated DocBook XML files
As we now use AsciiDoc we can remove the DocBook files completely to
prevent confusion and mixups in the future.

Due to not having any docbook files left we can also remove
`convert.py`.

Co-authored-by: Aleksandra Fedorova <afedorova@redhat.com>
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-16 09:41:37 +01:00
Freya Gustavsson
23e095b9d3 doc: Move build workflow to AsciiDoc
With the created AsciiDoc files for documentation we can now update our
build structure to generate the HTML and Manpage files both during build
and package distribution.

Changes
- Uses AsciiDoctor or asciidoc-py and a2x to generate HTML and Manpages.
- Generated HTML and Manpage files moved to `doc/output/`.
- Support packaging docs on all distributions Cockpit deploys to.
- Add package dependencies for AsciiDoctor and asciidoc-py.
- Safety fallback in automake file to search for either asciidoctor or
  asciidoc-py in terms of priority.

Known issues
- Links in guide pages goes to new files for the pages themselves, which
  meant we now generate HTML files for all `.adoc` files and not just
  `index.html`.

With the removal of fonts we also managed to break the build pipeline
that automake generated for us. As the doc guide fonts make rule was
removed, which relied on `$(DIST_STAMP)` rule, automake optimized the
build process and in turn broke the workflow. As a workaround the
`$(DIST_STAMP)` rule was added to the index rule as a dep to help
automake generate it the way we want it.

As the workaround is a hack and not a real solution, this needs to be
fixed in another PR to make sure these dependency issues do not occur if
we were to remove `$(DIST_STAMP)` from a rule.

We also need the `$(DIST_STAMP)` to appear last in the doc generation or
something, likely race condition, may cause the `index.html` to only
contain `{}`.

Related-to: https://github.com/cockpit-project/cockpit/issues/22648
Related-to: https://github.com/cockpit-project/cockpit/issues/22647
Co-authored-by: Aleksandra Fedorova <afedorova@redhat.com>
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-16 09:41:37 +01:00
Freya Gustavsson
71c97a970a doc: Refine converted AsciiDoc pages from Docbook
Several improvements as well as a bug fix relating to AsciiDoc
generation for both `asciidoc-py` and `asciidoctor`.

Within AsciiDoctor to handle nested includes we can use relative
leveloffsets to have headers increase or decrease in size. The older
asciidoc-py does not have relative `leveloffset`s and we instead have to
rely on asciidoc counter to increase the offset and an eval to decrease
the offset. AsciiDoctor does not support modifying `leveloffset` through
eval, which means we need a helper module and a custom attribute, in
this case `asciidoctor`, to use either relative leveloffsets or
leveloffset eval.

Generated AsciiDoc files have been refined further by
- Splitting files out to multiple files and included them inline to be
  able to support pages like `/guide.html` and `/development.html`
- Creating attributes for the head of each AsciiDoc manpage file
- Generated monospace code moved from \`code\` to \`+code+\`
- Header levels adjusted to keep one h1 and decreasing headings
- Page titles adjusted to be the recommendation from AsciiDoctor with
  capitalization and titles.
- Manpage AsciiDoc files renamed to be the same as the output file for
  easier conversion. Converted result is the same.

Co-authored-by: Aleksandra Fedorova <afedorova@redhat.com>
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-16 09:41:37 +01:00
Freya Gustavsson
000df8bef6 doc: Rename adoc files to match generated html
When converting the AsciiDoc manpages to HTML it is much easier if we
already include the section number in the filename before converting.
That way we are consistent with how we currently have it in production
and also make it easier for ourselves to only see the file extension
change and not the filename.

Website guide also had several docbook pages that were converted as-is
which had a different name when generated to HTML. Those were renamed to
reflect the new name or fix the minor naming issues.

Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-16 09:41:37 +01:00
Freya Gustavsson
db7244cfd1 doc: Create AsciiDoc files from DocBook
Initial conversion done using a script in `doc/convert.py` that takes
the DocBook XML files and generates it to AsciiDoc files.

Co-authored-by: Aleksandra Fedorova <afedorova@redhat.com>
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-12-16 09:41:37 +01:00
Martin Pitt
8bb9366bc2 doc: Fix make rule
Don't repeat our DIST_STAMP.
2025-11-19 11:53:54 +01:00
Jelle van der Waa
e5d9548c89 doc: correct extending the background image
Our normal login.scss has a stronger rule which made the branding not
match.

Closes: #22550
2025-11-08 13:08:08 +01:00
Martin Pitt
ad4605a7ba bridge: Support disjunctive manifest conditions
Extend the manifest conditions to support alternatives like

     {"any": [{"path-exists": "…/packagekit.service"}, {"path-exists": "…/dnfdaemon.service"}]}
2025-10-08 12:50:43 +02:00
Martin Pitt
c794108ae8 ws: Support custom /etc/cockpit/branding
This allows administrators to customize Cockpit's branding without
messing around in /usr. Add XDG_CONFIG_DIRS/cockpit/branding/ (i.e.
usually in /etc/cockpit/branding) to the front of the search list, so
that it gets prefered over XDG_DATA_DIRS.

Fixes #21338
https://issues.redhat.com/browse/RHEL-102556
2025-09-08 14:26:10 +02:00
Martin Pitt
a2bc632991 pkg: Include branding.css into all pages
This has no effect right now, as the only things that current
branding.scss affects are the login page (`#brand` and `#badge`) and the
shell (`--ct-color-host-accent`). But we want to make branding more
customizable with e.g. [1], which should apply to all pages
consistently.

In particular, this also allows Anaconda to customize/brand the storage
page [2].

Document the possibility of customization and test this with setting
`--pf-t--global--color--brand--default`.

Part of #21338

[1] https://www.patternfly.org/design-foundations/colors/#brand-colors
[2] https://github.com/rhinstaller/anaconda-webui/pull/951
2025-09-02 11:01:02 +02:00
Martin Pitt
f5d5ec7e02 login: Improve error message for unsupported shells
When trying to log in with a shell that does not understand `exit 71`
(our litmus test for "reasonable shell"), this was previously really
hard to understand/debug: The journal did not show anything bad other
than that the session only lasted a blink of an eye, and the login page
just said "permission denied".

Log a proper warning to the journal that explains what happens.

Let the login page show "Unsupported shell. Check the journal for
details." We are past authentication at this point, so we can afford
giving away that piece of information.

This does not really work on Arch, where /etc/pam.d/system-login
enforces `pam_shells`. So any "odd" shell already gets rejected in the
`auth` stage, and the session (and thus this shell validity check) does
not even start. That was also the reason for the tow alternative
`error-title` matches before.

Fixes #20741
2025-07-28 11:54:31 +02:00
Freya Gustavsson
8e8fa0c65d doc: Add version introduced to conditions
This was previously merged and released without a note indicating which
version it was added in (286).

Related-to: #18291
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
2025-07-07 15:46:43 +02:00
libkurisu
8f94e8bf4e
docs: Mark host switching as deprecated
Fixes #22092
2025-07-04 14:21:09 +02:00
Jelle van der Waa
d2724638ab lib: deprecate cockpit.byte_array()
This is a simple wrapper over `window.btoa` introduced for DBus support
but ended up currently not being used by anything in Cockpit or on
GitHub.
2025-04-30 11:48:37 +02:00
Jelle van der Waa
347a033af5 cockpit: allow setting file mode in fsreplace1
Extend `fsreplace1` to allow setting the file mode, this is not required
for cockpit-files but can be used in Cockpit itself. It expects the
same octal number as fsinfo returns in its file entries.
2025-04-22 17:13:57 +02:00
Jelle van der Waa
a1a92f9f5f cockpit: support setting user/group in fsreplace1
Cockpit-files wants to support uploading or creating a file owned by the
current directory which might be different from the logged in user.

For example as superuser uploading a database into `/var/lib/postgresql`
which would be owned by `postgres` and the database file should receive
the same permissions.
2025-04-22 17:13:57 +02:00
Jelle van der Waa
ba07eb6c2f doc: mention that SELinux context is also copied in fsreplace1
This was implemented in 67b2f5a42e.
2025-04-22 17:13:57 +02:00
Jelle van der Waa
868a001fb8 doc: deprecate cockpit.user() and document alternative
Since `cockpit.init()` has been introduced Cockpit pages no longer have
to retrieve the user via `cockpit.user()` as it is directly available on
`cockpit.info`.
2025-04-22 14:13:02 +02:00
Andrew
b3fa6193fb
ws: Support globs in configured origins
Use fnmatch() instead of precise string comparison

Fixes #21738
2025-04-20 08:57:43 +02:00
Jelle van der Waa
6be9b4d22d bridge: re-introduce max_read_size limit in fsread1
This is a regression from our port of the bridge from C to Python. The C
bridge had a limit and as fsread1 is not blocking implemented this
prevents issues of accidentally reading /dev/zero or /dev/sda which will
fill up ram endlessly.

For existing `fsread1` users (cockpit-files) to keep relying on an
unlimited mode `max_read_size` now supports passing `-1` which removes
the limit.
2025-04-11 15:19:29 +02:00