Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
__pycache__/
build/
dist/
docker/data/
*.egg-info/
node_modules/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Oracle Java image yourself:
```

2. Visit [the Java download page](https://www.java.com/en/download/manual.jsp) and get the *Linux x64* tar archive of
Oracle Java version `8u251`. Save it to the `docker` subdirectory of the previously cloned repository as
Oracle Java version `8u251`. Save it to the `docker/data` subdirectory of the previously cloned repository as
`jre-8u251-linux-x64.tar.gz`. If you would like to also use Oracle Java 7, get `jre-7u80-linux-x64.tar.gz` from
[Oracle's Java archive](https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html) (this
requires an free Oracle account).
Expand Down
10 changes: 9 additions & 1 deletion docker/Dockerfile_html5
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
FROM node:14
LABEL maintainer="Maximilian Heuwes <[email protected]>"

# Set packages from deb.debian.com to archive.debian.com
COPY ./config/buster-sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y wget && \
wget -O /tmp/debian-keyring.deb http://http.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2025.1_all.deb && \
dpkg -i /tmp/debian-keyring.deb && \
rm /tmp/debian-keyring.deb

RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl net-tools procps python-numpy \
python-pip python-pyquery python-setuptools python-wheel tar && \
rm -rf /var/lib/apt/lists/* && \
pip install future requests && \
pip install future requests requests_file && \
mkdir /usr/local/kvm-html5/

COPY kvm-html5/package*.json /usr/local/kvm-html5/
Expand Down
15 changes: 11 additions & 4 deletions docker/Dockerfile_openjdk-7
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM debian:jessie
LABEL maintainer="Ingo Meyer <[email protected]>"

# Install needed packages and Java dependencies (second `apt-get install` call)
# Set packages from deb.debian.com to archive.debian.com
COPY ./config/jessie-sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
apt-get install -y wget && \
wget -O /tmp/debian-keyring.deb http://http.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2025.1_all.deb && \
dpkg -i /tmp/debian-keyring.deb && \
rm /tmp/debian-keyring.deb

# Install needed packages and Java dependencies (second `apt-get install` call)
RUN apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
python-pip python-pyquery python-wheel supervisor tar x11vnc xvfb && \
apt-get install -y --no-install-recommends ca-certificates-java initscripts java-common libasound2 \
libatk-wrapper-java-jni libatk1.0-0 libc6 libcairo2 libcups2 \
Expand All @@ -16,7 +23,7 @@ RUN apt-get update && \
# Add support for asian characters
apt-get install -y --no-install-recommends fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho \
fonts-ipafont-gothic fonts-unfonts-core && \
pip install future requests 'websockify<0.10' && \
pip install future requests requests_file 'websockify<0.10' && \
rm -rf /var/lib/apt/lists/*

RUN for java_version in "7u51" "7u79" "7u181"; do \
Expand Down Expand Up @@ -60,7 +67,7 @@ COPY supervisord_openjdk-7.conf /etc/supervisor/conf.d/supervisord.conf

WORKDIR /root/

ENV DISPLAY :0
ENV DISPLAY=:0
EXPOSE 8080

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
15 changes: 11 additions & 4 deletions docker/Dockerfile_openjdk-8
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM debian:stretch
LABEL maintainer="Ingo Meyer <[email protected]>"

# Install needed packages and Java dependencies (second `apt-get install` call)
# Set packages from deb.debian.com to archive.debian.com
COPY ./config/stretch-sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
apt-get install -y wget && \
wget -O /tmp/debian-keyring.deb http://http.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2025.1_all.deb && \
dpkg -i /tmp/debian-keyring.deb && \
rm /tmp/debian-keyring.deb

# Install needed packages and Java dependencies (second `apt-get install` call)
RUN apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
python-pip python-pyquery python-setuptools python-wheel supervisor tar \
x11vnc xvfb && \
apt-get install -y --no-install-recommends adwaita-icon-theme ca-certificates ca-certificates-java \
Expand Down Expand Up @@ -40,7 +47,7 @@ RUN apt-get update && \
# Add support for asian characters
apt-get install -y --no-install-recommends fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho \
fonts-ipafont-gothic fonts-unfonts-core && \
pip install future requests 'websockify<0.10' && \
pip install future requests requests_file 'websockify<0.10' && \
rm -rf /var/lib/apt/lists/*

RUN for java_version in "8u91" "8u242"; do \
Expand Down Expand Up @@ -76,7 +83,7 @@ COPY supervisord_openjdk-8.conf /etc/supervisor/conf.d/supervisord.conf

WORKDIR /root/

ENV DISPLAY :0
ENV DISPLAY=:0
EXPOSE 8080

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
17 changes: 12 additions & 5 deletions docker/Dockerfile_oraclejre-7
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM debian:stretch
LABEL maintainer="Ingo Meyer <[email protected]>"

# Install needed packages and Java dependencies (second `apt-get install` call)
# Set packages from deb.debian.com to archive.debian.com
COPY ./config/stretch-sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
apt-get install -y wget && \
wget -O /tmp/debian-keyring.deb http://http.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2025.1_all.deb && \
dpkg -i /tmp/debian-keyring.deb && \
rm /tmp/debian-keyring.deb

# Install needed packages and Java dependencies (second `apt-get install` call)
RUN apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
python-pip python-pyquery python-setuptools python-wheel supervisor tar \
x11vnc xvfb && \
apt-get install -y --no-install-recommends adwaita-icon-theme ca-certificates ca-certificates-java \
Expand Down Expand Up @@ -40,7 +47,7 @@ RUN apt-get update && \
# Add support for asian characters
apt-get install -y --no-install-recommends fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho \
fonts-ipafont-gothic fonts-unfonts-core && \
pip install future requests 'websockify<0.10' && \
pip install future requests requests_file 'websockify<0.10' && \
rm -rf /var/lib/apt/lists/*

RUN NOVNC_VERSION="1.1.0" && \
Expand All @@ -49,7 +56,7 @@ RUN NOVNC_VERSION="1.1.0" && \
ln -s "/opt/noVNC-${NOVNC_VERSION}/utils/launch.sh" /usr/local/bin/launch_novnc && \
rm -f /tmp/novnc.tar.gz

COPY jre-7u80-linux-x64.tar.gz /opt/java_packages/7u80/jre-7u80-linux-x64.tar.gz
COPY data/jre-7u80-linux-x64.tar.gz /opt/java_packages/7u80/jre-7u80-linux-x64.tar.gz

COPY entrypoint.sh /usr/local/bin/docker-entrypoint
COPY get_java_viewer.py /usr/local/bin/get_java_viewer
Expand All @@ -58,7 +65,7 @@ COPY supervisord_oraclejre-7.conf /etc/supervisor/conf.d/supervisord.conf

WORKDIR /root/

ENV DISPLAY :0
ENV DISPLAY=:0
EXPOSE 8080

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
17 changes: 12 additions & 5 deletions docker/Dockerfile_oraclejre-8
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM debian:stretch
LABEL maintainer="Ingo Meyer <[email protected]>"

# Install needed packages and Java dependencies (second `apt-get install` call)
# Set packages from deb.debian.com to archive.debian.com
COPY ./config/stretch-sources.list /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
apt-get install -y wget && \
wget -O /tmp/debian-keyring.deb http://http.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2025.1_all.deb && \
dpkg -i /tmp/debian-keyring.deb && \
rm /tmp/debian-keyring.deb

# Install needed packages and Java dependencies (second `apt-get install` call)
RUN apt-get install -y --no-install-recommends ca-certificates curl eterm fluxbox net-tools procps python-numpy \
python-pip python-pyquery python-setuptools python-wheel supervisor tar \
x11vnc xvfb && \
apt-get install -y --no-install-recommends adwaita-icon-theme ca-certificates ca-certificates-java \
Expand Down Expand Up @@ -40,7 +47,7 @@ RUN apt-get update && \
# Add support for asian characters
apt-get install -y --no-install-recommends fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho \
fonts-ipafont-gothic fonts-unfonts-core && \
pip install future requests 'websockify<0.10' && \
pip install future requests requests_file 'websockify<0.10' && \
rm -rf /var/lib/apt/lists/*

RUN NOVNC_VERSION="1.1.0" && \
Expand All @@ -49,7 +56,7 @@ RUN NOVNC_VERSION="1.1.0" && \
ln -s "/opt/noVNC-${NOVNC_VERSION}/utils/launch.sh" /usr/local/bin/launch_novnc && \
rm -f /tmp/novnc.tar.gz

COPY jre-8u251-linux-x64.tar.gz /opt/java_packages/8u251/jre-8u251-linux-x64.tar.gz
COPY data/jre-8u251-linux-x64.tar.gz /opt/java_packages/8u251/jre-8u251-linux-x64.tar.gz

COPY entrypoint.sh /usr/local/bin/docker-entrypoint
COPY get_java_viewer.py /usr/local/bin/get_java_viewer
Expand All @@ -58,7 +65,7 @@ COPY supervisord_oraclejre-8.conf /etc/supervisor/conf.d/supervisord.conf

WORKDIR /root/

ENV DISPLAY :0
ENV DISPLAY=:0
EXPOSE 8080

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
11 changes: 6 additions & 5 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ build-openjdk:
done

build-oracle:
@if [[ -f "jre-7u80-linux-x64.tar.gz" ]]; then \
@if [ -f "data/jre-7u80-linux-x64.tar.gz" ]; then \
docker build -t "sciapp/nojava-ipmi-kvm:latest-oraclejre-7" -f "Dockerfile_oraclejre-7" .; \
if [[ "$$(git symbolic-ref -q HEAD)" == "refs/heads/master" ]]; then \
if [ "$$(git symbolic-ref -q HEAD)" = "refs/heads/master" ]; then \
docker tag "sciapp/nojava-ipmi-kvm:latest-oraclejre-7" \
"sciapp/nojava-ipmi-kvm:v$(PACKAGE_VERSION)-oraclejre-7"; \
fi; \
else \
>&2 echo "Please download \"jre-7u80-linux-x64.tar.gz\" to build an Oracle Java 7 docker image."; \
fi; \
if [[ -f "jre-8u251-linux-x64.tar.gz" ]]; then \
fi;

@if [ -f "data/jre-8u251-linux-x64.tar.gz" ]; then \
docker build -t "sciapp/nojava-ipmi-kvm:latest-oraclejre-8" -f "Dockerfile_oraclejre-8" .; \
if [[ "$$(git symbolic-ref -q HEAD)" == "refs/heads/master" ]]; then \
if [ "$$(git symbolic-ref -q HEAD)" = "refs/heads/master" ]; then \
docker tag "sciapp/nojava-ipmi-kvm:latest-oraclejre-8" \
"sciapp/nojava-ipmi-kvm:v$(PACKAGE_VERSION)-oraclejre-8"; \
fi; \
Expand Down
2 changes: 2 additions & 0 deletions docker/config/buster-sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deb [trusted=yes] http://archive.debian.org/debian buster main
deb [trusted=yes] http://archive.debian.org/debian-security buster/updates main
2 changes: 2 additions & 0 deletions docker/config/jessie-sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deb [trusted=yes] http://archive.debian.org/debian jessie main
deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main
2 changes: 2 additions & 0 deletions docker/config/stretch-sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deb [trusted=yes] http://archive.debian.org/debian stretch main
deb [trusted=yes] http://archive.debian.org/debian-security stretch/updates main
1 change: 1 addition & 0 deletions docker/data/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 4 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

read -r -s PASSWD
if [[ ! -v PASSWD ]]; then
read -r -s PASSWD
fi

echo "${PASSWD}" | /usr/local/bin/get_java_viewer -o /tmp/launch.jnlp "$@"
return_code="$?"
if [[ "${return_code}" -ne 0 ]]; then
Expand Down
5 changes: 5 additions & 0 deletions docker/get_java_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import urllib.parse
import sys
import json
from requests_file import FileAdapter

try:
from typing import Any, Dict, Optional, Text # noqa: F401 # pylint: disable=unused-import
Expand Down Expand Up @@ -259,6 +260,7 @@ def get_java_viewer(
base_url = "https://{}".format(hostname)
download_url = urllib.parse.urljoin(base_url, download_endpoint)
session = requests.Session()
session.mount("file://", FileAdapter())

def do_login(session_cookie_key):
# type: (Optional[Text]) -> None
Expand Down Expand Up @@ -297,6 +299,9 @@ def do_login(session_cookie_key):
print(json.dumps({"cookies": session.cookies.get_dict(), "headers": dict(session.headers)}))
return

if download_endpoint.startswith('file://'):
download_url = download_endpoint

# Download the kvm viewer with the previous created session
response = session.get(download_url, verify=ssl_verify)
if response.status_code != 200:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_long_description_from_readme(readme_filename="README.md"):
version=version,
packages=find_packages(),
python_requires="~=3.5",
install_requires=["requests", "yacl", "pyyaml"],
install_requires=["requests", "yacl", "pyyaml", "requests_file"],
extras_require={"GUI": ["PyQt5>=5.12", "PyQtWebEngine>=5.12"]},
entry_points={"console_scripts": ["nojava-ipmi-kvm = nojava_ipmi_kvm.cli:main"]},
author="Ingo Meyer",
Expand Down