Guinnessgshep commited on
Commit
7170220
1 Parent(s): 72084a4

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +40 -0
entrypoint.sh ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ echo "Updating system and installing dependencies..."
4
+ apt-get update
5
+ apt-get install -y sudo tmate curl unzip jq xrdp kubuntu-desktop
6
+
7
+ echo "Changing root password..."
8
+ echo -e "ilovedogshit\nilovedogshit" | sudo passwd root
9
+
10
+ echo "Setting up tmate session..."
11
+ tmate -S $TMATE_SOCK new-session -d
12
+ tmate -S $TMATE_SOCK wait tmate-ready
13
+ echo "SSH connection: $(tmate -S $TMATE_SOCK display -p '#{tmate_ssh}')"
14
+ echo "Web connection: $(tmate -S $TMATE_SOCK display -p '#{tmate_web}')"
15
+
16
+ echo "Starting xrdp..."
17
+ sudo /etc/init.d/xrdp start
18
+
19
+ echo "Installing ngrok..."
20
+ curl -s https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip > ngrok.zip
21
+ unzip ngrok.zip
22
+ chmod +x ./ngrok
23
+
24
+ echo "Starting ngrok tunnel..."
25
+ ./ngrok authtoken 2N5KFYmyocPObelDKx26R1e2gfP_MiFweWSd9A8CbrC1E9Ef
26
+ ./ngrok tcp 3389 &
27
+ sleep 10
28
+
29
+ echo "Getting ngrok URL..."
30
+ NGROK_URL=$(curl --silent --show-error http://localhost:4040/api/tunnels | jq -r '.tunnels[0].public_url')
31
+
32
+ if [ -z "$NGROK_URL" ]; then
33
+ echo "Failed to get ngrok URL"
34
+ exit 1
35
+ fi
36
+
37
+ echo "RDP connection: $NGROK_URL"
38
+
39
+ # Keeps the container running
40
+ tail -f /dev/null