From 01410a3ccd496f52a65fc8c4b96cadb5aac735d7 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Tue, 9 Apr 2024 21:47:37 +0000 Subject: [PATCH] Cleaning code and fixing vscode user not working. Updating to version. 2.0.34 --- entrypoint.sh | 15 ++------------- version.txt | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 55e1cdf..a0da3c9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,14 +1,10 @@ #!/bin/bash set -eu -if [[ -z "${HOME_USER}" ]]; then +if [[ -z "${HOME_USER-}" ]]; then HOME_USER="vscode" fi -#addgroup nonroot -#adduser --disabled-password --gecos "" ${HOME_USER} -#echo "${HOME_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - # We do this first to ensure sudo works below when renaming the user. # Otherwise the current container UID may not exist in the passwd database. eval "$(fixuid -q)" @@ -43,15 +39,8 @@ if [ "${HOME_USER-}" ]; then # Changing the HOME_USER in the .bashrc file sudo su - ${HOME_USER} -c 'sed -i "s|/home/vscode|/home/${HOME_USER}|g" ~/.bashrc' + # Switch to the user specified by $HOME_USER and start an interactive shell session. sudo -u $HOME_USER -i - # Unfortunately we cannot change $HOME as we cannot move any bind mounts - # nor can we bind mount $HOME into a new home as that requires a privileged container. - # sudo usermod --login "$HOME_USER" vscode - # sudo groupmod -n "$HOME_USER" vscode - - # sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd - # sudo cd /home/${HOME_USER} - sudo chown -R ${HOME_USER}:${HOME_USER} /home/${HOME_USER} fi fi diff --git a/version.txt b/version.txt index fff3132..59ef4a7 100755 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.32 \ No newline at end of file +2.0.34 \ No newline at end of file