Compare commits

..

1 commit

Author SHA1 Message Date
Doro Wu
451acd7779
fix: ffmpeg download link 2019-12-20 04:22:57 +08:00
58 changed files with 2254 additions and 3846 deletions

View file

@ -1,32 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Versions (please complete the following information):**
- OS: [e.g. Ubuntu 18.04]
- image tag [e.g. develop]
**Additional context**
Add any other context about the problem here.

View file

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View file

@ -1,41 +0,0 @@
# Architecture of the container #
Components
============
The container contains the following components :
- An Ubuntu base system
- The tini + supervisord startup and daemon control system
- Nginx Web server
- A backend ("novnc2") Python Web app providing an API (written with
Flask) on port 6079
- A frontend VueJS Web app displayed to the user, which will wrap noVNC
- noVNC + WebSockify providing the Web VNC client in an HTML5 canvas
- Xvfb running the X11 server in memory
- x11vnc exporting the X11 display through VNC
- and all regular X applications, like the LXDE desktop and apps
Wiring them all
------------------
Internally, Xvfb will be started in DISPLAY :1, then x11vnc will
provide access to it on the default VNC port (5900).
noVNC will be started listening to HTTP requests on port 6081.
It is possible to connect directly to port 6081 of the container, to
only use the regular noVNC Web interface (provided it is exported by
the container).
Above noVNC stands the VueJS frontend Web app provided by nginx, which
will proxy the noVNC canvas, and will add some useful features over
noVNC.
User-oriented features
==========================
The Web frontend adds the following features :
- upon display of the Web page, the app will detect the size of the
Web browser's window, and will invoke the backend API so as to make
sure the noVNC rendering ajusts to that size
- provide a flash video rendering transporting the sound (???)

View file

@ -1,41 +1,18 @@
# Get code
# Run in local
```
git clone --recursive https://github.com/fcwu/docker-ubuntu-vnc-desktop
```
or, if you have already cloned it, get submodules contents :
```
git submodule init; git submodule update
```
# Test local code
## Test-run in container rebuilt from local repo
You may edit the code in your local copy of the repo, rebuild the
container, and test the changes:
```
make clean
FLAVOR=lxqt ARCH=amd64 IMAGE=ubuntu:18.04 make build
make build
make run
```
## develop backend
You may wish to work on the backend app. As the "make run" makes sure
to mount the current dir contents under /src in the container, you can
proceed as such (no compilation of the Python code):
```
make shell
supervisorctl -c /etc/supervisor/supervisord.conf stop web
supervisorctl stop web
cd /src/image/usr/local/lib/web/backend
./run.py --debug
```
## develop frontend
```
cd web
yarn add

View file

@ -1 +0,0 @@
Dockerfile.amd64

94
Dockerfile Normal file
View file

@ -0,0 +1,94 @@
################################################################################
# base system
################################################################################
FROM ubuntu:16.04 as system
ARG localbuild
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://tw.archive.ubuntu.com/#' /etc/apt/sources.list; fi
# built-in packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common curl apache2-utils \
&& add-apt-repository ppa:fcwu-tw/apps \
&& apt-get update \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
supervisor nginx sudo vim-tiny net-tools zenity xz-utils \
dbus-x11 x11-utils alsa-utils \
mesa-utils libgl1-mesa-dri \
lxde x11vnc xvfb \
gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
firefox chromium-browser \
ttf-ubuntu-font-family ttf-wqy-zenhei \
&& add-apt-repository -r ppa:fcwu-tw/apps \
&& apt-get autoclean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
# Additional packages require ~600MB
# libreoffice pinta language-pack-zh-hant language-pack-gnome-zh-hant firefox-locale-zh-hant libreoffice-l10n-zh-tw
# tini for subreap
ARG TINI_VERSION=v0.9.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
RUN chmod +x /bin/tini
# ffmpeg
RUN mkdir -p /usr/local/ffmpeg \
&& curl -sSL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar xJvf - -C /usr/local/ffmpeg/ --strip 1
# python library
COPY image/usr/local/lib/web/backend/requirements.txt /tmp/
RUN apt-get update \
&& dpkg-query -W -f='${Package}\n' > /tmp/a.txt \
&& apt-get install -y python-pip python-dev build-essential \
&& pip install setuptools wheel && pip install -r /tmp/requirements.txt \
&& dpkg-query -W -f='${Package}\n' > /tmp/b.txt \
&& apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt
################################################################################
# builder
################################################################################
FROM ubuntu:16.04 as builder
ARG localbuild
RUN if [ "x$localbuild" != "x" ]; then sed -i 's#http://archive.ubuntu.com/#http://tw.archive.ubuntu.com/#' /etc/apt/sources.list; fi
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn \
&& npm run build
################################################################################
# merge
################################################################################
FROM system
LABEL maintainer="fcwu.tw@gmail.com"
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/
COPY image /
EXPOSE 80
WORKDIR /root
ENV HOME=/home/ubuntu \
SHELL=/bin/bash
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1/api/health
ENTRYPOINT ["/startup.sh"]

View file

@ -1,129 +0,0 @@
# Built with arch: amd64 flavor: lxde image: ubuntu:20.04
#
################################################################################
# base system
################################################################################
FROM ubuntu:20.04 as system
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
# built-in packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
&& apt install -y --no-install-recommends software-properties-common curl apache2-utils \
&& apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
supervisor nginx sudo net-tools zenity xz-utils \
dbus-x11 x11-utils alsa-utils \
mesa-utils libgl1-mesa-dri \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# install debs error if combine together
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
xvfb x11vnc \
vim-tiny firefox ttf-ubuntu-font-family ttf-wqy-zenhei \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN apt update \
&& apt install -y gpg-agent \
&& curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& (dpkg -i ./google-chrome-stable_current_amd64.deb || apt-get install -fy) \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add \
&& rm google-chrome-stable_current_amd64.deb \
&& rm -rf /var/lib/apt/lists/*
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Additional packages require ~600MB
# libreoffice pinta language-pack-zh-hant language-pack-gnome-zh-hant firefox-locale-zh-hant libreoffice-l10n-zh-tw
# tini to fix subreap
ARG TINI_VERSION=v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
RUN chmod +x /bin/tini
# ffmpeg
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /usr/local/ffmpeg \
&& ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg
# python library
COPY rootfs/usr/local/lib/web/backend/requirements.txt /tmp/
RUN apt-get update \
&& dpkg-query -W -f='${Package}\n' > /tmp/a.txt \
&& apt-get install -y python3-pip python3-dev build-essential \
&& pip3 install setuptools wheel && pip3 install -r /tmp/requirements.txt \
&& ln -s /usr/bin/python3 /usr/local/bin/python \
&& dpkg-query -W -f='${Package}\n' > /tmp/b.txt \
&& apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt
################################################################################
# builder
################################################################################
FROM ubuntu:20.04 as builder
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg patch
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn \
&& yarn build
RUN sed -i 's#app/locale/#novnc/app/locale/#' /src/web/dist/static/novnc/app/ui.js
################################################################################
# merge
################################################################################
FROM system
LABEL maintainer="fcwu.tw@gmail.com"
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/
COPY rootfs /
RUN ln -sf /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify && \
chmod +x /usr/local/lib/web/frontend/static/websockify/run
EXPOSE 80
WORKDIR /root
ENV HOME=/home/ubuntu \
SHELL=/bin/bash
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1:6079/api/health
ENTRYPOINT ["/startup.sh"]

View file

@ -1,129 +0,0 @@
# Built with arch: arm64 flavor: lxde image: ubuntu:18.04
#
################################################################################
# base system
################################################################################
# qemu helper for arm build
FROM ubuntu:20.04 as amd64
RUN apt update && apt install -y qemu-user-static
FROM arm64v8/ubuntu:20.04 as system
COPY --from=amd64 /usr/bin/qemu-aarch64-static /usr/bin/
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
# built-in packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
&& apt install -y --no-install-recommends software-properties-common curl apache2-utils \
&& apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
supervisor nginx sudo net-tools zenity xz-utils \
dbus-x11 x11-utils alsa-utils \
mesa-utils libgl1-mesa-dri \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# install debs error if combine together
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
xvfb x11vnc \
vim-tiny firefox chromium-browser ttf-ubuntu-font-family ttf-wqy-zenhei \
&& add-apt-repository -r ppa:fcwu-tw/apps \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Additional packages require ~600MB
# libreoffice pinta language-pack-zh-hant language-pack-gnome-zh-hant firefox-locale-zh-hant libreoffice-l10n-zh-tw
# tini for subreap
ARG TINI_VERSION=v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-arm64 /bin/tini
RUN chmod +x /bin/tini
# ffmpeg
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /usr/local/ffmpeg \
&& ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg
# python library
COPY rootfs/usr/local/lib/web/backend/requirements.txt /tmp/
RUN apt-get update \
&& dpkg-query -W -f='${Package}\n' > /tmp/a.txt \
&& apt-get install -y python3-pip python3-dev build-essential \
&& pip3 install setuptools wheel && pip3 install -r /tmp/requirements.txt \
&& ln -s /usr/bin/python3 /usr/local/bin/python \
&& dpkg-query -W -f='${Package}\n' > /tmp/b.txt \
&& apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt
################################################################################
# builder
################################################################################
FROM ubuntu:20.04 as builder
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg patch
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn \
&& yarn build
RUN sed -i 's#app/locale/#novnc/app/locale/#' /src/web/dist/static/novnc/app/ui.js
RUN cd /src/web/dist/static/novnc && patch -p0 < /src/web/novnc-armhf-1.patch
################################################################################
# merge
################################################################################
FROM system
LABEL maintainer="fcwu.tw@gmail.com"
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/
COPY rootfs /
RUN ln -sf /usr/local/lib/web/frontend/static/websockify" "/usr/local/lib/web/frontend/static/novnc/utils/websockify && chmod +x /usr/local/lib/web/frontend/static/websockify/run
RUN ln -sf /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify && \
chmod +x /usr/local/lib/web/frontend/static/websockify/run
EXPOSE 80
WORKDIR /root
ENV HOME=/home/ubuntu \
SHELL=/bin/bash
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1:6079/api/health
ENTRYPOINT ["/startup.sh"]

View file

@ -1,124 +0,0 @@
# Built with arch: armhf flavor: lxde image: ubuntu:18.04
#
################################################################################
# base system
################################################################################
# qemu helper for arm build
FROM ubuntu:18.04 as amd64
RUN apt update && apt install -y qemu-user-static
FROM arm32v7/ubuntu:18.04 as system
COPY --from=amd64 /usr/bin/qemu-arm-static /usr/bin/
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
# built-in packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
&& apt install -y --no-install-recommends software-properties-common curl apache2-utils \
&& apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
supervisor nginx sudo net-tools zenity xz-utils \
dbus-x11 x11-utils alsa-utils \
mesa-utils libgl1-mesa-dri \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# install debs error if combine together
RUN add-apt-repository -y ppa:fcwu-tw/apps \
&& apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
xvfb x11vnc=0.9.16-1 \
vim-tiny firefox chromium-browser ttf-ubuntu-font-family ttf-wqy-zenhei \
&& add-apt-repository -r ppa:fcwu-tw/apps \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Additional packages require ~600MB
# libreoffice pinta language-pack-zh-hant language-pack-gnome-zh-hant firefox-locale-zh-hant libreoffice-l10n-zh-tw
# tini for subreap
ARG TINI_VERSION=v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-armhf /bin/tini
RUN chmod +x /bin/tini
# ffmpeg
RUN mkdir -p /usr/local/ffmpeg \
&& curl -sSL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar xJvf - -C /usr/local/ffmpeg/ --strip 1
# python library
COPY rootfs/usr/local/lib/web/backend/requirements.txt /tmp/
RUN apt-get update \
&& dpkg-query -W -f='${Package}\n' > /tmp/a.txt \
&& apt-get install -y python-pip python-dev build-essential \
&& pip install setuptools wheel && pip install -r /tmp/requirements.txt \
&& dpkg-query -W -f='${Package}\n' > /tmp/b.txt \
&& apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt
################################################################################
# builder
################################################################################
FROM ubuntu:18.04 as builder
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg patch
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn \
&& yarn run build
RUN sed -i 's#app/locale/#novnc/app/locale/#' /src/web/dist/static/novnc/app/ui.js
RUN cd /src/web/dist/static/novnc && patch -p0 < /src/web/novnc-armhf-1.patch
################################################################################
# merge
################################################################################
FROM system
LABEL maintainer="fcwu.tw@gmail.com"
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/
COPY rootfs /
RUN ln -sf /usr/local/lib/web/frontend/static/websockify" "/usr/local/lib/web/frontend/static/novnc/utils/websockify && chmod +x /usr/local/lib/web/frontend/static/websockify/run
RUN ln -sf /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify && \
chmod +x /usr/local/lib/web/frontend/static/websockify/run
EXPOSE 80
WORKDIR /root
ENV HOME=/home/ubuntu \
SHELL=/bin/bash
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1:6079/api/health
ENTRYPOINT ["/startup.sh"]

View file

@ -1,137 +0,0 @@
# Built with arch: {{ arch }} flavor: {{ flavor }} image: {{ image }}
#
################################################################################
# base system
################################################################################
{%if arch == "amd64"%}
FROM {{image}} as system
{%elif arch == "armhf"%}
# qemu helper for arm build
FROM {{image}} as amd64
RUN apt update && apt install -y qemu-user-static
FROM arm32v7/{{image}} as system
COPY --from=amd64 /usr/bin/qemu-arm-static /usr/bin/
{%endif%}
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
# built-in packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
&& apt install -y --no-install-recommends software-properties-common curl apache2-utils \
&& apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
supervisor nginx sudo net-tools zenity xz-utils \
dbus-x11 x11-utils alsa-utils \
mesa-utils libgl1-mesa-dri \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# install debs error if combine together
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
xvfb x11vnc \
vim-tiny firefox ttf-ubuntu-font-family ttf-wqy-zenhei \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN apt update \
&& apt install -y gpg-agent \
&& curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& (dpkg -i ./google-chrome-stable_current_amd64.deb || apt-get install -fy) \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add \
&& rm google-chrome-stable_current_amd64.deb \
&& rm -rf /var/lib/apt/lists/*
{%if desktop == "lxde" %}
{%endif%}
{%if desktop == "lxqt" %}
{%endif%}
{%if desktop == "xfce4" %}
{%endif%}
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
&& apt autoclean -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Additional packages require ~600MB
# libreoffice pinta language-pack-zh-hant language-pack-gnome-zh-hant firefox-locale-zh-hant libreoffice-l10n-zh-tw
# tini to fix subreap
ARG TINI_VERSION=v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
RUN chmod +x /bin/tini
# ffmpeg
RUN apt update \
&& apt install -y --no-install-recommends --allow-unauthenticated \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /usr/local/ffmpeg \
&& ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg
# python library
COPY rootfs/usr/local/lib/web/backend/requirements.txt /tmp/
RUN apt-get update \
&& dpkg-query -W -f='${Package}\n' > /tmp/a.txt \
&& apt-get install -y python3-pip python3-dev build-essential \
&& pip3 install setuptools wheel && pip3 install -r /tmp/requirements.txt \
&& ln -s /usr/bin/python3 /usr/local/bin/python \
&& dpkg-query -W -f='${Package}\n' > /tmp/b.txt \
&& apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt
################################################################################
# builder
################################################################################
FROM {{image}} as builder
{% if localbuild == 1 %}
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
{% endif %}
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg patch
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs
# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn
# build frontend
COPY web /src/web
RUN cd /src/web \
&& yarn \
&& yarn build
RUN sed -i 's#app/locale/#novnc/app/locale/#' /src/web/dist/static/novnc/app/ui.js
{%if arch == "armhf"%}
RUN cd /src/web/dist/static/novnc && patch -p0 < /src/web/novnc-armhf-1.patch
{%endif%}
################################################################################
# merge
################################################################################
FROM system
LABEL maintainer="fcwu.tw@gmail.com"
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/
COPY rootfs /
RUN ln -sf /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify && \
chmod +x /usr/local/lib/web/frontend/static/websockify/run
EXPOSE 80
WORKDIR /root
ENV HOME=/home/ubuntu \
SHELL=/bin/bash
HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1:6079/api/health
ENTRYPOINT ["/startup.sh"]

View file

@ -1,61 +1,27 @@
.PHONY: build run
# Default values for variables
REPO ?= dorowu/ubuntu-desktop-lxde-vnc
TAG ?= latest
# you can choose other base image versions
IMAGE ?= ubuntu:20.04
# IMAGE ?= nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
# choose from supported flavors (see available ones in ./flavors/*.yml)
FLAVOR ?= lxde
# armhf or amd64
ARCH ?= amd64
# These files will be generated from teh Jinja templates (.j2 sources)
templates = Dockerfile rootfs/etc/supervisor/conf.d/supervisord.conf
build:
docker build -t $(REPO):$(TAG) --build-arg localbuild=1 .
# Rebuild the container image
build: $(templates)
docker build -t $(REPO):$(TAG) .
# Test run the container
# the local dir will be mounted under /src read-only
run:
docker run --privileged --rm \
docker run --rm \
-p 6080:80 -p 6081:443 \
-v ${PWD}:/src:ro \
-e USER=doro -e PASSWORD=mypassword \
-e ALSADEV=hw:2,0 \
-e SSL_PORT=443 \
-e RELATIVE_URL_ROOT=approot \
-e OPENBOX_ARGS="--startup /usr/bin/galculator" \
-v ${PWD}/ssl:/etc/nginx/ssl \
--device /dev/snd \
--name ubuntu-desktop-lxde-test \
$(REPO):$(TAG)
# Connect inside the running container for debugging
shell:
docker exec -it ubuntu-desktop-lxde-test bash
# Generate the SSL/TLS config for HTTPS
gen-ssl:
mkdir -p ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout ssl/nginx.key -out ssl/nginx.crt
clean:
rm -f $(templates)
extra-clean:
docker rmi $(REPO):$(TAG)
docker image prune -f
# Run jinja2cli to parse Jinja template applying rules defined in the flavors definitions
%: %.j2 flavors/$(FLAVOR).yml
docker run -v $(shell pwd):/data vikingco/jinja2cli \
-D flavor=$(FLAVOR) \
-D image=$(IMAGE) \
-D localbuild=$(LOCALBUILD) \
-D arch=$(ARCH) \
$< flavors/$(FLAVOR).yml > $@ || rm $@

124
README.md
View file

@ -1,129 +1,99 @@
# docker-ubuntu-vnc-desktop
docker-ubuntu-vnc-desktop
=========================
[![Docker Pulls](https://img.shields.io/docker/pulls/dorowu/ubuntu-desktop-lxde-vnc.svg)](https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/)
[![Docker Stars](https://img.shields.io/docker/stars/dorowu/ubuntu-desktop-lxde-vnc.svg)](https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/)
docker-ubuntu-vnc-desktop is a Docker image to provide web VNC interface to access Ubuntu LXDE/LxQT desktop environment.
Docker image to provide HTML5 VNC interface to access Ubuntu 16.04 LXDE desktop environment.
<!-- @import "[TOC]" {cmd="toc" depthFrom=2 depthTo=2 orderedList=false} -->
<!-- code_chunk_output -->
- [Quick Start](#quick-start)
- [VNC Viewer](#vnc-viewer)
- [HTTP Base Authentication](#http-base-authentication)
- [SSL](#ssl)
- [Screen Resolution](#screen-resolution)
- [Default Desktop User](#default-desktop-user)
- [Deploy to a subdirectory (relative url root)](#deploy-to-a-subdirectory-relative-url-root)
- [Sound (Preview version and Linux only)](#sound-preview-version-and-linux-only)
- [Generate Dockerfile from jinja template](#generate-dockerfile-from-jinja-template)
- [Troubleshooting and FAQ](#troubleshooting-and-faq)
- [License](#license)
<!-- /code_chunk_output -->
## Quick Start
Quick Start
-------------------------
Run the docker container and access with port `6080`
```shell
docker run -p 6080:80 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
docker run -p 6080:80 dorowu/ubuntu-desktop-lxde-vnc
```
Browse http://127.0.0.1:6080/
<img src="https://raw.github.com/fcwu/docker-ubuntu-vnc-desktop/master/screenshots/lxde.png?v1" width=700/>
### Ubuntu Flavors
Choose your favorite Ubuntu version with [tags](https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/tags/)
- focal: Ubuntu 20.04 (latest)
- focal-lxqt: Ubuntu 20.04 LXQt
- bionic: Ubuntu 18.04
- bionic-lxqt: Ubuntu 18.04 LXQt
- xenial: Ubuntu 16.04 (deprecated)
- trusty: Ubuntu 14.04 (deprecated)
## VNC Viewer
VNC Viewer
------------------
Forward VNC service port 5900 to host by
```shell
docker run -p 6080:80 -p 5900:5900 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
docker run -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc
```
Now, open the vnc viewer and connect to port 5900. If you would like to protect vnc service by password, set environment variable `VNC_PASSWORD`, for example
```shell
docker run -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
docker run -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword dorowu/ubuntu-desktop-lxde-vnc
```
A prompt will ask password either in the browser or vnc viewer.
## HTTP Base Authentication
HTTP Base Authentication
---------------------------
This image provides base access authentication of HTTP via `HTTP_PASSWORD`
```shell
docker run -p 6080:80 -e HTTP_PASSWORD=mypassword -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
docker run -p 6080:80 -e HTTP_PASSWORD=mypassword dorowu/ubuntu-desktop-lxde-vnc
```
## SSL
SSL
--------------------
To connect with SSL, generate self signed SSL certificate first if you don't have it
```shell
```
mkdir -p ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ssl/nginx.key -out ssl/nginx.crt
```
Specify SSL port by `SSL_PORT`, certificate path to `/etc/nginx/ssl`, and forward it to 6081
```shell
docker run -p 6081:443 -e SSL_PORT=443 -v ${PWD}/ssl:/etc/nginx/ssl -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
docker run -p 6081:443 -e SSL_PORT=443 -v ${PWD}/ssl:/etc/nginx/ssl dorowu/ubuntu-desktop-lxde-vnc
```
## Screen Resolution
Screen Resolution
------------------
The Resolution of virtual desktop adapts browser window size when first connecting the server. You may choose a fixed resolution by passing `RESOLUTION` environment variable, for example
```shell
docker run -p 6080:80 -e RESOLUTION=1920x1080 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
docker run -p 6080:80 -e RESOLUTION=1920x1080 dorowu/ubuntu-desktop-lxde-vnc
```
## Default Desktop User
Default Desktop User
--------------------
The default user is `root`. You may change the user and password respectively by `USER` and `PASSWORD` environment variable, for example,
```shell
docker run -p 6080:80 -e USER=doro -e PASSWORD=password -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc
```
docker run -p 6080:80 -e USER=doro -e PASSWORD=password dorowu/ubuntu-desktop-lxde-vnc
```
## Deploy to a subdirectory (relative url root)
You may deploy this application to a subdirectory, for example `/some-prefix/`. You then can access application by `http://127.0.0.1:6080/some-prefix/`. This can be specified using the `RELATIVE_URL_ROOT` configuration option like this
```shell
docker run -p 6080:80 -e RELATIVE_URL_ROOT=some-prefix dorowu/ubuntu-desktop-lxde-vnc
```
NOTE: this variable should not have any leading and trailing splash (/)
## Sound (Preview version and Linux only)
Sound (Preview version and Linux only)
-------------------
It only works in Linux.
First of all, insert kernel module `snd-aloop` and specify `2` as the index of sound loop device
```shell
```
sudo modprobe snd-aloop index=2
```
Start the container
```shell
```
docker run -it --rm -p 6080:80 --device /dev/snd -e ALSADEV=hw:2,0 dorowu/ubuntu-desktop-lxde-vnc
```
@ -136,29 +106,13 @@ Following is the screen capture of these operations. Turn on your sound at the e
[![demo video](http://img.youtube.com/vi/Kv9FGClP1-k/0.jpg)](http://www.youtube.com/watch?v=Kv9FGClP1-k)
## Generate Dockerfile from jinja template
WARNING: Deprecated
Dockerfile and configuration can be generated by template.
- arch: one of `amd64` or `armhf`
- flavor: refer to file in flavor/`flavor`.yml
- image: base image
- desktop: desktop environment which is set in flavor
- addon_package: Debian package to be installed which is set in flavor
Dockerfile and configuration are re-generate if they do not exist. Or you may force to re-generate by removing them with the command `make clean`.
## Troubleshooting and FAQ
Troubleshooting and FAQ
==================
1. boot2docker connection issue, https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/2
2. Multi-language supports, https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/80
3. Autostart, https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/85#issuecomment-466778407
4. x11vnc arguments(multiptr), https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/101
5. firefox/chrome crash (/dev/shm), https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/112
6. resize display size without destroying container, https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/115#issuecomment-522426037
## License
License
==================
See the LICENSE file for details.

2
TODO
View file

@ -1,2 +0,0 @@
- upgrade frontend packages
- rewrite backend by golang

View file

@ -1,8 +0,0 @@
---
addon_packages:
- vim-tiny
- firefox
- chromium-browser
- ttf-ubuntu-font-family
- ttf-wqy-zenhei
desktop: lxde

View file

@ -1,8 +0,0 @@
---
addon_packages:
- vim-tiny
- firefox
- chromium-browser
- ttf-ubuntu-font-family
- ttf-wqy-zenhei
desktop: lxqt

View file

@ -1,6 +0,0 @@
---
addon_packages:
- vim-tiny
- firefox
- xfce4-terminal
desktop: xfce4

View file

@ -1,4 +0,0 @@
#!/bin/bash
# Register qemu-*-static for all supported processors except the
# current one, but also remove all registered binfmt_misc before
docker run --rm --privileged multiarch/qemu-user-static:register --reset

View file

@ -0,0 +1,42 @@
server {
listen 80 default_server;
# listen [::]:80 default_server ipv6only=on;
#_SSL_PORT_#listen 443 ssl default_server;
#_SSL_PORT_#listen [::]:443 ssl default_server ipv6only=on;
#_SSL_PORT_#ssl_certificate /etc/nginx/ssl/nginx.crt;
#_SSL_PORT_#ssl_certificate_key /etc/nginx/ssl/nginx.key;
#_HTTP_PASSWORD_#auth_basic "Private Property";
#_HTTP_PASSWORD_#auth_basic_user_file /etc/nginx/.htpasswd;
root /usr/local/lib/web/frontend/;
index index.html index.htm;
location ~ ^/api {
try_files $uri @api;
}
location = /websockify {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:6081;
}
location @api {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:6079;
max_ranges 0;
}
location @proxy {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:6081;
max_ranges 0;
}
}

View file

@ -17,10 +17,14 @@ stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/1
stderr_logfile_maxbytes=0
[group:x]
programs=xvfb,wm,lxpanel,pcmanfm,x11vnc,novnc
[program:xvfb]
priority=10
command=/usr/local/bin/xvfb.sh
stopsignal=KILL
[program:wm]
priority=15
command=/usr/bin/openbox
@ -38,22 +42,11 @@ priority=15
directory=%HOME%
command=/usr/bin/pcmanfm --desktop --profile LXDE
user=%USER%
stopwaitsecs=3
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
[program:xvfb]
priority=10
command=/usr/local/bin/xvfb.sh
stopsignal=KILL
[program:x11vnc]
priority=20
command=x11vnc -display :1 -xkb -forever -shared -repeat -capslock
command=x11vnc -display :1 -xkb -forever -shared -repeat
[program:novnc]
priority=25

View file

@ -8,14 +8,6 @@ if [ -n "$VNC_PASSWORD" ]; then
export VNC_PASSWORD=
fi
if [ -n "$X11VNC_ARGS" ]; then
sed -i "s/^command=x11vnc.*/& ${X11VNC_ARGS}/" /etc/supervisor/conf.d/supervisord.conf
fi
if [ -n "$OPENBOX_ARGS" ]; then
sed -i "s#^command=/usr/bin/openbox\$#& ${OPENBOX_ARGS}#" /etc/supervisor/conf.d/supervisord.conf
fi
if [ -n "$RESOLUTION" ]; then
sed -i "s/1024x768/$RESOLUTION/" /usr/local/bin/xvfb.sh
fi
@ -31,18 +23,16 @@ if [ "$USER" != "root" ]; then
fi
HOME=/home/$USER
echo "$USER:$PASSWORD" | chpasswd
cp -r /root/{.config,.gtkrc-2.0,.asoundrc} ${HOME}
chown -R $USER:$USER ${HOME}
cp -r /root/{.gtkrc-2.0,.asoundrc} ${HOME}
[ -d "/dev/snd" ] && chgrp -R adm /dev/snd
fi
sed -i -e "s|%USER%|$USER|" -e "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf
sed -i "s|%USER%|$USER|" /etc/supervisor/conf.d/supervisord.conf
sed -i "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf
# home folder
if [ ! -x "$HOME/.config/pcmanfm/LXDE/" ]; then
mkdir -p $HOME/.config/pcmanfm/LXDE/
ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/
chown -R $USER:$USER $HOME
fi
mkdir -p $HOME/.config/pcmanfm/LXDE/
ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/
chown -R $USER:$USER $HOME
# nginx workers
sed -i 's|worker_processes .*|worker_processes 1;|' /etc/nginx/nginx.conf
@ -61,15 +51,12 @@ if [ -n "$HTTP_PASSWORD" ]; then
sed -i 's|#_HTTP_PASSWORD_#||' /etc/nginx/sites-enabled/default
fi
# dynamic prefix path renaming
if [ -n "$RELATIVE_URL_ROOT" ]; then
echo "* enable RELATIVE_URL_ROOT: $RELATIVE_URL_ROOT"
sed -i 's|#_RELATIVE_URL_ROOT_||' /etc/nginx/sites-enabled/default
sed -i 's|_RELATIVE_URL_ROOT_|'$RELATIVE_URL_ROOT'|' /etc/nginx/sites-enabled/default
fi
# novnc websockify
ln -s /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify
chmod +x /usr/local/lib/web/frontend/static/websockify/run
# clearup
PASSWORD=
HTTP_PASSWORD=
exec /bin/tini -- supervisord -n -c /etc/supervisor/supervisord.conf
exec /bin/tini -- /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf

View file

@ -5,4 +5,4 @@ if [ -z "$ALSADEV" ]; then
exit 1
fi
exec /usr/bin/google-chrome --no-sandbox --alsa-output-device="$ALSADEV" "$@"
exec /usr/bin/chromium-browser --no-sandbox --alsa-output-device="$ALSADEV" "$@"

3
image/usr/local/bin/xvfb.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/Xvfb :1 -screen 0 1024x768x16

View file

@ -0,0 +1,20 @@
backports.ssl-match-hostname==3.5.0.1
certifi==2018.1.18
chardet==3.0.4
click==6.7
Flask==0.12.2
Flask-Login==0.4.1
gevent==1.2.2
gevent-websocket==0.10.1
greenlet==0.4.13
idna==2.6
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
meld3==1.0.2
requests==2.18.4
six==1.11.0
supervisor==3.2.0
urllib3==1.22
websocket-client==0.47.0
Werkzeug==0.14.1

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
from __future__ import (
absolute_import, division, print_function, with_statement
)
@ -74,7 +74,7 @@ def main():
def run_server():
import socket
from gevent.pywsgi import WSGIServer
from gevent.wsgi import WSGIServer
from vnc.app import app
# websocket conflict: WebSocketHandler
@ -114,7 +114,6 @@ def main():
)
logging.getLogger("werkzeug").setLevel(logging.WARNING)
log = logging.getLogger('novnc2')
entrypoint()

View file

@ -2,7 +2,7 @@ from __future__ import (
absolute_import, division, print_function, with_statement
)
import re
import os
from os import environ
from flask import (
Flask,
request,
@ -21,7 +21,7 @@ from .log import log
# Flask app
app = Flask('novnc2')
app.config.from_object('config.Default')
app.config.from_object(os.environ.get('CONFIG') or 'config.Development')
app.config.from_object(environ.get('CONFIG') or 'config.Development')
@app.route('/api/state')
@ -47,8 +47,8 @@ def apihealth():
def reset():
if 'w' in request.args and 'h' in request.args:
args = {
'w': int(request.args.get('w')),
'h': int(request.args.get('h')),
'w': request.args.get('w'),
'h': request.args.get('h'),
}
state.set_size(args['w'], args['h'])
@ -68,13 +68,6 @@ def reset():
return jsonify({'code': 200})
@app.route('/resize')
@httperror
def apiresize():
state.reset_size()
return '<html><head><script type = "text/javascript">var h=window.location.href;window.location.href=h.substring(0,h.length-6);</script></head></html>'
@app.route('/api/live.flv')
@httperror
def liveflv():
@ -151,7 +144,7 @@ def liveflv():
cmd,
stdout=gsp.PIPE,
stderr=gsp.PIPE,
env={k: str(v) for k, v in xenvs.items()},
env={k: str(v) for k, v in xenvs.iteritems()},
)
def readerr(f):

View file

@ -28,10 +28,7 @@ class State(object):
def _update_health(self):
health = True
output = gsp.check_output([
'supervisorctl', '-c', '/etc/supervisor/supervisord.conf',
'status'
], encoding='UTF-8')
output = gsp.check_output(['supervisorctl', 'status'])
for line in output.strip().split('\n'):
if not line.startswith('web') and line.find('RUNNING') < 0:
health = False
@ -65,16 +62,13 @@ class State(object):
'sed -i \'s#'
'^exec /usr/bin/Xvfb.*$'
'#'
'exec /usr/bin/Xvfb :1 -screen 0 {}x{}x24'
'exec /usr/bin/Xvfb :1 -screen 0 {}x{}x16'
'#\' /usr/local/bin/xvfb.sh'
).format(w, h), shell=True)
self.size_changed_count += 1
def apply_and_restart(self):
gsp.check_call([
'supervisorctl', '-c', '/etc/supervisor/supervisord.conf',
'restart', 'x:'
])
gsp.check_call(['supervisorctl', 'restart', 'x:'])
self._w = self._h = self._health = None
self.notify()
@ -113,9 +107,6 @@ class State(object):
except gsp.CalledProcessError as e:
log.warn('failed to get dispaly size: ' + str(e))
def reset_size(self):
self.size_changed_count = 0
@property
def w(self):
return self._w

View file

Before

Width:  |  Height:  |  Size: 339 KiB

After

Width:  |  Height:  |  Size: 339 KiB

View file

Before

Width:  |  Height:  |  Size: 527 KiB

After

Width:  |  Height:  |  Size: 527 KiB

View file

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 246 KiB

View file

Before

Width:  |  Height:  |  Size: 870 KiB

After

Width:  |  Height:  |  Size: 870 KiB

View file

@ -0,0 +1,139 @@
[Desktop Entry]
Version=1.0
Name=Chromium Web Browser Sound
GenericName=Web Browser
GenericName[ar]=متصفح الشبكة
GenericName[ast]=Restolador web
GenericName[bg]=Уеб браузър
GenericName[bn]=
GenericName[bs]=Web preglednik
GenericName[ca]=Navegador web
GenericName[ca@valencia]=Navegador web
GenericName[cs]=WWW prohlížeč
GenericName[da]=Browser
GenericName[de]=Web-Browser
GenericName[el]=Περιηγητής ιστού
GenericName[en_AU]=Web Browser
GenericName[en_GB]=Web Browser
GenericName[eo]=Retfoliumilo
GenericName[es]=Navegador web
GenericName[et]=Veebibrauser
GenericName[eu]=Web-nabigatzailea
GenericName[fi]=WWW-selain
GenericName[fil]=Web Browser
GenericName[fr]=Navigateur Web
GenericName[gl]=Navegador web
GenericName[gu]=
GenericName[he]=דפדפן אינטרנט
GenericName[hi]=
GenericName[hr]=Web preglednik
GenericName[hu]=Webböngésző
GenericName[hy]=Ոստայն զննարկիչ
GenericName[ia]=Navigator del Web
GenericName[id]=Peramban Web
GenericName[it]=Browser web
GenericName[ja]=
GenericName[ka]=
GenericName[kn]=
GenericName[ko]=
GenericName[kw]=Peurel wias
GenericName[lt]=Žiniatinklio naršyklė
GenericName[lv]=Tīmekļa pārlūks
GenericName[ml]=
GenericName[mr]=
GenericName[ms]=Pelayar Web
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[or]=
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador web
GenericName[ro]=Navigator de Internet
GenericName[ru]=Веб-браузер
GenericName[sk]=WWW prehliadač
GenericName[sl]=Spletni brskalnik
GenericName[sr]=Интернет прегледник
GenericName[sv]=Webbläsare
GenericName[ta]= ி
GenericName[te]= ి
GenericName[th]=
GenericName[tr]=Web Tarayıcı
GenericName[ug]=توركۆرگۈ
GenericName[uk]=Навігатор Тенет
GenericName[vi]=B duyt Web
GenericName[zh_CN]=
GenericName[zh_HK]=
GenericName[zh_TW]=
Comment=Access the Internet
Comment[ar]=الدخول إلى الإنترنت
Comment[ast]=Accesu a Internet
Comment[bg]=Достъп до интернет
Comment[bn]=
Comment[bs]=Pristup internetu
Comment[ca]=Accediu a Internet
Comment[ca@valencia]=Accediu a Internet
Comment[cs]=Přístup k internetu
Comment[da]=Få adgang til internettet
Comment[de]=Internetzugriff
Comment[el]=Πρόσβαση στο Διαδίκτυο
Comment[en_AU]=Access the Internet
Comment[en_GB]=Access the Internet
Comment[eo]=Akiri interreton
Comment[es]=Acceda a Internet
Comment[et]=Pääs Internetti
Comment[eu]=Sartu Internetera
Comment[fi]=Käytä internetiä
Comment[fil]=I-access ang Internet
Comment[fr]=Accéder à Internet
Comment[gl]=Acceda a Internet
Comment[gu]=
Comment[he]=גישה לאינטרנט
Comment[hi]= ि
Comment[hr]=Pristupite Internetu
Comment[hu]=Az internet elérése
Comment[hy]=Մուտք համացանց
Comment[ia]=Accede a le Interrete
Comment[id]=Akses Internet
Comment[it]=Accesso a Internet
Comment[ja]=
Comment[ka]=
Comment[kn]= ಿಿ
Comment[ko]=
Comment[kw]=Hedhes an Kesrosweyth
Comment[lt]=Interneto prieiga
Comment[lv]=Piekļūt internetam
Comment[ml]=
Comment[mr]=
Comment[ms]=Mengakses Internet
Comment[nb]=Bruk internett
Comment[nl]=Verbinding maken met internet
Comment[or]=
Comment[pl]=Skorzystaj z internetu
Comment[pt]=Aceder à Internet
Comment[pt_BR]=Acessar a internet
Comment[ro]=Accesați Internetul
Comment[ru]=Доступ в Интернет
Comment[sk]=Prístup do siete Internet
Comment[sl]=Dostop do interneta
Comment[sr]=Приступите Интернету
Comment[sv]=Surfa på Internet
Comment[ta]=
Comment[te]= ి
Comment[th]=
Comment[tr]=İnternet'e erişin
Comment[ug]=ئىنتېرنېت زىيارىتى
Comment[uk]=Доступ до Інтернету
Comment[vi]=Truy cp Internet
Comment[zh_CN]=访
Comment[zh_HK]=
Comment[zh_TW]=
Exec=/usr/local/bin/chromium-browser-sound.sh %U
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=chromium-browser
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Actions=NewWindow;Incognito;TempProfile;
X-AppInstall-Package=chromium-browser

View file

@ -1,52 +0,0 @@
server {
listen 80 default_server;
# listen [::]:80 default_server ipv6only=on;
#_SSL_PORT_#listen 443 ssl default_server;
#_SSL_PORT_#listen [::]:443 ssl default_server ipv6only=on;
#_SSL_PORT_#ssl_certificate /etc/nginx/ssl/nginx.crt;
#_SSL_PORT_#ssl_certificate_key /etc/nginx/ssl/nginx.key;
#_HTTP_PASSWORD_#auth_basic "Private Property";
#_HTTP_PASSWORD_#auth_basic_user_file /etc/nginx/.htpasswd;
root /usr/local/lib/web/frontend/;
index index.html index.htm;
#_RELATIVE_URL_ROOT_location /_RELATIVE_URL_ROOT_/ {
#_RELATIVE_URL_ROOT_ rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break;
#_RELATIVE_URL_ROOT_ root /usr/local/lib/web/frontend/;
#_RELATIVE_URL_ROOT_}
location ~ .*/(api/.*|websockify) {
try_files $uri @api$http_upgrade;
}
location / {
rewrite /approot/(.*) /$1 break;
root /usr/local/lib/web/frontend/;
}
location @apiwebsocket {
#_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break;
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:6081;
}
location @api {
#_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
max_ranges 0;
proxy_pass http://127.0.0.1:6079;
}
}

View file

@ -1,86 +0,0 @@
[supervisord]
redirect_stderr=true
stopsignal=QUIT
autorestart=true
directory=/root
[program:nginx]
priority=10
command=nginx -c /etc/nginx/nginx.conf -g 'daemon off;'
[program:web]
priority=10
directory=/usr/local/lib/web/backend
command=/usr/local/lib/web/backend/run.py
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/1
stderr_logfile_maxbytes=0
{% if desktop == "lxde" %}
[group:x]
programs=xvfb,wm,lxpanel,pcmanfm,x11vnc,novnc
[program:wm]
priority=15
command=/usr/bin/openbox
environment=DISPLAY=":1",HOME="/root",USER="root"
[program:lxpanel]
priority=15
directory=%HOME%
command=/usr/bin/lxpanel --profile LXDE
user=%USER%
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
[program:pcmanfm]
priority=15
directory=%HOME%
command=/usr/bin/pcmanfm --desktop --profile LXDE
user=%USER%
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
{% endif %}
{% if desktop == "lxqt" %}
[group:x]
programs=xvfb,wm,lxpanel,x11vnc,novnc
[program:wm]
priority=15
command=/usr/bin/openbox
environment=DISPLAY=":1",HOME="/root",USER="root"
[program:lxpanel]
priority=15
directory=%HOME%
command=/usr/bin/startlxqt
user=%USER%
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
{% endif %}
{% if desktop == "xfce4" %}
[group:x]
programs=xvfb,lxpanel,x11vnc,novnc
[program:lxpanel]
priority=15
directory=%HOME%
command=/usr/bin/startxfce4
user=%USER%
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
{% endif %}
[program:xvfb]
priority=10
command=/usr/local/bin/xvfb.sh
stopsignal=KILL
[program:x11vnc]
priority=20
command=x11vnc -display :1 -xkb -forever -shared -repeat -capslock
[program:novnc]
priority=25
directory=/usr/local/lib/web/frontend/static/novnc
command=bash /usr/local/lib/web/frontend/static/novnc/utils/launch.sh --listen 6081
stopasgroup=true

View file

@ -1,3 +0,0 @@
#!/bin/sh
exec /usr/bin/Xvfb :1 -screen 0 1024x768x24

View file

@ -1,19 +0,0 @@
backports.ssl-match-hostname==3.7.0.1
certifi==2019.9.11
chardet==3.0.4
Click==7.0
Flask==1.1.1
Flask-Login==0.4.1
gevent==1.4.0
gevent-websocket==0.10.1
greenlet==0.4.15
idna==2.8
itsdangerous==1.1.0
Jinja2==2.11.3
MarkupSafe==1.1.1
meld3==2.0.0
requests==2.22.0
six==1.12.0
urllib3==1.25.6
websocket-client==0.47.0
Werkzeug==0.16.0

View file

@ -1,221 +0,0 @@
[Desktop Entry]
Version=1.0
Name=Google Chrome Sound
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
GenericName[ar]=متصفح الشبكة
GenericName[bg]=Уеб браузър
GenericName[ca]=Navegador web
GenericName[cs]=WWW prohlížeč
GenericName[da]=Browser
GenericName[de]=Web-Browser
GenericName[el]=Περιηγητής ιστού
GenericName[en_GB]=Web Browser
GenericName[es]=Navegador web
GenericName[et]=Veebibrauser
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[gu]=
GenericName[he]=דפדפן אינטרנט
GenericName[hi]=
GenericName[hu]=Webböngésző
GenericName[it]=Browser Web
GenericName[ja]=
GenericName[kn]=
GenericName[ko]=
GenericName[lt]=Žiniatinklio naršyklė
GenericName[lv]=Tīmekļa pārlūks
GenericName[ml]=
GenericName[mr]=
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador da Internet
GenericName[ro]=Navigator de Internet
GenericName[ru]=Веб-браузер
GenericName[sl]=Spletni brskalnik
GenericName[sv]=Webbläsare
GenericName[ta]= ி
GenericName[th]=
GenericName[tr]=Web Tarayıcı
GenericName[uk]=Навігатор Тенет
GenericName[zh_CN]=
GenericName[zh_HK]=
GenericName[zh_TW]=
# Not translated in KDE, from Epiphany 2.26.1-0ubuntu1.
GenericName[bn]=
GenericName[fil]=Web Browser
GenericName[hr]=Web preglednik
GenericName[id]=Browser Web
GenericName[or]=
GenericName[sk]=WWW prehliadač
GenericName[sr]=Интернет прегледник
GenericName[te]= ి
GenericName[vi]=B duyt Web
# Gnome and KDE 3 uses Comment.
Comment=Access the Internet
Comment[ar]=الدخول إلى الإنترنت
Comment[bg]=Достъп до интернет
Comment[bn]=ি
Comment[ca]=Accedeix a Internet
Comment[cs]=Přístup k internetu
Comment[da]=Få adgang til internettet
Comment[de]=Internetzugriff
Comment[el]=Πρόσβαση στο Διαδίκτυο
Comment[en_GB]=Access the Internet
Comment[es]=Accede a Internet.
Comment[et]=Pääs Internetti
Comment[fi]=Käytä internetiä
Comment[fil]=I-access ang Internet
Comment[fr]=Accéder à Internet
Comment[gu]=
Comment[he]=גישה אל האינטרנט
Comment[hi]= ि
Comment[hr]=Pristup Internetu
Comment[hu]=Internetelérés
Comment[id]=Akses Internet
Comment[it]=Accesso a Internet
Comment[ja]=
Comment[kn]= ಿಿ
Comment[ko]=
Comment[lt]=Interneto prieiga
Comment[lv]=Piekļūt internetam
Comment[ml]=
Comment[mr]=
Comment[nb]=Gå til Internett
Comment[nl]=Verbinding maken met internet
Comment[or]=
Comment[pl]=Skorzystaj z internetu
Comment[pt]=Aceder à Internet
Comment[pt_BR]=Acessar a internet
Comment[ro]=Accesaţi Internetul
Comment[ru]=Доступ в Интернет
Comment[sk]=Prístup do siete Internet
Comment[sl]=Dostop do interneta
Comment[sr]=Приступите Интернету
Comment[sv]=Gå ut på Internet
Comment[ta]=
Comment[te]= ి
Comment[th]=
Comment[tr]=İnternet'e erişin
Comment[uk]=Доступ до Інтернету
Comment[vi]=Truy cp Internet
Comment[zh_CN]=访
Comment[zh_HK]=
Comment[zh_TW]=
Exec=/usr/local/bin/chromium-browser-sound.sh %U
StartupNotify=true
Terminal=false
Icon=google-chrome
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=New Window
Name[am]=
Name[ar]=نافذة جديدة
Name[bg]=Нов прозорец
Name[bn]=
Name[ca]=Finestra nova
Name[cs]=Nové okno
Name[da]=Nyt vindue
Name[de]=Neues Fenster
Name[el]=Νέο Παράθυρο
Name[en_GB]=New Window
Name[es]=Nueva ventana
Name[et]=Uus aken
Name[fa]=پنجره جدید
Name[fi]=Uusi ikkuna
Name[fil]=New Window
Name[fr]=Nouvelle fenêtre
Name[gu]= િ
Name[hi]= ि
Name[hr]=Novi prozor
Name[hu]=Új ablak
Name[id]=Jendela Baru
Name[it]=Nuova finestra
Name[iw]=חלון חדש
Name[ja]=
Name[kn]= ಿ
Name[ko]=
Name[lt]=Naujas langas
Name[lv]=Jauns logs
Name[ml]=ി ി
Name[mr]= ि
Name[nl]=Nieuw venster
Name[no]=Nytt vindu
Name[pl]=Nowe okno
Name[pt]=Nova janela
Name[pt_BR]=Nova janela
Name[ro]=Fereastră nouă
Name[ru]=Новое окно
Name[sk]=Nové okno
Name[sl]=Novo okno
Name[sr]=Нови прозор
Name[sv]=Nytt fönster
Name[sw]=Dirisha Jipya
Name[ta]=ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni Pencere
Name[uk]=Нове вікно
Name[vi]=Ca s Mi
Name[zh_CN]=
Name[zh_TW]=
Exec=/usr/bin/google-chrome-stable
[Desktop Action new-private-window]
Name=New Incognito Window
Name[ar]=نافذة جديدة للتصفح المتخفي
Name[bg]=Нов прозорец инкогнито
Name[bn]=
Name[ca]=Finestra d'incògnit nova
Name[cs]=Nové anonymní okno
Name[da]=Nyt inkognitovindue
Name[de]=Neues Inkognito-Fenster
Name[el]=Νέο παράθυρο για ανώνυμη περιήγηση
Name[en_GB]=New Incognito window
Name[es]=Nueva ventana de incógnito
Name[et]=Uus inkognito aken
Name[fa]=پنجره جدید حالت ناشناس
Name[fi]=Uusi incognito-ikkuna
Name[fil]=Bagong Incognito window
Name[fr]=Nouvelle fenêtre de navigation privée
Name[gu]= િ
Name[hi]= ि
Name[hr]=Novi anoniman prozor
Name[hu]=Új Inkognitóablak
Name[id]=Jendela Penyamaran baru
Name[it]=Nuova finestra di navigazione in incognito
Name[iw]=חלון חדש לגלישה בסתר
Name[ja]=
Name[kn]= ಿ
Name[ko]= 릿
Name[lt]=Naujas inkognito langas
Name[lv]=Jauns inkognito režīma logs
Name[ml]=ി ി
Name[mr]= ि
Name[nl]=Nieuw incognitovenster
Name[no]=Nytt inkognitovindu
Name[pl]=Nowe okno incognito
Name[pt]=Nova janela de navegação anónima
Name[pt_BR]=Nova janela anônima
Name[ro]=Fereastră nouă incognito
Name[ru]=Новое окно в режиме инкогнито
Name[sk]=Nové okno inkognito
Name[sl]=Novo okno brez beleženja zgodovine
Name[sr]=Нови прозор за прегледање без архивирања
Name[sv]=Nytt inkognitofönster
Name[ta]=ி ி
Name[te]= ి
Name[th]=
Name[tr]=Yeni Gizli pencere
Name[uk]=Нове вікно в режимі анонімного перегляду
Name[vi]=Ca s n danh mi
Name[zh_CN]=
Name[zh_TW]=
Exec=/usr/bin/google-chrome-stable --incognito

View file

@ -3,6 +3,5 @@ const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
PREFIX_PATH: `"${process.env.PREFIX_PATH}"`
NODE_ENV: '"development"'
})

View file

@ -10,7 +10,7 @@ module.exports = {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: './',
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: BACKEND,
@ -63,7 +63,7 @@ module.exports = {
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
assetsPublicPath: '/',
/**
* Source Maps

View file

@ -1,5 +1,4 @@
'use strict'
module.exports = {
NODE_ENV: '"production"',
PREFIX_PATH: `"${process.env.PREFIX_PATH}"`
NODE_ENV: '"production"'
}

View file

@ -1,13 +0,0 @@
--- core/rfb.js 2019-02-24 21:17:04.402944311 +0800
+++ core/rfb.js 2019-02-24 21:17:34.782484107 +0800
@@ -1256,8 +1256,8 @@
encs.push(encodings.encodingCopyRect);
// Only supported with full depth support
if (this._fb_depth == 24) {
- encs.push(encodings.encodingTight);
- encs.push(encodings.encodingTightPNG);
+ // encs.push(encodings.encodingTight);
+ // encs.push(encodings.encodingTightPNG);
encs.push(encodings.encodingHextile);
encs.push(encodings.encodingRRE);
}

View file

@ -13,9 +13,9 @@
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.21.1",
"axios": "^0.18.0",
"vue": "^2.5.2",
"vue-material": "^1.0.0-beta-10.2",
"vue-material": "^1.0.0-beta-7",
"vue-router": "^3.0.1"
},
"devDependencies": {
@ -49,7 +49,7 @@
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"nightwatch": "^0.9.12",
"node-notifier": "^8.0.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
@ -67,12 +67,11 @@
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-cli": "^3.3.7",
"webpack-dev-server": "^3.2.1",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 8.0.0",
"node": ">= 9.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [

View file

@ -136,7 +136,6 @@ export default {
// console.trace()
console.log(`connecting...`)
this.errorMessage = ''
let websockifyPath = location.pathname.substr(1) + 'websockify'
if (force || this.vncState === 'stopped') {
this.vncState = 'connecting'
let hostname = window.location.hostname
@ -147,7 +146,7 @@ export default {
let url = 'static/vnc.html?'
url += 'autoconnect=1&'
url += `host=${hostname}&port=${port}&`
url += `path=${websockifyPath}&title=novnc2&`
url += `path=websockify&title=novnc2&`
url += `logging=warn`
this.$refs.vncFrame.setAttribute('src', url)
}

View file

@ -5,8 +5,6 @@ import Vnc from '@/components/Vnc'
Vue.use(Router)
export default new Router({
mode: 'history',
base: window.location.pathname,
routes: [
{
path: '/',

@ -1 +1 @@
Subproject commit 9fe2fd04d4eeda0d5a360009453861803ba0ca84
Subproject commit 35dd3c2299b3e13e2b57a2a34be723fb01014ee3

File diff suppressed because one or more lines are too long

View file

@ -32,7 +32,7 @@
</head>
<body>
<div id="mainContainer" class="mainContainer">
<video name="videoElement" class="centeredVideo" width="1024" height="576">
<video name="videoElement" class="centeredVideo" autoplay width="1024" height="576">
Your browser is too old which doesn't support HTML5 video.
</video>
<br>
@ -63,38 +63,21 @@
//flv_load();
var videoElement = document.getElementsByName('videoElement')[0];
flvPlayer = flvjs.createPlayer({
type: 'flv',
url: url,
isLive: true,
withCredentials: true
}, { isLive: true, enableStashBuffer: false });
type: 'flv',
url: url,
isLive: true,
withCredentials: true
}, {isLive: true, enableStashBuffer: false});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
function f() {
try {
// flvPlayer.play();
var playPromise = videoElement.play();
if (playPromise !== undefined) {
playPromise.then(_ => {
console.log("play successfully");
}).catch(error => {
// console.log(error);
setTimeout(f, 10)
});
} else {
// console.log('undefined');
setTimeout(f, 10)
}
} catch (e) { console.log(e); }
}
videoElement.addEventListener('canplay', function (e) { setTimeout(f, 0); });
flvPlayer.on("error", function () {
flvPlayer.play();
flvPlayer.on("error", function() {
window.location.reload();
});
} catch (e) {
console.log(e);
}
});
});
</script>
</body>
</html>

View file

@ -1,10 +1,12 @@
<!DOCTYPE html>
<html lang="en" class="noVNC_loading">
<html class="noVNC_loading">
<head>
<!--
noVNC example: simple example using default UI
Copyright (C) 2018 The noVNC Authors
Copyright (C) 2012 Joel Martin
Copyright (C) 2016 Samuel Mannehed for Cendio AB
Copyright (C) 2016 Pierre Ossman for Cendio AB
noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
@ -15,9 +17,13 @@
-->
<title>noVNC</title>
<meta charset="utf-8">
<meta charset="utf-8" />
<!-- Icons (see app/images/icons/Makefile for what the sizes are for) -->
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- Icons (see Makefile for what the sizes are for) -->
<link rel="icon" sizes="16x16" type="image/png" href="novnc/app/images/icons/novnc-16x16.png">
<link rel="icon" sizes="24x24" type="image/png" href="novnc/app/images/icons/novnc-24x24.png">
<link rel="icon" sizes="32x32" type="image/png" href="novnc/app/images/icons/novnc-32x32.png">
@ -32,26 +38,31 @@
<link rel="icon" sizes="152x152" type="image/png" href="novnc/app/images/icons/novnc-152x152.png">
<link rel="icon" sizes="192x192" type="image/png" href="novnc/app/images/icons/novnc-192x192.png">
<!-- Firefox currently mishandles SVG, see #1419039
<link rel="icon" sizes="any" type="image/svg+xml" href="novnc/app/images/icons/novnc-icon.svg">
<link rel="icon" sizes="any" type="image/svg+xml" href="app/images/icons/novnc-icon.svg">
-->
<!-- Repeated last so that legacy handling will pick this -->
<link rel="icon" sizes="16x16" type="image/png" href="novnc/app/images/icons/novnc-16x16.png">
<!-- Apple iOS Safari settings -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<!-- Home Screen Icons (favourites and bookmarks use the normal icons) -->
<link rel="apple-touch-icon" sizes="60x60" type="image/png" href="novnc/app/images/icons/novnc-60x60.png">
<link rel="apple-touch-icon" sizes="76x76" type="image/png" href="novnc/app/images/icons/novnc-76x76.png">
<link rel="apple-touch-icon" sizes="120x120" type="image/png" href="novnc/app/images/icons/novnc-120x120.png">
<link rel="apple-touch-icon" sizes="152x152" type="image/png" href="novnc/app/images/icons/novnc-152x152.png">
<link rel="apple-touch-icon" sizes="60x60" type="novnc/image/png" href="novnc/app/images/icons/novnc-60x60.png">
<link rel="apple-touch-icon" sizes="76x76" type="novnc/image/png" href="novnc/app/images/icons/novnc-76x76.png">
<link rel="apple-touch-icon" sizes="120x120" type="novnc/image/png" href="novnc/app/images/icons/novnc-120x120.png">
<link rel="apple-touch-icon" sizes="152x152" type="novnc/image/png" href="novnc/app/images/icons/novnc-152x152.png">
<!-- Stylesheets -->
<link rel="stylesheet" href="novnc/app/styles/base.css">
<link rel="stylesheet" href="novnc/app/styles/base.css" />
<!--
<script type='text/javascript'
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
-->
<!-- this is included as a normal file in order to catch script-loading errors as well -->
<script src="novnc/app/error-handler.js"></script>
<script type="text/javascript" src="novnc/app/error-handler.js"></script>
<!-- begin scripts -->
<!-- promise polyfills promises for IE11 -->
@ -91,56 +102,54 @@
<div class="noVNC_scroll">
<h1 class="noVNC_logo" translate="no"><span>no</span><br>VNC</h1>
<h1 class="noVNC_logo" translate="no"><span>no</span><br />VNC</h1>
<!-- Drag/Pan the viewport -->
<input type="image" alt="viewport drag" src="novnc/app/images/drag.svg"
id="noVNC_view_drag_button" class="noVNC_button noVNC_hidden"
title="Move/Drag Viewport">
title="Move/Drag Viewport" />
<!--noVNC Touch Device only buttons-->
<div id="noVNC_mobile_buttons">
<input type="image" alt="No mousebutton" src="novnc/app/images/mouse_none.svg"
id="noVNC_mouse_button0" class="noVNC_button"
title="Active Mouse Button">
title="Active Mouse Button"/>
<input type="image" alt="Left mousebutton" src="novnc/app/images/mouse_left.svg"
id="noVNC_mouse_button1" class="noVNC_button"
title="Active Mouse Button">
title="Active Mouse Button"/>
<input type="image" alt="Middle mousebutton" src="novnc/app/images/mouse_middle.svg"
id="noVNC_mouse_button2" class="noVNC_button"
title="Active Mouse Button">
title="Active Mouse Button"/>
<input type="image" alt="Right mousebutton" src="novnc/app/images/mouse_right.svg"
id="noVNC_mouse_button4" class="noVNC_button"
title="Active Mouse Button">
title="Active Mouse Button"/>
<input type="image" alt="Keyboard" src="novnc/app/images/keyboard.svg"
id="noVNC_keyboard_button" class="noVNC_button" title="Show Keyboard">
id="noVNC_keyboard_button" class="noVNC_button"
value="Keyboard" title="Show Keyboard" />
</div>
<!-- Extra manual keys -->
<div id="noVNC_extra_keys">
<input type="image" alt="Extra keys" src="novnc/app/images/toggleextrakeys.svg"
id="noVNC_toggle_extra_keys_button" class="noVNC_button"
title="Show Extra Keys">
title="Show Extra Keys"/>
<div class="noVNC_vcenter">
<div id="noVNC_modifiers" class="noVNC_panel">
<input type="image" alt="Ctrl" src="novnc/app/images/ctrl.svg"
id="noVNC_toggle_ctrl_button" class="noVNC_button"
title="Toggle Ctrl">
title="Toggle Ctrl"/>
<input type="image" alt="Alt" src="novnc/app/images/alt.svg"
id="noVNC_toggle_alt_button" class="noVNC_button"
title="Toggle Alt">
<input type="image" alt="Windows" src="novnc/app/images/windows.svg"
id="noVNC_toggle_windows_button" class="noVNC_button"
title="Toggle Windows">
title="Toggle Alt"/>
<input type="image" alt="Tab" src="novnc/app/images/tab.svg"
id="noVNC_send_tab_button" class="noVNC_button"
title="Send Tab">
title="Send Tab"/>
<input type="image" alt="Esc" src="novnc/app/images/esc.svg"
id="noVNC_send_esc_button" class="noVNC_button"
title="Send Escape">
title="Send Escape"/>
<input type="image" alt="Ctrl+Alt+Del" src="novnc/app/images/ctrlaltdel.svg"
id="noVNC_send_ctrl_alt_del_button" class="noVNC_button"
title="Send Ctrl-Alt-Del">
title="Send Ctrl-Alt-Del" />
</div>
</div>
</div>
@ -148,58 +157,58 @@
<!-- Shutdown/Reboot -->
<input type="image" alt="Shutdown/Reboot" src="novnc/app/images/power.svg"
id="noVNC_power_button" class="noVNC_button"
title="Shutdown/Reboot...">
title="Shutdown/Reboot..." />
<div class="noVNC_vcenter">
<div id="noVNC_power" class="noVNC_panel">
<div class="noVNC_heading">
<img alt="" src="novnc/app/images/power.svg"> Power
<img src="novnc/app/images/power.svg"> Power
</div>
<input type="button" id="noVNC_shutdown_button" value="Shutdown">
<input type="button" id="noVNC_reboot_button" value="Reboot">
<input type="button" id="noVNC_reset_button" value="Reset">
<input type="button" id="noVNC_shutdown_button" value="Shutdown" />
<input type="button" id="noVNC_reboot_button" value="Reboot" />
<input type="button" id="noVNC_reset_button" value="Reset" />
</div>
</div>
<!-- Clipboard -->
<input type="image" alt="Clipboard" src="novnc/app/images/clipboard.svg"
id="noVNC_clipboard_button" class="noVNC_button"
title="Clipboard">
title="Clipboard" />
<div class="noVNC_vcenter">
<div id="noVNC_clipboard" class="noVNC_panel">
<div class="noVNC_heading">
<img alt="" src="novnc/app/images/clipboard.svg"> Clipboard
<img src="novnc/app/images/clipboard.svg"> Clipboard
</div>
<textarea id="noVNC_clipboard_text" rows=5></textarea>
<br>
<br />
<input id="noVNC_clipboard_clear_button" type="button"
value="Clear" class="noVNC_submit">
value="Clear" class="noVNC_submit" />
</div>
</div>
<!-- Toggle fullscreen -->
<input type="image" alt="Fullscreen" src="novnc/app/images/fullscreen.svg"
id="noVNC_fullscreen_button" class="noVNC_button noVNC_hidden"
title="Fullscreen">
title="Fullscreen" />
<!-- Settings -->
<input type="image" alt="Settings" src="novnc/app/images/settings.svg"
id="noVNC_settings_button" class="noVNC_button"
title="Settings">
title="Settings" />
<div class="noVNC_vcenter">
<div id="noVNC_settings" class="noVNC_panel">
<ul>
<li class="noVNC_heading">
<img alt="" src="novnc/app/images/settings.svg"> Settings
<img src="novnc/app/images/settings.svg"> Settings
</li>
<li>
<label><input id="noVNC_setting_shared" type="checkbox"> Shared Mode</label>
<label><input id="noVNC_setting_shared" type="checkbox" /> Shared Mode</label>
</li>
<li>
<label><input id="noVNC_setting_view_only" type="checkbox"> View Only</label>
<label><input id="noVNC_setting_view_only" type="checkbox" /> View Only</label>
</li>
<li><hr></li>
<li>
<label><input id="noVNC_setting_view_clip" type="checkbox"> Clip to Window</label>
<label><input id="noVNC_setting_view_clip" type="checkbox" /> Clip to Window</label>
</li>
<li>
<label for="noVNC_setting_resize">Scaling Mode:</label>
@ -215,39 +224,35 @@
<div><ul>
<li>
<label for="noVNC_setting_repeaterID">Repeater ID:</label>
<input id="noVNC_setting_repeaterID" type="text" value="">
<input id="noVNC_setting_repeaterID" type="input" value="" />
</li>
<li>
<div class="noVNC_expander">WebSocket</div>
<div><ul>
<li>
<label><input id="noVNC_setting_encrypt" type="checkbox"> Encrypt</label>
<label><input id="noVNC_setting_encrypt" type="checkbox" /> Encrypt</label>
</li>
<li>
<label for="noVNC_setting_host">Host:</label>
<input id="noVNC_setting_host">
<input id="noVNC_setting_host" />
</li>
<li>
<label for="noVNC_setting_port">Port:</label>
<input id="noVNC_setting_port" type="number">
<input id="noVNC_setting_port" type="number" />
</li>
<li>
<label for="noVNC_setting_path">Path:</label>
<input id="noVNC_setting_path" type="text" value="websockify">
<input id="noVNC_setting_path" type="input" value="websockify" />
</li>
</ul></div>
</li>
<li><hr></li>
<li>
<label><input id="noVNC_setting_reconnect" type="checkbox"> Automatic Reconnect</label>
<label><input id="noVNC_setting_reconnect" type="checkbox" /> Automatic Reconnect</label>
</li>
<li>
<label for="noVNC_setting_reconnect_delay">Reconnect Delay (ms):</label>
<input id="noVNC_setting_reconnect_delay" type="number">
</li>
<li><hr></li>
<li>
<label><input id="noVNC_setting_show_dot" type="checkbox" checked> Show Dot when No Cursor</label>
<input id="noVNC_setting_reconnect_delay" type="number" />
</li>
<li><hr></li>
<!-- Logging selection dropdown -->
@ -266,7 +271,7 @@
<!-- Connection Controls -->
<input type="image" alt="Disconnect" src="novnc/app/images/disconnect.svg"
id="noVNC_disconnect_button" class="noVNC_button"
title="Disconnect">
title="Disconnect" />
</div>
</div>
@ -283,7 +288,7 @@
<div id="noVNC_connect_dlg">
<div class="noVNC_logo" translate="no"><span>no</span>VNC</div>
<div id="noVNC_connect_button"><div>
<img alt="" src="novnc/app/images/connect.svg"> Connect
<img src="novnc/app/images/connect.svg"> Connect
</div></div>
</div>
</div>
@ -294,10 +299,10 @@
<ul>
<li>
<label>Password:</label>
<input id="noVNC_password_input" type="password">
<input id="noVNC_password_input" type="password" />
</li>
<li>
<input id="noVNC_password_button" type="submit" value="Send Password" class="noVNC_submit">
<input id="noVNC_password_button" type="submit" value="Send Password" class="noVNC_submit" />
</li>
</ul>
</form></div>
@ -307,7 +312,7 @@
<div id="noVNC_transition">
<div id="noVNC_transition_text"></div>
<div>
<input type="button" id="noVNC_cancel_reconnect_button" value="Cancel" class="noVNC_submit">
<input type="button" id="noVNC_cancel_reconnect_button" value="Cancel" class="noVNC_submit" />
</div>
<div class="noVNC_spinner"></div>
</div>
@ -319,7 +324,8 @@
on-screen keyboard. Let's hope Chrome implements the ime-mode
style for example -->
<textarea id="noVNC_keyboardinput" autocapitalize="off"
autocomplete="off" spellcheck="false" tabindex="-1"></textarea>
autocorrect="off" autocomplete="off" spellcheck="false"
mozactionhint="Enter" tabindex="-1"></textarea>
</div>
<audio id="noVNC_bell">
@ -333,13 +339,13 @@
setTimeout(f, 1000);
} else {
UI.rfb.addEventListener('connect', function(event) {
window.parent.postMessage(JSON.stringify({from: 'novnc', state: 'connected'}), '*');
// UI.rfb._display.defaultCursor();
window.parent.postMessage(JSON.stringify({from: 'novnc', state: 'connectedd'}), '*');
UI.rfb._display.defaultCursor();
// console.log(UI.connected)
// console.log(event);
});
UI.rfb.addEventListener('disconnect', function(event) {
window.parent.postMessage(JSON.stringify({from: 'novnc', state: 'disconnected'}), '*');
window.parent.postMessage(JSON.stringify({from: 'novnc', state: 'disconneccted'}), '*');
});
// console.log(UI.rfb._rfb_connection_state);
}

File diff suppressed because it is too large Load diff