This commit is contained in:
2021-08-24 14:35:11 +03:00
parent d8fba9335d
commit 4f37cb59b1
107 changed files with 3941 additions and 66 deletions

30
vnc-viewer/CHANGELOG.md Normal file
View File

@@ -0,0 +1,30 @@
## 1.3.0 - 2021-04-02
* 🔨 Use ghcr.io/home-assistant for base images
## 1.2.1 - 2021-03-17
* 🐛 Specifiy own S6 entrypoint, don't rely on the base image
## 1.2.0 - 2012-01-10
* Add password option, for not retyping the password every time
* 🔨 Use noVNC icons since the addon is based on noVNC
## 1.1.1 - 2021-01-05
* 🔨 Use rounded icons, thanks @LiJu09
* 🔨 Fixed addon github link, thanks @LiJu09
## 1.1.0 - 2020-12-31
* 🐛 Fix websocket url to connect to the included websockify
## 1.0.0 - 2020-12-27
* Add noVNC version `1.3.0-r8`

19
vnc-viewer/DOCS.md Normal file
View File

@@ -0,0 +1,19 @@
## Config
Example config:
```yaml
vnc_server_host: 192.168.0.23
```
### `vnc_server_host`
The hostname or ip address of the VNC server the addon should connect to.
### `vnc_server_port` (Optional)
The remote port of the VNC server. (Default: `5900`)
### `vnc_server_password` (Optional)
The password of the the VNC server. When not set and the connection requires a password, it is asked at connection time.

43
vnc-viewer/Dockerfile Normal file
View File

@@ -0,0 +1,43 @@
ARG BUILD_FROM
FROM $BUILD_FROM AS NO_VNC
RUN apt-get update && apt-get -y --no-install-recommends install \
git=1:2.20.1-2+deb10u3
RUN git config --global advice.detachedHead false && \
git clone https://github.com/novnc/noVNC.git -b v1.2.0 /noVNC
FROM $BUILD_FROM AS WEBSOCKIFY
RUN apt-get update && apt-get -y --no-install-recommends install \
git=1:2.20.1-2+deb10u3 \
python3=3.7.3-1 \
python3-setuptools=40.8.0-1 \
python3-numpy=1:1.16.2-1 \
python3-pip=18.1-5
RUN pip3 install --no-cache-dir Cython==0.29.21
# hadolint ignore=DL3003
RUN git config --global advice.detachedHead false && \
git clone https://github.com/novnc/websockify -b v0.9.0 /websockify && \
cd /websockify && python3 setup.py install
FROM $BUILD_FROM AS RUNNING
RUN apt-get update && apt-get -y --no-install-recommends install \
git=1:2.20.1-2+deb10u3 \
python3=3.7.3-1 \
python3-setuptools=40.8.0-1 \
python3-numpy=1:1.16.2-1 \
procps=2:3.3.15-2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=NO_VNC /noVNC /noVNC
COPY --from=WEBSOCKIFY /usr/local/lib/python3.7/dist-packages/ /usr/local/lib/python3.7/dist-packages/
COPY --from=WEBSOCKIFY /usr/local/bin/websockify /usr/local/bin/websockify
ENTRYPOINT [ "/init" ]
CMD []
COPY root /

30
vnc-viewer/README.md Normal file
View File

@@ -0,0 +1,30 @@
# VNC Viewer
Bundles the noVNC application inside an Home Assistant Addon. This allows the integration of any VNC server into Home Assistant.
![Addon Stage][stage-badge]
![Supports aarch64 Architecture][aarch64-badge]
![Supports amd64 Architecture][amd64-badge]
![Supports armhf Architecture][armhf-badge]
![Supports armv7 Architecture][armv7-badge]
![Supports i386 Architecture][i386-badge]
[![Install on my Home Assistant][install-badge]][install-url]
[![Donate][donation-badge]][donation-url]
## Note
Currently only one connection is possible, if more are needed create or join the thread in the repository discussions.
[aarch64-badge]: https://img.shields.io/badge/aarch64-yes-green.svg?style=for-the-badge
[amd64-badge]: https://img.shields.io/badge/amd64-yes-green.svg?style=for-the-badge
[armhf-badge]: https://img.shields.io/badge/armhf-yes-green.svg?style=for-the-badge
[armv7-badge]: https://img.shields.io/badge/armv7-yes-green.svg?style=for-the-badge
[i386-badge]: https://img.shields.io/badge/i386-yes-green.svg?style=for-the-badge
[install-url]: https://my.home-assistant.io/redirect/supervisor_addon?addon=243ffc37_vnc
[stage-badge]: https://img.shields.io/badge/Addon%20stage-stable-green.svg?style=for-the-badge
[install-badge]: https://img.shields.io/badge/Install%20on%20my-Home%20Assistant-41BDF5?logo=home-assistant&style=for-the-badge
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=for-the-badge&logoColor=white
[donation-url]: https://www.buymeacoffee.com/Poeschl

9
vnc-viewer/build.json Normal file
View File

@@ -0,0 +1,9 @@
{
"build_from": {
"armhf": "ghcr.io/home-assistant/armhf-base-debian:buster",
"armv7": "ghcr.io/home-assistant/armv7-base-debian:buster",
"aarch64": "ghcr.io/home-assistant/aarch64-base-debian:buster",
"amd64": "ghcr.io/home-assistant/amd64-base-debian:buster",
"i386": "ghcr.io/home-assistant/i386-base-debian:buster"
}
}

30
vnc-viewer/config.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "VNC Viewer",
"version": "1.3.0",
"slug": "vnc",
"panel_icon": "mdi:remote-desktop",
"description": "A noVNC client integrated in Home Assistant",
"url": "https://github.com/Poeschl/Hassio-Addons/tree/master/vnc-viewer",
"ingress": true,
"ingress_port": 6080,
"ingress_entry":"vnc.html?autoconnect=true",
"arch": [
"armv7",
"armhf",
"aarch64",
"amd64",
"i386"
],
"startup": "application",
"boot": "manual",
"hassio_api": true,
"image": "ghcr.io/poeschl/ha-vnc-{arch}",
"options": {
"vnc_server_host": "localhost"
},
"schema": {
"vnc_server_host": "str",
"vnc_server_port": "int?",
"vnc_server_password":"str?"
}
}

BIN
vnc-viewer/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
vnc-viewer/logo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,6 @@
#!/usr/bin/with-contenv bashio
set -e
bashio::log.info 'Set some defaults'
sed -i "/UI.initSetting('show_dot'/ s/false/true/; /UI.initSetting('resize'/ s/off/scale/" /noVNC/app/ui.js

View File

@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio
set -e
bashio::log.info 'Prepare noVNC for Home Assistant ingress'
host_port=$(bashio::core.port)
ingress_url=$(bashio::addon.ingress_entry)
sed -i "/UI.initSetting/ s@'websockify'@'${ingress_url:1}/websockify'@; /UI.initSetting/ s/ port/ ${host_port}/" /noVNC/app/ui.js

View File

@@ -0,0 +1,20 @@
#!/usr/bin/with-contenv bashio
set -e
if bashio::config.has_value 'vnc_server_password'; then
bashio::log.info 'Inject vnc connection password'
password=$(bashio::config 'vnc_server_password')
sed -i "s/WebUtil.getConfigVar('password');/'${password}';/" /noVNC/app/ui.js
fi
server_host=$(bashio::config 'vnc_server_host')
server_port=5900
if bashio::config.has_value 'vnc_server_port'; then
server_port=$(bashio::config 'vnc_server_port')
fi
server="${server_host}:${server_port}"
bashio::log.info 'Start noVNC'
bashio::log.info "Connecting to VNC $server"
/noVNC/utils/launch.sh --listen 6080 --vnc $server