Compare commits

..

6 Commits

2 changed files with 24 additions and 32 deletions

View File

@ -16,34 +16,32 @@ eval "$(fixuid -q)"
if [ "${HOME_USER-}" ]; then if [ "${HOME_USER-}" ]; then
USER="$HOME_USER" USER="$HOME_USER"
if [ "$HOME_USER" != "$(whoami)" ]; then if [ "$HOME_USER" != "$(whoami)" ]; then
# if ! id -u $HOME_USER > /dev/null 2>&1; then if ! id -u $HOME_USER > /dev/null 2>&1; then
# Create a user with the same UID as the host user. sudo adduser --disabled-password --gecos "" ${HOME_USER}
# sudo adduser --disabled-password --gecos "" ${HOME_USER} sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
# sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null fi
# Set the default shell to bash for VS Code Remote - Containers # Check if .bashrc file exists
# sudo usermod --login "$HOME_USER" vscode if [ ! -f "/home/${HOME_USER}/.bashrc" ]; then
# sudo groupmod -n "$HOME_USER" vscode # If not, create it
# sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd sudo touch /home/${HOME_USER}/.bashrc
fi
# Crear el nuevo directorio home si no existe # Change the owner of the .bashrc file to HOME_USER
# if [ -d "/home/${HOME_USER}" ]; then sudo chown ${HOME_USER} /home/${HOME_USER}/.bashrc
# Si existe, hacer una copia de seguridad de los archivos existentes
# sudo mv /home/${HOME_USER} /home/${HOME_USER}_backup
# fi
# Cambiar el directorio home del usuario vscode a /home/${HOME_USER}
# sudo usermod -d /home/${HOME_USER} -m vscode
# sudo usermod -d /home/${HOME_USER} vscode
su - ${HOME_USER}
# fi
# Copy environment variables from vscode user to HOME_USER # Copy environment variables from vscode user to HOME_USER
# env | grep -v 'HOME_USER' | while read -r line; do env | grep -v 'HOME_USER' | while read -r line; do
# sudo su - ${HOME_USER} -c "echo 'export $line' >> ~/.bashrc" sudo su - ${HOME_USER} -c "echo 'export $line' >> ~/.bashrc"
# done done
# sudo -u $HOME_USER -i
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 cd /home/${HOME_USER}
sudo chown -R ${HOME_USER}:${HOME_USER} /home/${HOME_USER} sudo chown -R ${HOME_USER}:${HOME_USER} /home/${HOME_USER}
fi fi
@ -88,14 +86,8 @@ else
echo "File extensions.json not found" echo "File extensions.json not found"
fi fi
# Allow users to have scripts run on container startup to prepare workspace.
# https://github.com/coder/code-server/issues/5177
#if [ -d "${ENTRYPOINTD}" ]; then
#find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
#fi
if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then
exec dumb-init sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms $@" sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms"
else else
exec dumb-init sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME} $@" sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME}"
fi fi

View File

@ -1 +1 @@
2.0.24 2.0.30