Implement graphical console read-only support
Change-Id: I321c1d0e6bce4e66107f92fc67c95bc38a0a9ad9 Related-Bug: 2086715
This commit is contained in:
parent
4ed44172b4
commit
1ad1b167ff
@ -71,6 +71,12 @@ opts = [
|
|||||||
default=['none'],
|
default=['none'],
|
||||||
help='The allowed authentication schemes to use with proxied '
|
help='The allowed authentication schemes to use with proxied '
|
||||||
'VNC connections'),
|
'VNC connections'),
|
||||||
|
cfg.BoolOpt(
|
||||||
|
'read_only',
|
||||||
|
default=False,
|
||||||
|
help='When True, keyboard and mouse events will not be passed '
|
||||||
|
'to the console.'
|
||||||
|
),
|
||||||
cfg.IntOpt(
|
cfg.IntOpt(
|
||||||
'token_timeout',
|
'token_timeout',
|
||||||
default=600,
|
default=600,
|
||||||
|
@ -6,6 +6,7 @@ Image={{ image }}
|
|||||||
PublishPort={{ port }}
|
PublishPort={{ port }}
|
||||||
Environment=APP={{ app }}
|
Environment=APP={{ app }}
|
||||||
Environment=APP_INFO='{{ app_info }}'
|
Environment=APP_INFO='{{ app_info }}'
|
||||||
|
Environment=READ_ONLY={{ read_only }}
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
@ -192,6 +192,7 @@ class SystemdConsoleContainer(base.BaseConsoleContainer):
|
|||||||
'port': CONF.vnc.systemd_container_publish_port,
|
'port': CONF.vnc.systemd_container_publish_port,
|
||||||
'app': app_name,
|
'app': app_name,
|
||||||
'app_info': json.dumps(app_info),
|
'app_info': json.dumps(app_info),
|
||||||
|
'read_only': CONF.vnc.read_only,
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.debug('Writing %s', container_file)
|
LOG.debug('Writing %s', container_file)
|
||||||
|
@ -183,6 +183,10 @@ class TestSystemdConsoleContainer(base.TestCase):
|
|||||||
'console_image',
|
'console_image',
|
||||||
'localhost/ironic-vnc-container',
|
'localhost/ironic-vnc-container',
|
||||||
group='vnc')
|
group='vnc')
|
||||||
|
CONF.set_override(
|
||||||
|
'read_only',
|
||||||
|
True,
|
||||||
|
group='vnc')
|
||||||
|
|
||||||
uuid = '1234'
|
uuid = '1234'
|
||||||
container_path = self.provider._container_path(uuid)
|
container_path = self.provider._container_path(uuid)
|
||||||
@ -200,6 +204,7 @@ Image=localhost/ironic-vnc-container
|
|||||||
PublishPort=192.0.2.2::5900
|
PublishPort=192.0.2.2::5900
|
||||||
Environment=APP=fake
|
Environment=APP=fake
|
||||||
Environment=APP_INFO='{}'
|
Environment=APP_INFO='{}'
|
||||||
|
Environment=READ_ONLY=True
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target""", f.read())
|
WantedBy=default.target""", f.read())
|
||||||
|
5
releasenotes/notes/vnc_read_only-e0f18c5d0d356515.yaml
Normal file
5
releasenotes/notes/vnc_read_only-e0f18c5d0d356515.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
When ``ironic.conf`` ``[vnc]read_only=True`` is set, keyboard and mouse
|
||||||
|
events will not be passed to the console.
|
@ -2,4 +2,10 @@
|
|||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
x11vnc -nevershared -forever -afteraccept 'start-selenium-browser.py &' -gone 'killall -s SIGTERM python3'
|
if [ "$READ_ONLY" = "True" ]; then
|
||||||
|
viewonly="-viewonly"
|
||||||
|
else
|
||||||
|
viewonly=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
x11vnc $viewonly -nevershared -forever -afteraccept 'start-selenium-browser.py &' -gone 'killall -s SIGTERM python3'
|
Loading…
x
Reference in New Issue
Block a user