Go to file
Allison Karlitskaya 4a9e30bc86 all: replace `import parent` with an interpreter line hack
We'd like to run our executable python scripts using our new `pywrap`
feature as a better way to get their PYTHONPATH setup properly.  This
script lives in our source tree, at a fixed relative location to each
script that we're interested in, but has no absolute system path.

The #!interpreter syntax does supports relative paths, but they are
resolved relative to the current working directory, not relative to the
file in which they appear, which makes this feature pretty useless.

There are some tricks we can do to get our designed 'relative'
behaviour, though.

Something like this works:

    #!/usr/bin/env -S sh -c '"${0%/*}/pywrap" "$0"'

but it causes various file auto-detection schemes (including our own
test/static-code) to improperly conclude that this is a shell script,
rather than a Python script.  (n)vim also gets it wrong for highlighting
and linting purposes.

Fortunately there's a somewhat longer, but still acceptable version of
this we can do in Python:

    #!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/pywrap", sys.argv)

This fits well under our 118 column limit.

Note that unlike `sh`, the `-c` option in Python doesn't require the
script to be passed as a separate argument, which means we don't need to
use the non-POSIX splitting tricks of `/usr/bin/env -S`.

Note also: it appears as though our hardcoding of /usr/bin/python3 here
might be venv-unfriendly, but it's not: /usr/bin/python3 (which surely
exists) is used only for running this one tiny fragment of code.  Our
pywrap script itself finds python3 in the path.

Let's move all of our previous users of `import parent` over to the new
approach.

We can remove a couple of `parent.py` symlinks we had lying
around, as well.

We also remove `parent.py` itself, since otherwise vulture complains
about it being unused.  Subprojects will be forced to adjust on upgrade.

Remove a CodeQL exemption that was necessitated by our `import parent`
shenanigans.
2023-05-26 16:17:29 +02:00
.cockpit-ci test: Add .cockpit-ci/run entry point 2019-08-01 13:59:18 +02:00
.fmf test: Add FMF test metadata and scripts 2021-03-12 20:21:29 +01:00
.github all: replace `import parent` with an interpreter line hack 2023-05-26 16:17:29 +02:00
containers test/static-code: change approach to running ruff 2023-05-26 09:08:06 +02:00
doc ws: Disallow direct URL logins with LoginTo=false 2023-04-07 06:41:16 +02:00
examples examples: Drop PatternFly 3 and patternfly.css 2022-06-28 12:16:25 +02:00
modules python: update ferny, implement cockpit.send-stderr 2023-05-25 06:19:34 +02:00
node_modules@055682f225 package.json: Update @patternfly/patternfly, @patternfly/react-core, @patternfly/react-icons, @patternfly/react-styles, @patternfly/react-table 2023-05-20 22:06:49 +02:00
pkg test/static-code: change approach to running ruff 2023-05-26 09:08:06 +02:00
plans fmf: Factorize and merge plan files 2022-11-07 16:29:00 +01:00
po po: Update from Fedora Weblate 2023-05-24 05:52:31 +02:00
selinux selinux: Allow cockpit-session to run gnome-keyring 2023-02-02 13:41:54 +01:00
src test/static-code: change approach to running ruff 2023-05-26 09:08:06 +02:00
test all: replace `import parent` with an interpreter line hack 2023-05-26 16:17:29 +02:00
tools all: replace `import parent` with an interpreter line hack 2023-05-26 16:17:29 +02:00
.eslintignore Revert "Ignore sizzle.js in ESLint" 2022-05-23 13:33:09 +02:00
.eslintrc.json build.js: Move our front end build tool from webpack to esbuild 2023-03-27 15:22:36 +02:00
.flake8 test: drop inotify exclusions 2022-07-20 21:36:53 +02:00
.flowconfig kubernetes: Add Virtual machines side tab 2018-01-22 08:00:50 +01:00
.gitignore tools: remove jumpstart from make-dist 2023-03-21 17:43:12 +01:00
.gitleaks.toml gitleaks: Ignore mock SSH keys 2022-10-03 09:01:53 +02:00
.gitmodules Remove duplicate / from submodule url 2023-05-08 17:16:12 +02:00
.stylelintrc.json package.json: stylelint: Add logical property checker 2023-05-11 18:39:09 +02:00
AUTHORS AUTHORS: Refer to git information 2019-03-06 16:41:45 +01:00
COPYING Initial commit 2013-11-01 13:42:29 -04:00
HACKING.md build.js: Run rsync plugin also for $RSYNC env variable 2023-05-26 13:26:54 +02:00
Makefile.am tools: move make-bots, git-utils.sh to test/common 2023-05-26 16:17:29 +02:00
README.md various: replace mentions of IRC with Matrix 2023-03-29 15:41:28 +02:00
autogen.sh build: write a bare minimal PEP 517 build backend 2023-05-12 11:01:02 +02:00
build.js build.js: Run rsync plugin also for $RSYNC env variable 2023-05-26 13:26:54 +02:00
configure.ac build: add ./configure --enable-pybridge flag 2023-05-03 09:50:03 +02:00
files.js build.js: Move our front end build tool from webpack to esbuild 2023-03-27 15:22:36 +02:00
package.json package.json: Update @patternfly/patternfly, @patternfly/react-core, @patternfly/react-icons, @patternfly/react-styles, @patternfly/react-table 2023-05-20 22:06:49 +02:00
packit.yaml packit: Re-add post-upstream-clone to copr_build 2023-04-12 14:00:04 +02:00
pyproject.toml test/static-code: change approach to running ruff 2023-05-26 09:08:06 +02:00

README.md

Cockpit

A sysadmin login session in a web browser

cockpit-project.org

Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser.

Using Cockpit

You can install Cockpit on many Linux operating systems including Debian, Fedora and RHEL.

Cockpit makes Linux discoverable, allowing sysadmins to easily perform tasks such as starting containers, storage administration, network configuration, inspecting logs and so on.

Jumping between the terminal and the web tool is no problem. A service started via Cockpit can be stopped via the terminal. Likewise, if an error occurs in the terminal, it can be seen in the Cockpit journal interface.

You can also easily add other machines that have Cockpit installed and are accessible via SSH and jump between these hosts.

Development