Haha / entrypoint.sh
Guinnessgshep's picture
Create entrypoint.sh
7170220
raw
history blame
1.12 kB
#!/bin/bash
echo "Updating system and installing dependencies..."
apt-get update
apt-get install -y sudo tmate curl unzip jq xrdp kubuntu-desktop
echo "Changing root password..."
echo -e "ilovedogshit\nilovedogshit" | sudo passwd root
echo "Setting up tmate session..."
tmate -S $TMATE_SOCK new-session -d
tmate -S $TMATE_SOCK wait tmate-ready
echo "SSH connection: $(tmate -S $TMATE_SOCK display -p '#{tmate_ssh}')"
echo "Web connection: $(tmate -S $TMATE_SOCK display -p '#{tmate_web}')"
echo "Starting xrdp..."
sudo /etc/init.d/xrdp start
echo "Installing ngrok..."
curl -s https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip > ngrok.zip
unzip ngrok.zip
chmod +x ./ngrok
echo "Starting ngrok tunnel..."
./ngrok authtoken 2N5KFYmyocPObelDKx26R1e2gfP_MiFweWSd9A8CbrC1E9Ef
./ngrok tcp 3389 &
sleep 10
echo "Getting ngrok URL..."
NGROK_URL=$(curl --silent --show-error http://localhost:4040/api/tunnels | jq -r '.tunnels[0].public_url')
if [ -z "$NGROK_URL" ]; then
echo "Failed to get ngrok URL"
exit 1
fi
echo "RDP connection: $NGROK_URL"
# Keeps the container running
tail -f /dev/null