first commit
This commit is contained in:
commit
475ed08b94
|
|
@ -0,0 +1,38 @@
|
||||||
|
FROM alpine:3.21
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
xrdp \
|
||||||
|
xorgxrdp \
|
||||||
|
openbox \
|
||||||
|
xorg-server \
|
||||||
|
xf86-video-dummy \
|
||||||
|
font-noto \
|
||||||
|
dbus \
|
||||||
|
firefox \
|
||||||
|
mesa-dri-gallium \
|
||||||
|
ttf-freefont \
|
||||||
|
openssl \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
# Create rdpuser
|
||||||
|
RUN adduser -D -s /bin/sh rdpuser \
|
||||||
|
&& adduser rdpuser wheel
|
||||||
|
|
||||||
|
# Configure xrdp to use Xorg
|
||||||
|
RUN sed -i 's/^#\?security_layer=.*/security_layer=tls/' /etc/xrdp/xrdp.ini \
|
||||||
|
&& sed -i 's/^#\?crypt_level=.*/crypt_level=high/' /etc/xrdp/xrdp.ini \
|
||||||
|
&& sed -i 's|^#\?param=Xorg|param=Xorg|' /etc/xrdp/sesman.ini
|
||||||
|
|
||||||
|
# Xorg wrapper for xrdp sessions
|
||||||
|
COPY config/startwm.sh /etc/xrdp/startwm.sh
|
||||||
|
RUN chmod +x /etc/xrdp/startwm.sh
|
||||||
|
|
||||||
|
# Openbox config for rdpuser
|
||||||
|
COPY config/openbox/ /home/rdpuser/.config/openbox/
|
||||||
|
RUN chown -R rdpuser:rdpuser /home/rdpuser
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
EXPOSE 3389
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Alpine RDP with Openbox & Firefox
|
||||||
|
|
||||||
|
Minimaler Docker-Container basierend auf Alpine Linux mit xrdp, Openbox und Firefox.
|
||||||
|
|
||||||
|
## Voraussetzungen
|
||||||
|
|
||||||
|
- Docker
|
||||||
|
- Docker Compose
|
||||||
|
|
||||||
|
## Konfiguration
|
||||||
|
|
||||||
|
`.env`-Datei anlegen (siehe `.env.example`):
|
||||||
|
|
||||||
|
```env
|
||||||
|
RDP_PASSWORD=Start1234!
|
||||||
|
FIREFOX_URL=https://www.google.de
|
||||||
|
```
|
||||||
|
|
||||||
|
| Variable | Beschreibung |
|
||||||
|
|---|---|
|
||||||
|
| `RDP_PASSWORD` | Passwort fuer den RDP-Benutzer `rdpuser` |
|
||||||
|
| `FIREFOX_URL` | Startseite, die Firefox beim Oeffnen laedt |
|
||||||
|
|
||||||
|
## Starten
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Verbinden
|
||||||
|
|
||||||
|
Per RDP-Client (z.B. Remmina, mstsc) verbinden:
|
||||||
|
|
||||||
|
- **Host:** `localhost`
|
||||||
|
- **Port:** `3389`
|
||||||
|
- **Benutzer:** `rdpuser`
|
||||||
|
- **Passwort:** wie in `.env` gesetzt
|
||||||
|
|
||||||
|
## Openbox-Menue
|
||||||
|
|
||||||
|
Rechtsklick auf den Desktop oeffnet das Menue:
|
||||||
|
|
||||||
|
- **Firefox** - Browser mit konfigurierter Startseite
|
||||||
|
- **Logoff** - Sitzung beenden
|
||||||
|
|
||||||
|
## Persistenz
|
||||||
|
|
||||||
|
Firefox-Profildaten werden im Ordner `./firefox-data` gespeichert und bleiben bei Container-Neustarts erhalten.
|
||||||
|
|
||||||
|
## Stoppen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose down
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
firefox &
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<openbox_menu xmlns="http://openbox.org/3.4/menu">
|
||||||
|
<menu id="root-menu" label="Menu">
|
||||||
|
<item label="Firefox">
|
||||||
|
<action name="Execute">
|
||||||
|
<execute>firefox</execute>
|
||||||
|
</action>
|
||||||
|
</item>
|
||||||
|
<separator/>
|
||||||
|
<item label="Logoff">
|
||||||
|
<action name="Exit"/>
|
||||||
|
</item>
|
||||||
|
</menu>
|
||||||
|
</openbox_menu>
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<openbox_config xmlns="http://openbox.org/3.4/rc">
|
||||||
|
<resistance>
|
||||||
|
<strength>10</strength>
|
||||||
|
<screen_edge_strength>20</screen_edge_strength>
|
||||||
|
</resistance>
|
||||||
|
<focus>
|
||||||
|
<focusNew>yes</focusNew>
|
||||||
|
<followMouse>no</followMouse>
|
||||||
|
</focus>
|
||||||
|
<theme>
|
||||||
|
<name>Clearlooks</name>
|
||||||
|
</theme>
|
||||||
|
<menu>
|
||||||
|
<file>menu.xml</file>
|
||||||
|
</menu>
|
||||||
|
<desktops>
|
||||||
|
<number>1</number>
|
||||||
|
</desktops>
|
||||||
|
<mouse>
|
||||||
|
<context name="Root">
|
||||||
|
<mousebind button="Right" action="Press">
|
||||||
|
<action name="ShowMenu">
|
||||||
|
<menu>root-menu</menu>
|
||||||
|
</action>
|
||||||
|
</mousebind>
|
||||||
|
</context>
|
||||||
|
</mouse>
|
||||||
|
<applications>
|
||||||
|
<application class="*">
|
||||||
|
<maximized>yes</maximized>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
</openbox_config>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
export DISPLAY=${DISPLAY:-:10}
|
||||||
|
|
||||||
|
if [ -r /etc/profile ]; then
|
||||||
|
. /etc/profile
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start dbus session
|
||||||
|
if command -v dbus-launch >/dev/null 2>&1; then
|
||||||
|
eval $(dbus-launch --sh-syntax)
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec openbox-session
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
services:
|
||||||
|
alpine-rdp:
|
||||||
|
build: .
|
||||||
|
container_name: alpine-rdp-firefox
|
||||||
|
environment:
|
||||||
|
- RDP_PASSWORD=${RDP_PASSWORD}
|
||||||
|
- FIREFOX_URL=${FIREFOX_URL}
|
||||||
|
network_mode: host
|
||||||
|
volumes:
|
||||||
|
- ./firefox-data:/home/rdpuser/.mozilla/firefox
|
||||||
|
shm_size: "1g"
|
||||||
|
restart: unless-stopped
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
USERNAME="rdpuser"
|
||||||
|
PASSWORD="${RDP_PASSWORD:-changeme}"
|
||||||
|
FIREFOX_URL="${FIREFOX_URL:-https://www.google.com}"
|
||||||
|
|
||||||
|
# Set password for rdpuser
|
||||||
|
echo "${USERNAME}:${PASSWORD}" | chpasswd
|
||||||
|
|
||||||
|
# Ensure firefox profile dir has correct ownership (volume mount)
|
||||||
|
mkdir -p "/home/${USERNAME}/.mozilla/firefox"
|
||||||
|
chown -R "${USERNAME}:${USERNAME}" "/home/${USERNAME}/.mozilla"
|
||||||
|
|
||||||
|
# Create autoconfig files for Firefox default homepage
|
||||||
|
cat > /usr/lib/firefox/defaults/pref/autoconfig.js <<EOF
|
||||||
|
pref("general.config.filename", "firefox.cfg");
|
||||||
|
pref("general.config.obscure_value", 0);
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > /usr/lib/firefox/firefox.cfg <<EOF
|
||||||
|
// Firefox configuration
|
||||||
|
defaultPref("browser.startup.homepage", "${FIREFOX_URL}");
|
||||||
|
defaultPref("browser.startup.page", 1);
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chown -R "${USERNAME}:${USERNAME}" "/home/${USERNAME}"
|
||||||
|
|
||||||
|
# Generate xrdp keys if missing
|
||||||
|
if [ ! -f /etc/xrdp/rsakeys.ini ]; then
|
||||||
|
xrdp-keygen xrdp /etc/xrdp/rsakeys.ini
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start xrdp services
|
||||||
|
xrdp-sesman --nodaemon &
|
||||||
|
exec xrdp --nodaemon
|
||||||
Loading…
Reference in New Issue