From b74c4770ca019fe94476d751d6f669b6ccd8a416 Mon Sep 17 00:00:00 2001 From: Rahammetoela Toekiman Date: Wed, 16 Jun 2021 00:37:48 -0300 Subject: [PATCH] make the vnc password persistent (#74) * make the vnc password persistentx * check if the .vnc folder exists * fix the conditional * fix the conditional, for real this time * replace $PWD with a relative path instead * docker-compose.yml: define volume for ~/.vnc Signed-off-by: Akihiro Suda Co-authored-by: Akihiro Suda --- docker-compose.yml | 3 +++ src/unsudo | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b118b1a..abd24e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,3 +11,6 @@ services: - '8080:8080' volumes: - '/lib/modules:/lib/modules:ro' + - 'dot-vnc:/home/user/.vnc' +volumes: + dot-vnc: diff --git a/src/unsudo b/src/unsudo index ce0203e..2c30ccc 100755 --- a/src/unsudo +++ b/src/unsudo @@ -3,6 +3,11 @@ set -eux car=$1 shift cdr=$@ + +if [ -d /home/user/.vnc ]; then + chown user:user /home/user/.vnc +fi + # machinectl requires absolute path params=("shell") avail_envs="INHERIT_DISPLAY DISPLAY SESSION_MANAGER_ARGS POST_SESSION_SCRIPT WEBMODE"