-
Notifications
You must be signed in to change notification settings - Fork 28
116 lines (110 loc) · 4.09 KB
/
main_ubuntu_RDP.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI [Ubuntu]
on: [workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Adding Architecture amd64
run: |
sudo apt update
sudo apt install -y qemu-user-static binfmt-support
sudo dpkg --add-architecture amd64
sudo apt update
sudo apt install libc6:amd64
- name: Creating New User
run: |
user=your_selected_account_name
password=your_supersecret_password
sudo adduser --quiet --disabled-password --shell /bin/bash --home /home/$user --gecos "User" $user
# set password
echo "$user:$password" | sudo chpasswd
echo User: $user has been created with password: $password
sudo usermod -aG sudo $user
#SCRIPT END
- name: Install Unzipper
run: sudo apt-get install unzip -y
- name: Ngrok Downloading(Linux)
run: wget -O ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
- name: Ngrok Extracting(Linux)
run: unzip ngrok.zip
- name: Ngrok Make Executable
run: sudo cp ./ngrok /usr/bin/ngrok
- name: Ngrok Auth
run: ngrok authtoken $NGROK_AUTH_TOKEN
env:
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
# run: ngrok config add-authtoken $Env:NGROK_AUTH_TOKEN
- name: Install Libraries
run: |
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse
sudo apt install snapd
sudo apt install openssh-server
sudo systemctl status ssh
sudo apt-get update # mass install
sudo apt install ubuntu-desktop
sudo apt install xorg
sudo apt install xrdp
sudo apt install xorgxrdp
sudo apt install xserver-xorg-core
sudo apt install xserver-xorg-input-all
sudo apt install xfonts-base
sudo apt install xfonts-75dpi
sudo apt install xfonts-100dpi
sudo apt install mate-core
sudo apt install mate-desktop-environment
sudo apt install mate-notification-daemon
sudo apt install ubuntu-gnome-desktop
sudo apt install gnome-session-flashback
sudo apt install gnome-panel
sudo apt install xfce4
sudo apt install xfce4-goodies
sudo apt-get autoremove -y
- name: Auth
run: |
sudo bash -c 'cat > /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf' << EOF
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" ||
action.id == "org.freedesktop.color-manager.create-profile" ||
action.id == "org.freedesktop.color-manager.delete-device" ||
action.id == "org.freedesktop.color-manager.delete-profile" ||
action.id == "org.freedesktop.color-manager.modify-device" ||
action.id == "org.freedesktop.color-manager.modify-profile") &&
subject.isInGroup("{users}")) {
return polkit.Result.YES;
}
});
EOF
- name: Config RDP in Ubuntu(XRDP)
run: |
sudo ufw allow 3389/tcp #setting tcp port
if [ -f /home/${USER}/.xsession ]; then #session manager
rm -f /home/${USER}/.xsession
fi
cat << 'EOF' >> /home/${USER}/.xsession
export LOGNAME=$USER
export LIBGL_ALWAYS_INDIRECT=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
mate-session
EOF
chmod +x /home/${USER}/.xsession #session manager
- name: Run Bash
run: sudo sed -i "s|#\!/bin/sh|#\!/bin/bash|g" /etc/X11/Xsession
- name: Starting XRDP
run: |
sudo adduser xrdp ssl-cert
sudo service xrdp restart
sudo service xrdp status
- name: Config Of XRDP vim
run: |
sudo apt install nano -y
echo `cat /etc/xrdp/xrdp.ini`
- name: Create Tunnel
run: ngrok tcp 3389 &
- name: ngrok is now listening to VNC connections on...
run: curl --silent http://127.0.0.1:4040/api/tunnels | jq '.tunnels[0].public_url'
- name: Setup tmate session
uses: mxschmitt/action-tmate@v2