Skip to content

Commit 2eaadd0

Browse files
authored
Merge pull request #259 from JdeRobot/test-output
Add certs
2 parents eb30331 + ed22a06 commit 2eaadd0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

manager/manager/manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ def on_run_application(self, event):
689689
"source /workspace/code/install/setup.bash && ros2 run academy academyCode"
690690
],
691691
stdin=open("/dev/pts/" + console_fd, "r"),
692-
stdout=sys.stdout,
693-
stderr=subprocess.STDOUT,
692+
stdout=open("/dev/pts/" + console_fd, "w"),
693+
stderr=sys.stdout,
694694
bufsize=1024,
695695
universal_newlines=True,
696696
shell=True,
@@ -717,8 +717,8 @@ def on_run_application(self, event):
717717
self.application_process = subprocess.Popen(
718718
["python3", entrypoint],
719719
stdin=open("/dev/pts/" + console_fd, "r"),
720-
stdout=sys.stdout,
721-
stderr=subprocess.STDOUT,
720+
stdout=open("/dev/pts/" + console_fd, "w"),
721+
stderr=sys.stdout,
722722
bufsize=1024,
723723
universal_newlines=True,
724724
)

manager/manager/vnc/vnc_server.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,23 @@ def start_vnc(self, display, internal_port, external_port):
3939
self.threads.append(turbovnc_thread)
4040
wait_for_xserver(display)
4141

42+
certs = ""
43+
44+
if os.path.isfile("/etc/certs/cert.pem"):
45+
certs = "--cert /etc/certs/cert.pem --key /etc/certs/privkey.pem"
46+
4247
# Start noVNC with default port 6080 listening to VNC server on 5900
4348
if self.get_ros_version() == "2":
4449
novnc_cmd = (
4550
f"/noVNC/utils/novnc_proxy --listen {external_port} "
46-
f"--vnc localhost:{internal_port}"
51+
f"--vnc localhost:{internal_port} "
52+
f"{certs}"
4753
)
4854
else:
4955
novnc_cmd = (
5056
f"/noVNC/utils/launch.sh --listen {external_port} "
51-
f"--vnc localhost:{internal_port}"
57+
f"--vnc localhost:{internal_port} "
58+
f"{certs}"
5259
)
5360

5461
novnc_thread = DockerThread(novnc_cmd)

0 commit comments

Comments
 (0)