Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with CentOS 8 Stream and docker-ce? #3

Open
edmondsiu0 opened this issue Feb 2, 2021 · 8 comments
Open

Compatibility with CentOS 8 Stream and docker-ce? #3

edmondsiu0 opened this issue Feb 2, 2021 · 8 comments

Comments

@edmondsiu0
Copy link

edmondsiu0 commented Feb 2, 2021

I have compiled this and moved the dist into my cockpit directory /usr/share/cockpit.

However, it is not working with the following error:

Uncaught ReferenceError: jQuery is not defined
    at Object.jquery (docker.js:216946)
    at __webpack_require__ (docker.js:20)
    at Module../pkg/docker/containers.js (docker.js:209491)
    at __webpack_require__ (docker.js:20)
    at Object.0 (docker.js:216923)
    at __webpack_require__ (docker.js:20)
    at docker.js:84
    at docker.js:87

Looking at the docker/index.html file, it is expecting a jquery.js file under ../base1/jquery.js, but this file doesn't exist in this installation of cockpit.

# grep -n -i jquery docker/index.html -A5 -B5
23-    <title translate="yes">Containers</title>
24-    <meta charset="utf-8">
25-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
26-    <link href="../base1/patternfly.css" type="text/css" rel="stylesheet">
27-    <link href="docker.css" type="text/css" rel="stylesheet" id="term-style">
28:    <script src="../base1/jquery.js"></script>
29-    <script src="../base1/cockpit.js"></script>
30-    <script src="../*/po.js"></script>
31-    <script src="docker.js"></script>
32-</head>
33-<body class="pf-m-redhat-font" hidden>
# ls -lah | grep -i jquery
#

I'm not much of a web developer, any idea how this could be rectified or worked around?

Edit:

cockpit package:

# yum info cockpit
Last metadata expiration check: 2:29:47 ago on Tue Feb  2 12:20:11 2021.
Installed Packages
Name         : cockpit
Version      : 235
Release      : 1.el8
Architecture : x86_64
Size         : 56 k
Source       : cockpit-235-1.el8.src.rpm
Repository   : @System
From repo    : anaconda
Summary      : Web Console for Linux servers
URL          : https://cockpit-project.org/
License      : LGPLv2+
Description  : The Cockpit Web Console enables users to administer GNU/Linux servers using a
             : web browser.
             :
             : It offers network configuration, log inspection, diagnostic reports, SELinux
             : troubleshooting, interactive command-line sessions, and more.

Environment:

# cat /etc/os-release
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
@edmondsiu0
Copy link
Author

edmondsiu0 commented Feb 2, 2021

I have found this jquery.min.js.gz from an old installation of cockpit, and I sticked it into /usr/share/cockpit/base1/jquery.min.js.gz, and that was enough to get this module to work.

Don't know if it's better to bundle this jquery.min.js.gz within this module, if the latest cockpit doesn't supply this file, or whether that's going to cause other issues....

@Xantios
Copy link
Owner

Xantios commented Feb 2, 2021

Hey,

I don't have a Centos 8 install ready, so I can't validate if this works or not.
I guess I'll setup a docker container to check this out :-)

Let me get back on this when I have that up and running

@edmondsiu0 edmondsiu0 changed the title Compatibility with CentOS 8 and docker-ce? Compatibility with CentOS 8 Stream and docker-ce? Feb 2, 2021
@HoECoder
Copy link

HoECoder commented Mar 4, 2021

I can report that if you grab the latest jQuery from their site, compress it with gzip, and drop it in the global directory, it works.

https://jquery.com/download/

I'm using a fresh debian buster install.

@Xantios
Copy link
Owner

Xantios commented Mar 4, 2021

Did you run the install script at all?
it should pull in jQuery from npm and get build by web pack.

I tried this on ubuntu-latest and it worked like a charm.

the readme is updated quite recently. check it out :-)

@HoECoder
Copy link

HoECoder commented Mar 5, 2021

@Xantios I did, ran the script with one change; I swapped the symlink to the user directory to symlink to the global:

# Link as user module
mkdir -p ~/.local/share/cockpit
#ln -s $PWD/dist/docker $HOME/.local/share/cockpit/docker
sudo ln -s $PWD/dist/docker /usr/share/cockpit/docker

I'm not the best at Node.js, but I think the way cockpit has it setup is that it is looking for assets in /usr/share/cockpit/base1/.

@HoECoder
Copy link

HoECoder commented Mar 5, 2021

This is on a fresh debian 10 box with the latest docker out of the repo. My copy of cockpit is out of the buster backports.

@Xantios
Copy link
Owner

Xantios commented Mar 11, 2021

Can you please try to run the script as is?

if that works you can move the plugin anywhere your heart desires afterwards, but just to make sure there isn't a weird bug in webpack :-)

I --think-- the path is hardcoded on one or more places (and this is the easiest way to make sure of that)

@romano21A
Copy link

I had the same problem on Fedora 34 Server when running the unmodified install script.
Can confirm that this fixes it:

I can report that if you grab the latest jQuery from their site, compress it with gzip, and drop it in the global directory, it works.

https://jquery.com/download/

I'm using a fresh debian buster install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants