Redo of user to fix bugs
This commit is contained in:
parent
ba8f9c8158
commit
d8c3ceac00
|
|
@ -154,6 +154,7 @@ HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://127.0.0.1:6079/ap
|
||||||
ENTRYPOINT ["/startup.sh"]
|
ENTRYPOINT ["/startup.sh"]
|
||||||
|
|
||||||
# Install Docker
|
# Install Docker
|
||||||
|
RUN groupadd -g 281 docker
|
||||||
RUN mkdir -p /etc/apt/keyrings
|
RUN mkdir -p /etc/apt/keyrings
|
||||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
RUN echo \
|
RUN echo \
|
||||||
|
|
|
||||||
|
|
@ -167,9 +167,6 @@ See the LICENSE file for details.
|
||||||
## New
|
## New
|
||||||
Failing to generate a key using the below path will cause the key to delete after a routine update to the cluster. After the upgrade, use the command above to generate a new key for it to be persistent
|
Failing to generate a key using the below path will cause the key to delete after a routine update to the cluster. After the upgrade, use the command above to generate a new key for it to be persistent
|
||||||
|
|
||||||
Generate percistent SSH key using otherwise it will delete on upgrade:
|
|
||||||
#ssh-keygen -t ed25519 -f /workspace/.$USER/.ssh/id_ed25519 -C "user@cloud9"
|
|
||||||
|
|
||||||
ENV Vars
|
ENV Vars
|
||||||
USER
|
USER
|
||||||
PASSWORD
|
PASSWORD
|
||||||
|
|
@ -182,7 +179,4 @@ SHOW_MENU_ICONS
|
||||||
SHOW_TOOLTIPS
|
SHOW_TOOLTIPS
|
||||||
SHOW_GENERIC_NAMES
|
SHOW_GENERIC_NAMES
|
||||||
|
|
||||||
/workspace/.ubuntu/docker_creds
|
set docker group id to the host group id
|
||||||
user
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ HISTCONTROL=ignoreboth
|
||||||
# append to the history file, don't overwrite it
|
# append to the history file, don't overwrite it
|
||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
|
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
|
||||||
export HISTFILE=/workspace/.bash_history
|
#export HISTFILE=$HOME/.bash_history
|
||||||
|
|
||||||
|
|
||||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Do not save anything to this directory as it will routinely get cleared. Use your users home directory.
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -n "$VNC_PASSWORD" ]; then
|
if [ -n "$VNC_PASSWORD" ]; then
|
||||||
echo -n "$VNC_PASSWORD" > /.password1
|
echo -n "$VNC_PASSWORD" > /.password1
|
||||||
x11vnc -storepasswd $(cat /.password1) /.password2
|
x11vnc -storepasswd $(cat /.password1) /.password2
|
||||||
|
|
@ -32,7 +31,8 @@ USER=${USER:-root}
|
||||||
HOME=/root
|
HOME=/root
|
||||||
if [ "$USER" != "root" ]; then
|
if [ "$USER" != "root" ]; then
|
||||||
echo "* enable custom user: $USER"
|
echo "* enable custom user: $USER"
|
||||||
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo $USER
|
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo,docker -d /workspace/.home/$USER $USER
|
||||||
|
|
||||||
if [ -z "$PASSWORD" ]; then
|
if [ -z "$PASSWORD" ]; then
|
||||||
echo " set default password to \"ubuntu\""
|
echo " set default password to \"ubuntu\""
|
||||||
PASSWORD=ubuntu
|
PASSWORD=ubuntu
|
||||||
|
|
@ -41,7 +41,7 @@ if [ "$USER" != "root" ]; then
|
||||||
|
|
||||||
PASSWORD=$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)
|
PASSWORD=$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)
|
||||||
fi
|
fi
|
||||||
HOME=/home/$USER
|
HOME=/workspace/.home/$USER
|
||||||
echo "$USER:$PASSWORD" | chpasswd
|
echo "$USER:$PASSWORD" | chpasswd
|
||||||
cp -r /root/{.config,.gtkrc-2.0,.asoundrc} ${HOME}
|
cp -r /root/{.config,.gtkrc-2.0,.asoundrc} ${HOME}
|
||||||
chown -R $USER:$USER ${HOME}
|
chown -R $USER:$USER ${HOME}
|
||||||
|
|
@ -78,33 +78,33 @@ PASSWORD=
|
||||||
HTTP_PASSWORD=
|
HTTP_PASSWORD=
|
||||||
|
|
||||||
# BashRC
|
# BashRC
|
||||||
cp /cloud9/bashrc.default /home/$USER/.bashrc
|
cp /cloud9/bashrc.default $HOME/.bashrc
|
||||||
chown -R $USER:$USER /home/$USER/.bashrc
|
chown -R $USER:$USER $HOME/.bashrc
|
||||||
|
|
||||||
# Gitconfig
|
# Gitconfig
|
||||||
touch /workspace/.ubuntu/gitconfig
|
#touch /workspace/.ubuntu/gitconfig
|
||||||
ln -sf /workspace/.ubuntu/gitconfig /home/$USER/.gitconfig
|
#ln -sf /workspace/.ubuntu/gitconfig /home/$USER/.gitconfig
|
||||||
|
|
||||||
# cloud9
|
# cloud9
|
||||||
cp /cloud9/bashrc.default /home/$USER/.bashrc
|
#mkdir -p /workspace/.$USER/.standalone
|
||||||
mkdir -p /workspace/.$USER/.standalone
|
#mkdir -p /workspace/.$USER/.c9
|
||||||
mkdir -p /workspace/.$USER/.c9
|
#USER_SETTINGS="/workspace/.$USER/user.settings"
|
||||||
USER_SETTINGS="/workspace/.$USER/user.settings"
|
#if [ ! -f $USER_SETTINGS ]; then touch $USER_SETTINGS; fi
|
||||||
if [ ! -f $USER_SETTINGS ]; then touch $USER_SETTINGS; fi
|
#ln -sf $USER_SETTINGS /home/$USER/.c9/user.settings
|
||||||
ln -sf $USER_SETTINGS /home/$USER/.c9/user.settings
|
|
||||||
|
|
||||||
# Symlink SSH keys
|
# Symlink SSH keys
|
||||||
mkdir -p /workspace/.$USER/.ssh
|
#mkdir -p /workspace/.$USER/.ssh
|
||||||
chmod 700 /workspace/.$USER/.ssh
|
#chmod 700 /workspace/.$USER/.ssh
|
||||||
ln -sf /workspace/.$USER/.ssh /home/$USER/.ssh
|
#ln -sf /workspace/.$USER/.ssh /home/$USER/.ssh
|
||||||
|
|
||||||
if [ -n "$DOMAIN" ]; then
|
if [ -n "$DOMAIN" ]; then
|
||||||
DOMAIN="cloud9.example.com"
|
DOMAIN="cloud9.example.com"
|
||||||
fi
|
fi
|
||||||
chown -R $USER:$USER /home/$USER /cloud9 /workspace
|
chown -R $USER:$USER $HOME /cloud9 /workspace
|
||||||
|
|
||||||
# Add required packages for ubuntu user (Run as user)
|
# Add required packages for ubuntu user (Run as user)
|
||||||
|
|
||||||
|
rm -rf $HOME/.c9
|
||||||
mkdir -p /workspace/.c9
|
mkdir -p /workspace/.c9
|
||||||
chown $USER:$USER /workspace/.c9
|
chown $USER:$USER /workspace/.c9
|
||||||
sudo -H -u $USER bash -c 'bash /cloud9/user-install.sh' 2>&1> /workspace/.c9/install.log &
|
sudo -H -u $USER bash -c 'bash /cloud9/user-install.sh' 2>&1> /workspace/.c9/install.log &
|
||||||
|
|
@ -184,11 +184,13 @@ until [[ $SUCCESS == "TRUE" ]]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done &
|
done &
|
||||||
|
|
||||||
DOCKER_CREDS=/workspace/.ubuntu/docker_creds
|
#DOCKER_CREDS=/workspace/.ubuntu/docker_creds
|
||||||
if test -f "$DOCKER_CREDS"; then
|
#if test -f "$DOCKER_CREDS"; then
|
||||||
echo "DOCKER_CREDS exists."
|
# echo "DOCKER_CREDS exists."
|
||||||
#su $USER -c "DOCKER_USER=$(cat $DOCKER_CREDS | head -n1); DOCKER_PASS=$(cat $DOCKER_CREDS | tail -n1); echo \$DOCKER_PASS | docker login --username \$DOCKER_USER --password-stdin)"
|
# #su $USER -c "DOCKER_USER=$(cat $DOCKER_CREDS | head -n1); DOCKER_PASS=$(cat $DOCKER_CREDS | tail -n1); echo \$DOCKER_PASS | docker login --username \$DOCKER_USER --password-stdin)"
|
||||||
DOCKER_USER=$(cat $DOCKER_CREDS | head -n1); DOCKER_PASS=$(cat $DOCKER_CREDS | tail -n1); echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin
|
# DOCKER_USER=$(cat $DOCKER_CREDS | head -n1); DOCKER_PASS=$(cat $DOCKER_CREDS | tail -n1); echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
|
chown root:root /home
|
||||||
|
|
||||||
exec /bin/tini -- supervisord -n -c /etc/supervisor/supervisord.conf
|
exec /bin/tini -- supervisord -n -c /etc/supervisor/supervisord.conf
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue