🐛 fix: Change default user to ubuntu

This commit is contained in:
Wanjohi
2024-04-16 02:13:12 +03:00
parent 66f7ba200f
commit c2c3590b0c
3 changed files with 6 additions and 8 deletions

View File

@@ -2,11 +2,11 @@
trap "echo TRAPed signal" HUP INT QUIT TERM trap "echo TRAPed signal" HUP INT QUIT TERM
# Create and modify permissions of XDG_RUNTIME_DIR # Create and modify permissions of XDG_RUNTIME_DIR
sudo -u user mkdir -pm700 /tmp/runtime-netris sudo -u user mkdir -pm700 /tmp/runtime-ubuntu
sudo chown user:user /tmp/runtime-netris sudo chown user:user /tmp/runtime-ubuntu
sudo -u user chmod 700 /tmp/runtime-netris sudo -u user chmod 700 /tmp/runtime-ubuntu
# Make user directory owned by the user in case it is not # Make user directory owned by the user in case it is not
sudo chown netris:netris /home/netris || sudo chown netris:netris /home/user/* || { echo "Failed to change user directory permissions. There may be permission issues."; } sudo chown ubuntu:ubuntu /home/ubuntu || sudo chown ubuntu:ubuntu /home/ubuntu/* || { echo "Failed to change user directory permissions. There may be permission issues."; }
# Remove directories to make sure the desktop environment starts # Remove directories to make sure the desktop environment starts
sudo rm -rf /tmp/.X* ~/.cache sudo rm -rf /tmp/.X* ~/.cache
# Change time zone from environment variable # Change time zone from environment variable

View File

@@ -4,7 +4,7 @@ FROM ubuntu:23.10
ENV DEBIAN_FRONTEND=noninteractive \ ENV DEBIAN_FRONTEND=noninteractive \
TIMEZONE=Africa/Nairobi \ TIMEZONE=Africa/Nairobi \
XDG_RUNTIME_DIR=/tmp/runtime-netris \ XDG_RUNTIME_DIR=/tmp/runtime-ubuntu \
DISPLAY=:0 \ DISPLAY=:0 \
PULSE_SERVER=unix:/run/pulse/native PULSE_SERVER=unix:/run/pulse/native
# WAYLAND_DISPLAY=wayland-0 # WAYLAND_DISPLAY=wayland-0

View File

@@ -29,14 +29,12 @@ COPY .scripts/proton /usr/bin/netris/
RUN chmod +x /usr/bin/netris/proton \ RUN chmod +x /usr/bin/netris/proton \
&& /usr/bin/netris/proton -i && /usr/bin/netris/proton -i
ARG USERNAME=netris ARG USERNAME=ubuntu
# Create user and assign adequate groups # Create user and assign adequate groups
RUN apt-get update && apt-get install --no-install-recommends -y \ RUN apt-get update && apt-get install --no-install-recommends -y \
sudo \ sudo \
tzdata \ tzdata \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1000 $USERNAME \
&& useradd -ms /bin/bash $USERNAME -u 1000 -g 1000 \
&& usermod -a -G adm,audio,cdrom,dialout,dip,fax,floppy,input,lp,lpadmin,plugdev,pulse-access,render,scanner,ssl-cert,sudo,tape,tty,video,voice $USERNAME \ && usermod -a -G adm,audio,cdrom,dialout,dip,fax,floppy,input,lp,lpadmin,plugdev,pulse-access,render,scanner,ssl-cert,sudo,tape,tty,video,voice $USERNAME \
&& echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ && echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& chown $USERNAME:$USERNAME /home/$USERNAME \ && chown $USERNAME:$USERNAME /home/$USERNAME \