summaryrefslogtreecommitdiffstats
path: root/environments
diff options
context:
space:
mode:
Diffstat (limited to 'environments')
-rw-r--r--environments/README.md12
-rw-r--r--environments/vncserver-ssh-socket-forward/Dockerfile22
-rwxr-xr-xenvironments/vncserver-ssh-socket-forward/entrypoint.sh12
-rw-r--r--environments/vncserver-ssh-socket-forward/passwd1
-rw-r--r--environments/vncserver-ssh-socket-forward/run.sh25
-rw-r--r--environments/vncserver-ssh-socket-forward/ssh_key38
-rw-r--r--environments/vncserver-ssh-socket-forward/ssh_key.pub1
-rw-r--r--environments/vncserver/Dockerfile20
-rwxr-xr-xenvironments/vncserver/entrypoint.sh8
-rw-r--r--environments/vncserver/passwd1
-rw-r--r--environments/vncserver/run.sh20
11 files changed, 160 insertions, 0 deletions
diff --git a/environments/README.md b/environments/README.md
new file mode 100644
index 0000000..2bda2d3
--- /dev/null
+++ b/environments/README.md
@@ -0,0 +1,12 @@
+# Manual Testing Environments
+
+Choose one of the directories (which are named after their scenario) and run the **run.sh**
+
+## Example
+```shell
+cd environments/vncserver
+sh run.sh
+```
+
+This will run a docker container that provides the expected use case.
+
diff --git a/environments/vncserver-ssh-socket-forward/Dockerfile b/environments/vncserver-ssh-socket-forward/Dockerfile
new file mode 100644
index 0000000..01171d3
--- /dev/null
+++ b/environments/vncserver-ssh-socket-forward/Dockerfile
@@ -0,0 +1,22 @@
+FROM ubuntu:latest
+
+RUN apt-get update && apt-get install -y tigervnc-standalone-server openssh-server xvfb xterm
+RUN mkdir -p /run/sshd /var/run/sshd /root/.vnc /root/.ssh ; \
+ echo "root:root" | chpasswd && \
+ echo 'Port 2222' >> /etc/ssh/sshd_config && \
+ echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
+ echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \
+ echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config && \
+ echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+EXPOSE 2222
+
+COPY passwd /root/.vnc/passwd
+
+COPY ssh_key /root/.ssh/authorized_keys
+
+COPY entrypoint.sh /entrypoint.sh
+
+CMD [ "/entrypoint.sh" ]
diff --git a/environments/vncserver-ssh-socket-forward/entrypoint.sh b/environments/vncserver-ssh-socket-forward/entrypoint.sh
new file mode 100755
index 0000000..83ede79
--- /dev/null
+++ b/environments/vncserver-ssh-socket-forward/entrypoint.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+echo "remmina" >> ~/.vnc/passwd
+
+# Start the vnc server while only accepting connections through the unix-socket.
+# This will prompt the user for a password
+vncserver -rfbport=-1 -rfbunixpath /vnc-server-tmp/vnc.socket -xstartup /usr/bin/xterm
+
+cat ~/.ssh/authorized_keys
+
+echo "SSH Server up!"
+$(which sshd) -D
diff --git a/environments/vncserver-ssh-socket-forward/passwd b/environments/vncserver-ssh-socket-forward/passwd
new file mode 100644
index 0000000..b37aff4
--- /dev/null
+++ b/environments/vncserver-ssh-socket-forward/passwd
@@ -0,0 +1 @@
+ª‹§‚Â:ÿ~ \ No newline at end of file
diff --git a/environments/vncserver-ssh-socket-forward/run.sh b/environments/vncserver-ssh-socket-forward/run.sh
new file mode 100644
index 0000000..f807d25
--- /dev/null
+++ b/environments/vncserver-ssh-socket-forward/run.sh
@@ -0,0 +1,25 @@
+if ! type podman > /dev/null; then
+ if ! type docker > /dev/null; then
+ echo "Install podman or docker to use the remmina environments!"
+ exit 1
+ fi
+ CRT=docker
+else
+ CRT=podman
+fi
+
+CONTAINER_NAME="vncserver-ssh-socket-forward"
+
+$CRT stop "${CONTAINER_NAME}"
+$CRT rm "${CONTAINER_NAME}"
+
+$CRT build . -t remmina/test-server:latest
+
+rm -f "${PWD}/vnc-server-tmp/vnc.socket"
+rm -f "${PWD}/vnc-server-tmp/forwarded.socket"
+
+$CRT run -d -p 2222:2222 -v "${PWD}/ssh_key.pub:/root/.ssh/authorized_keys:rw" -v "${PWD}/vnc-server-tmp:/vnc-server-tmp:rw" --rm --name "${CONTAINER_NAME}" -t remmina/test-server:latest
+
+sleep 5
+
+ssh -i "${PWD}/ssh_key" -o "LocalForward=${PWD}/vnc-server-tmp/forwarded.socket /vnc-server-tmp/vnc.socket" -o StreamLocalBindUnlink=yes -o ExitOnForwardFailure=yes root@localhost -p 2222
diff --git a/environments/vncserver-ssh-socket-forward/ssh_key b/environments/vncserver-ssh-socket-forward/ssh_key
new file mode 100644
index 0000000..d23e15d
--- /dev/null
+++ b/environments/vncserver-ssh-socket-forward/ssh_key
@@ -0,0 +1,38 @@
+-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
+NhAAAAAwEAAQAAAYEA5JWiQ/HbzoCey7rGfM6ogy89aRdtzERh45JMstsb4mRnOa+1W26A
+vhoMuTyLhJF0eZQrplnjRlni/bAPizsU9W00spB7G1mciuMzM1Jk4EweRUfqes6lip5eyM
+rfqqxax0iilnpOA5pA+24ArdRCwefJYg6PfGhaGKoWUW+pXySPvF6K2yPpWV6naopf6tkm
+ezJX70daU7dCLs4YQCEujl6nIJnPM7ym5uI94HCem08h8/d8+2AVVtSpLDOx/dXy9DvieM
+5E3+ps6DDq0QimBoJHXYms3+s5YT2z3VXy3fM0FZuVgqMjCWN5di83gYkSy0a+kVaSXYQe
+wRr3ZJsYJ9W8UxexMSKt5HNzYPDx+pGWXbuMy/4IhJ4foZqj5uolcd5d5n4yebi2Wg10od
+mSYhkBN2uP+MM0Vat1S38c5wNp1UUqIMHE0Qzj6yXrigubtyS5rrCVChjAvqGUKBeYRtYw
+Aw8AP5FxXp+8esVehTOl5n1CJlktWBCcWmde0ZQ9AAAFiC3TK5Qt0yuUAAAAB3NzaC1yc2
+EAAAGBAOSVokPx286Ansu6xnzOqIMvPWkXbcxEYeOSTLLbG+JkZzmvtVtugL4aDLk8i4SR
+dHmUK6ZZ40ZZ4v2wD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tP1bDUV/Go+P31NwGe/6lVa1fbQgCQLrBqLGfoXFMVWWgxUZ1+ufg0j/vmGhdP
+3GriR64Hq4R5SjjUoPwIhEGMChk74zsi85J2spQ+x9QMG1wVcZrkEJuxZCrAxxWvlzFw6c
+yYTR7AMkTlucK7Hxus/CBMptrbfbJscZEUABbltZ+RsNV06owAAADBAPv/cPqQmpMYZfVK
+tz4XgWiKPMK3pKxbezVjf5S5ToX26X6nWqiGDBbCRWL5Ch3EpRY4dPDUNVbd64s+dLfJgX
+/jIjqKrvzJIHQ7coxf1c0TS482TbREuXvnMDpnh7Ms33egdWu+DxDDjfhvWRnz5bKmCBkc
+I/QKXzUwYDQoCdcFSW8tXqv3Jyc8zjYe0e/wGoYzBu9/cnPLnkklMv1w4kVRj9b1qpK48u
+dGgI/u++spF9oUJiL2PaQX0bBUlzwJwQAAAMEA6Db//5dXzLeZEvxH0ir6fk/1W7O8Kgwc
+00Q41TlqVdwRZfh3nyGyaqU/jmR9CKtEW/fcIp+IVsxE+50W73qwkdny9ZL7Iu7OtPL+ls
+qqTgwxXFr1ZH0bChBQugmBTIlV5GTnQzM1v8wOzuCgTpMAMXUH8PKgwbA7SnrBqKqMB9vm
+W/8sYoYDbxoVXmEl/BA8++KuBlP5tJzosK23brh8ew9hqXbNzInj7n1PlOzFodYUQdMiFs
+A8HN9tqKkimxF9AAAADm1hdGhpYXNAcG9wLW9zAQIDBA==
+-----END OPENSSH PRIVATE KEY-----
diff --git a/environments/vncserver-ssh-socket-forward/ssh_key.pub b/environments/vncserver-ssh-socket-forward/ssh_key.pub
new file mode 100644
index 0000000..aa0f982
--- /dev/null
+++ b/environments/vncserver-ssh-socket-forward/ssh_key.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDklaJD8dvOgJ7LusZ8zqiDLz1pF23MRGHjkkyy2xviZGc5r7VbboC+Ggy5PIuEkXR5lCumWeNGWeL9sA+LOxT1bTSykHsbWZyK4zMzUmTgTB5FR+p6zqWKnl7Iyt+qrFrHSKKWek4DmkD7bgCt1ELB58liDo98aFoYqhZRb6lfJI+8XorbI+lZXqdqil/q2SZ7MlfvR1pTt0IuzhhAIS6OXqcgmc8zvKbm4j3gcJ6bTyHz93z7YBVW1KksM7H91fL0O+J4zkTf6mzoMOrRCKYGgkddiazf6zlhPbPdVfLd8zQVm5WCoyMJY3l2LzeBiRLLRr6RVpJdhB7BGvdkmxgn1bxTF7ExIq3kc3Ng8PH6kZZdu4zL/giEnh+hmqPm6iVx3l3mfjJ5uLZaDXSh2ZJiGQE3a4/4wzRVq3VLfxznA2nVRSogwcTRDOPrJeuKC5u3JLmusJUKGMC+oZQoF5hG1jADDwA/kXFen7x6xV6FM6XmfUImWS1YEJxaZ17RlD0= mathias@pop-os
diff --git a/environments/vncserver/Dockerfile b/environments/vncserver/Dockerfile
new file mode 100644
index 0000000..b9e9fe2
--- /dev/null
+++ b/environments/vncserver/Dockerfile
@@ -0,0 +1,20 @@
+FROM ubuntu:latest
+
+RUN apt-get update && apt-get install -y tigervnc-standalone-server openssh-server xvfb xterm
+RUN mkdir -p /run/sshd /var/run/sshd /root/.vnc /root/.ssh ; \
+ echo "root:root" | chpasswd && \
+ echo 'Port 2222' >> /etc/ssh/sshd_config && \
+ echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
+ echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \
+ echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config && \
+ echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+EXPOSE 5555
+
+COPY passwd /root/.vnc/passwd
+
+COPY entrypoint.sh /entrypoint.sh
+
+CMD [ "/entrypoint.sh" ]
diff --git a/environments/vncserver/entrypoint.sh b/environments/vncserver/entrypoint.sh
new file mode 100755
index 0000000..6c7c1ad
--- /dev/null
+++ b/environments/vncserver/entrypoint.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+echo "remmina" >> ~/.vnc/passwd
+
+# Start the vnc server while only accepting connections through the unix-socket.
+# This will prompt the user for a password
+vncserver -rfbport=5555 -localhost no -Log *:stderr:100 -xstartup /usr/bin/xterm
+tail -f ~/.vnc/*.log
diff --git a/environments/vncserver/passwd b/environments/vncserver/passwd
new file mode 100644
index 0000000..b37aff4
--- /dev/null
+++ b/environments/vncserver/passwd
@@ -0,0 +1 @@
+ª‹§‚Â:ÿ~ \ No newline at end of file
diff --git a/environments/vncserver/run.sh b/environments/vncserver/run.sh
new file mode 100644
index 0000000..2f19341
--- /dev/null
+++ b/environments/vncserver/run.sh
@@ -0,0 +1,20 @@
+if ! type podman > /dev/null; then
+ if ! type docker > /dev/null; then
+ echo "Install podman or docker to use the remmina environments!"
+ exit 1
+ fi
+ CRT=docker
+else
+ CRT=podman
+fi
+
+
+CONTAINER_NAME="vncserver-ssh-socket-forward"
+IMAGE_NAME="remmina/environments/vncserver"
+
+$CRT stop "${CONTAINER_NAME}"
+$CRT rm "${CONTAINER_NAME}"
+
+$CRT build . -t ${IMAGE_NAME}
+
+$CRT run -p 5555:5555 -v "${PWD}/vnc-server-tmp:/vnc-server-tmp:rw" --rm --name "${CONTAINER_NAME}" -it ${IMAGE_NAME}