mirror of
https://github.com/trycua/computer.git
synced 2026-02-18 04:19:38 -06:00
Set default browser
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# XFCE preferred applications - disable browser to prevent error popups
|
||||
WebBrowser=
|
||||
# XFCE preferred applications - set Firefox as default browser
|
||||
WebBrowser=firefox
|
||||
|
||||
Reference in New Issue
Block a user