Set default browser

This commit is contained in:
f-trycua
2025-10-11 21:51:00 -07:00
parent 3053270f74
commit 7b286f77c6
4 changed files with 18 additions and 17 deletions

View File

@@ -15,13 +15,10 @@ ENV API_PORT=8000
ENV VNC_RESOLUTION=1024x768
ENV VNC_COL_DEPTH=24
# Create user
RUN useradd -m -s /bin/bash -G sudo cua && \
echo "cua:password" | chpasswd && \
echo "cua ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Install system dependencies
# Install system dependencies first (including sudo)
RUN apt-get update && apt-get install -y \
# System utilities
sudo \
# Desktop environment
xfce4 \
xfce4-terminal \
@@ -65,6 +62,11 @@ RUN apt-get update && apt-get install -y \
# Remove power manager to avoid popup in container
RUN apt-get remove -y xfce4-power-manager xfce4-power-manager-data || true
# Create user after sudo is installed
RUN useradd -m -s /bin/bash -G sudo cua && \
echo "cua:password" | chpasswd && \
echo "cua ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Install Firefox from Mozilla PPA (snap-free) - inline to avoid script issues
RUN apt-get update && \
add-apt-repository -y ppa:mozillateam/ppa && \
@@ -102,10 +104,8 @@ RUN chmod +x /usr/local/bin/*.sh
USER cua
WORKDIR /home/cua
# Create VNC password file
RUN mkdir -p $HOME/.vnc && \
echo "password" | vncpasswd -f > $HOME/.vnc/passwd && \
chmod 600 $HOME/.vnc/passwd
# Create VNC directory (no password needed with SecurityTypes None)
RUN mkdir -p $HOME/.vnc
# Configure XFCE for first start
RUN mkdir -p $HOME/.config/xfce4/xfconf/xfce-perchannel-xml $HOME/.config/xfce4 $HOME/.config/autostart

View File

@@ -93,8 +93,8 @@ docker run --rm -it \
## Accessing the Container
- **noVNC Web Interface**: Open `http://localhost:6901` in your browser
- **VNC Client**: Connect to `localhost:5901` (password: `password`)
- **noVNC Web Interface**: Open `http://localhost:6901` in your browser (no password required)
- **VNC Client**: Connect to `localhost:5901` (no password required)
- **Computer Server API**: Available at `http://localhost:8000`
## Using with CUA Docker Provider
@@ -175,8 +175,9 @@ Both provide the same API and functionality - the provider automatically configu
## User Credentials
- **Username**: `cua`
- **Password**: `password`
- **Password**: `password` (for shell login only)
- **Sudo access**: Enabled without password
- **VNC access**: No password required
## Creating Snapshots

View File

@@ -4,13 +4,13 @@ set -e
# Clean up any existing VNC lock files
rm -rf /tmp/.X1-lock /tmp/.X11-unix/X1
# Start VNC server
# Start VNC server without password authentication
vncserver :1 \
-geometry ${VNC_RESOLUTION:-1920x1080} \
-depth ${VNC_COL_DEPTH:-24} \
-rfbport ${VNC_PORT:-5901} \
-localhost no \
-SecurityTypes VncAuth \
-SecurityTypes None \
-AlwaysShared \
-AcceptPointerEvents \
-AcceptKeyEvents \

View File

@@ -1,2 +1,2 @@
# XFCE preferred applications - disable browser to prevent error popups
WebBrowser=
# XFCE preferred applications - set Firefox as default browser
WebBrowser=firefox