commit 5721df5f8e7d2db9b6dc71b5ef351fc46cd20a0b Author: Jakub Wiewiora Date: Sat Nov 9 18:28:47 2024 +0100 Initial - working container. diff --git a/README b/README new file mode 100644 index 0000000..f1feffb --- /dev/null +++ b/README @@ -0,0 +1,17 @@ +# DockerRDP +Runs RDP server with XFCE4 enviroment in Docker container. + +## Running container +You can run it using following command or use attached `pod.yaml` to run that pod on K8s cluster. +``` +docker run --rm -itd -p 3389:3389 DockerRDP +``` + +## Connecting +Default user is named `user` and its password is set to `user`, there's also sudo rule granting him full rights without password. + + +## Building container +``` +docker build -t DockerRDP. +``` \ No newline at end of file diff --git a/container/Dockerfile b/container/Dockerfile new file mode 100644 index 0000000..0bad155 --- /dev/null +++ b/container/Dockerfile @@ -0,0 +1,26 @@ +FROM debian:latest + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt update && apt install -y supervisor xfce4 xrdp dbus-x11 firefox-esr xfce4-terminal sudo nano; apt clean + +# Customize internal desktop +COPY customize/xfce4 /etc/skel/.config/xfce4/ + +# Create user account +RUN addgroup admin; useradd -m -d /home/user -s /bin/bash -G sudo,admin user +RUN echo 'user:user' | chpasswd + +# DBus config +RUN mkdir -p /var/run/dbus +RUN chown messagebus:messagebus /var/run/dbus +RUN dbus-uuidgen > /var/lib/dbus/machine-id + +# Sudo config +COPY sudo/* /etc/sudoers.d/* + +# Supervisor config +COPY supervisord/* /etc/supervisor/conf.d/ + + +CMD [ "/usr/bin/supervisord", "-n", "-c/etc/supervisor/supervisord.conf" ] diff --git a/container/customize/xfce4.tar.gz b/container/customize/xfce4.tar.gz new file mode 100644 index 0000000..8b585ce Binary files /dev/null and b/container/customize/xfce4.tar.gz differ diff --git a/container/customize/xfce4/panel/launcher-15/17311693981.desktop b/container/customize/xfce4/panel/launcher-15/17311693981.desktop new file mode 100644 index 0000000..692bf3e --- /dev/null +++ b/container/customize/xfce4/panel/launcher-15/17311693981.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Name=Firefox ESR +Comment=Browse the World Wide Web +GenericName=Web Browser +X-GNOME-FullName=Firefox ESR Web Browser +Exec=/usr/lib/firefox-esr/firefox-esr %u +Terminal=false +X-MultipleArgs=false +Type=Application +Icon=firefox-esr +Categories=Network;WebBrowser; +MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; +StartupWMClass=firefox-esr +StartupNotify=true +X-XFCE-Source=file:///usr/share/applications/firefox-esr.desktop diff --git a/container/customize/xfce4/panel/launcher-16/17311694032.desktop b/container/customize/xfce4/panel/launcher-16/17311694032.desktop new file mode 100644 index 0000000..5daa0c8 --- /dev/null +++ b/container/customize/xfce4/panel/launcher-16/17311694032.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Exec=exo-open --launch TerminalEmulator +Icon=org.xfce.terminalemulator +StartupNotify=true +Terminal=false +Categories=Utility;X-XFCE;X-Xfce-Toplevel; +OnlyShowIn=XFCE; +X-AppStream-Ignore=True +Name=Terminal Emulator +Comment=Use the command line +X-XFCE-Source=file:///usr/share/applications/xfce4-terminal-emulator.desktop diff --git a/container/customize/xfce4/panel/launcher-17/17311694113.desktop b/container/customize/xfce4/panel/launcher-17/17311694113.desktop new file mode 100644 index 0000000..b6dd1b5 --- /dev/null +++ b/container/customize/xfce4/panel/launcher-17/17311694113.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Exec=exo-open --launch FileManager %u +Icon=org.xfce.filemanager +StartupNotify=true +Terminal=false +Categories=Utility;X-XFCE;X-Xfce-Toplevel; +OnlyShowIn=XFCE; +X-XFCE-MimeType=inode/directory;x-scheme-handler/trash; +X-AppStream-Ignore=True +Name=File Manager +Comment=Browse the file system +X-XFCE-Source=file:///usr/share/applications/xfce4-file-manager.desktop diff --git a/container/customize/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/container/customize/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml new file mode 100644 index 0000000..6bb9258 --- /dev/null +++ b/container/customize/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/container/customize/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/container/customize/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml new file mode 100644 index 0000000..ec250f6 --- /dev/null +++ b/container/customize/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/container/sudo/admin-grp b/container/sudo/admin-grp new file mode 100644 index 0000000..55b9b6c --- /dev/null +++ b/container/sudo/admin-grp @@ -0,0 +1 @@ +%admin ALL=(ALL:ALL) NOPASSWD: ALL \ No newline at end of file diff --git a/container/supervisord/daemon.conf b/container/supervisord/daemon.conf new file mode 100644 index 0000000..25d9ced --- /dev/null +++ b/container/supervisord/daemon.conf @@ -0,0 +1,2 @@ +[supervisord] +user=root \ No newline at end of file diff --git a/container/supervisord/dbus.conf b/container/supervisord/dbus.conf new file mode 100644 index 0000000..87a4497 --- /dev/null +++ b/container/supervisord/dbus.conf @@ -0,0 +1,7 @@ +[program:dbus] +command=/usr/bin/dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nosyslog --nofork --nopidfile +user=root +priority=20 +startsecs=3 +autostart=true +autorestart=true \ No newline at end of file diff --git a/container/supervisord/xrdp-sesman.conf b/container/supervisord/xrdp-sesman.conf new file mode 100644 index 0000000..a4f11e4 --- /dev/null +++ b/container/supervisord/xrdp-sesman.conf @@ -0,0 +1,7 @@ +[program:xrdp-sesman] +command=/usr/sbin/xrdp-sesman --nodaemon +user=root +priority=11 +startsecs=3 +autostart=true +autorestart=true diff --git a/container/supervisord/xrdp.conf b/container/supervisord/xrdp.conf new file mode 100644 index 0000000..3927af2 --- /dev/null +++ b/container/supervisord/xrdp.conf @@ -0,0 +1,7 @@ +[program:xrdp] +command=/usr/sbin/xrdp --nodaemon +user=root +priority=10 +startsecs=3 +autostart=true +autorestart=true diff --git a/pod.yaml b/pod.yaml new file mode 100644 index 0000000..16430bf --- /dev/null +++ b/pod.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Pod +metadata: + name: DockerRDP +spec: + containers: + - name: DockerRDP + image: DockerRDP + ports: + - containerPort: 3389 \ No newline at end of file diff --git a/todo b/todo new file mode 100644 index 0000000..1225853 --- /dev/null +++ b/todo @@ -0,0 +1,4 @@ +# TODO +- make XRDP and SESMAN not log to conole +- create pod.yaml(with svc) +- maybe create user home at every start, so it is possible to mount a volume to it and persist data \ No newline at end of file