Git Product home page Git Product logo

cockpit-certificates's Introduction

cockpit-certificates

A certificate management plugin for Cockpit

Technologies

  • cockpit-certificates communicates with certmonger through its D-Bus API.

Getting and building the source

Make sure you have npm available (usually from your distribution package). These commands check out the source and build it into the dist/ directory:

git clone https://github.com/skobyda/cockpit-certificates.git
cd cockpit-certificates
make

Installing

sudo make install compiles and installs the package in /usr/share/cockpit/. The convenience targets srpm and rpm build the source and binary rpms, respectively. Both of these make use of the dist target, which is used to generate the distribution tarball. In production mode, source files are automatically minified and compressed. Set NODE_ENV=production if you want to duplicate this behavior.

For development, you usually want to run your module straight out of the git tree. To do that, run make devel-install, which links your checkout to the location were cockpit-bridge looks for packages. If you prefer to do this manually:

mkdir -p ~/.local/share/cockpit
ln -s `pwd`/dist ~/.local/share/cockpit/cockpit-certificates

After changing the code and running make again, reload the Cockpit page in your browser.

You can also use watch mode to automatically update the bundle on every code change with

$ npm run watch

or

$ make watch

When developing against a virtual machine, watch mode can also automatically upload the code changes by setting the RSYNC environment variable to the remote hostname.

$ RSYNC=c make watch

To "uninstall" the locally installed version, run make devel-uninstall, or remove manually the symlink:

rm ~/.local/share/cockpit/cockpit-certificates

Running eslint

cockpit-certificates uses ESLint to automatically check JavaScript code style in .js and .jsx files.

eslint is executed within every build.

For developer convenience, the ESLint can be started explicitly by:

$ npm run eslint

Violations of some rules can be fixed automatically by:

$ npm run eslint:fix

Rules configuration can be found in the .eslintrc.json file.

Running tests locally

Run make check to build an RPM, install it into a standard Cockpit test VM (centos-8-stream by default), and run the test/check-application integration test on it. This uses Cockpit's Chrome DevTools Protocol based browser tests, through a Python API abstraction. Note that this API is not guaranteed to be stable, so if you run into failures and don't want to adjust tests, consider checking out Cockpit's test/common from a tag instead of main (see the test/common target in Makefile).

After the test VM is prepared, you can manually run the test without rebuilding the VM, possibly with extra options for tracing and halting on test failures (for interactive debugging):

TEST_OS=centos-8-stream test/check-application -tvs

You can also run the test against a different Cockpit image, for example:

TEST_OS=fedora-testing make check

Running tests in CI

Tests also run in Packit for all currently supported Fedora releases; see the packit.yaml control file. You need to enable Packit-as-a-service in your GitHub project to use this. To run the tests in the exact same way for upstream pull requests and for Fedora package update gating, the tests are wrapped in the FMF metadata format for using with the tmt test management tool. Note that Packit tests can not run their own virtual machine images, thus they only run @nondestructive tests.

Automated maintenance

It is important to keep your NPM modules up to date, to keep up with security updates and bug fixes. This happens with dependabot, see configuration file.

Running tests in CI

Tests run in Packit for all currently supported Fedora releases; see the packit.yaml control file. You need to enable Packit-as-a-service in your GitHub project to use this. To run the tests in the exact same way for upstream pull requests and for Fedora package update gating, the tests are wrapped in the FMF metadata format for using with the tmt test management tool. Note that Packit tests can not run their own virtual machine images, thus they only run @nondestructive tests.

cockpit-certificates's People

Contributors

allisonkarlitskaya avatar bmustiata avatar cockpituous avatar croissanne avatar dependabot[bot] avatar dperpeet avatar github-actions[bot] avatar jelly avatar kkoukiou avatar larskarlitski avatar laukr avatar lbarcziova avatar martinpitt avatar marusak avatar mvollmer avatar ptoscano avatar sabbaka avatar skobyda avatar subhoghoshx avatar tomasmatus avatar tomastomecek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cockpit-certificates's Issues

Unexpected reserved word

Hey,

I try to install cockpit certificates, but wen i type the make command, i have an error:

const esbuild = (await import(useWasm ? 'esbuild-wasm' : 'esbuild')).default;
^^^^^

SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
make: *** [Makefile:87 : dist/manifest.json] Erreur 1

IDK if it's me or not

Thx for help :)

Looking for new developers and a maintainer

As mentioned at https://fosstodon.org/@Cockpit/112488702547939715:

Is anyone using cockpit-certificates and interested in taking over its development and maintenance?

It currently works, we've kept it on life support with CI and dependabot and such, but it hasn't seen any real development in a long time.

If you are interested, please let us know. We are happy to provide guidance and help with PR reviews and such.

If nobody is interested, we'll archive the repository in two weeks.

Please contact us here in this issue and/or (ideally also) on Matrix at https://matrix.to/#/#cockpit:fedoraproject.org โ€” most Cockpit developers are usually there during European daytime hours on weekdays.

Missing `sudo` in README.md

Hi, just a little remark:

Installation requires to write to root owned directory (755):

$ ls -ld /usr/share/cockpit
drwxr-xr-x 20 root root 4096  2. Jul 15:29 /usr/share/cockpit

Therefore, it has to be sudo make install instead of make install.
This is also already the case for other Cockpit applications like cockpit-podman or cockpit-machines.

Kind regards,
Lau

webpack gets killed during build

Hi @martinpitt

I am having the same issue. I'm trying to install cockpit-certificates as is in the documentation butm when try to run "make", I get this errors:

/cockpit-certificates# make
/bin/sh: 1: rpmspec: not found
/bin/sh: 1: rpmspec: not found
/bin/sh: 1: rpmspec: not found
NODE_ENV= node_modules/.bin/webpack

WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.

You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:

  npm install --save core-js@2    npm install --save core-js@3
  yarn add core-js@2              yarn add core-js@3

More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins
More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs
Killed
make: *** [Makefile:68: dist/manifest.json] Error 137

Current configuration:

/cockpit-certificates# npm -v
6.14.4

What can be hapening?

Thanks in advance.

Originally posted by @lncproducciones in cockpit-project/cockpit-machines#436 (comment)

Page with Not Found when selecting Certificate in Applications page

After installing cockpit-certificates it appears under Applications with Podman and Storage. When Podman or Storage is selected, the web page is redirected to the linked application. Instead when clicking on Certificate a page with Not Found! appears.

Issue seems that Certificate link under Applications redirect to https://a.b.c.d:9090/cockpit-certificates instead of https://a.b.c.d:9090/certificates

Fix dialog performance issues

Debug what's chowing down on CPU and fix the horrible performance issue causing browsers to freeze and crash

When "Request certificate" dialog is open, opening dev-tools causes the browser to freeze.

ubuntu 22.04 - make dies with

root@server:/cockpit-certificates# make clean
rm -rf dist/
rm -f cockpit-certificates.spec
rm -f po/LINGUAS
root@server:
/cockpit-certificates# make

if it exists already, npm install won't update it; force that so that we always get up-to-date packages

rm -f package-lock.json

unset NODE_ENV, skips devDependencies otherwise

env -u NODE_ENV npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=16.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^14.18.0 || >=16.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.18' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead

added 447 packages, and audited 448 packages in 3m

118 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
env -u NODE_ENV npm prune
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^14.18.0 || >=16.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=16.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14.18' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }

up to date, audited 448 packages in 10s

118 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
remote: Enumerating objects: 1560, done.
remote: Counting objects: 100% (1531/1531), done.
remote: Compressing objects: 100% (1331/1331), done.
remote: Total 1481 (delta 259), reused 584 (delta 68), pack-reused 0
Receiving objects: 100% (1481/1481), 7.25 MiB | 5.08 MiB/s, done.
Resolving deltas: 100% (259/259), done.
git archive '4693a536e3262d3254d848daed251ef385ae5017^{tree}' -- pkg/lib test/common | tar x
NODE_ENV= ./build.js
file:///root/cockpit-certificates/build.js:16
const esbuild = (await import(useWasm ? 'esbuild-wasm' : 'esbuild')).default;
^^^^^

SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
make: *** [Makefile:85: dist/manifest.json] Error 1

Loading the certificate service

Hello,
Got cockpit installed under OpenSuSe Tumbleweed, and managed to install cockpit-certificates according to the instructions given.

The installation run according to the file attached. Got errors on rpmspec, an non-existent command under OpenSuSe, but it seems to be no big deal.
When I try to access the certificates session, I'm only seeing "Loading certificate Service" message.
Am I missing anything?
Would you mind on helping me with this?
Thanks a lot in advance,
BR
cockpit_certificates_installation_progress.txt

RixterSJC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.