add new
This commit is contained in:
6
vnc-viewer/root/etc/cont-init.d/setup-defaults
Normal file
6
vnc-viewer/root/etc/cont-init.d/setup-defaults
Normal 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
|
||||
9
vnc-viewer/root/etc/cont-init.d/setup-novnc-ingress
Normal file
9
vnc-viewer/root/etc/cont-init.d/setup-novnc-ingress
Normal 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
|
||||
20
vnc-viewer/root/etc/services.d/noVNC/run
Normal file
20
vnc-viewer/root/etc/services.d/noVNC/run
Normal 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
|
||||
Reference in New Issue
Block a user