Most people definitely like "Free", right? If you are one of those people then you are in the right place, because I always provide simple and free methods for beginners and intermediates.
Here I will discuss "How to get a free VPS from GitHub using ZeroTier", most of the tutorials will definitely discuss this too, but using the "Ngrok" service not "ZeroTier".
So what do we need?
- Github Account (Create on GitHub)
- Public Repository (Create a public repo after creating an account)
- Read this article carefully
After you create a public repo on GitHub, you open your repo and create a new file in your repo:
You can upload or create the file here (I will share this repository later)
Create a file with the name ".github/workflows/main.yml" copy that name into the file name column in the github editor, and make sure the file is in the "main" branch. fill the file "main.yml" with the following contents
name: CI on: workflow_dispatch: jobs: build: runs-on: windows-2022 steps: - name: ZeroTier uses: zerotier/[email protected] with: network_id: ${{ secrets.ZEROTIER_NETWORK_ID }} - name: Enable TS run: | Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 Enable-NetFirewallRule -DisplayGroup "Remote Desktop" Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1 Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "IPAddress" -Value 0.0.0.0 $password = ConvertTo-SecureString -AsPlainText "P@ssw0rd!" -Force Set-LocalUser -Name "runneradmin" -Password $password - name: Repeat IPConfig run: | while ($true) { ipconfig Start-Sleep -Seconds 2147483 }
Let me explain from the code above, at the top is the name of our workflow, the second part "on workflow_dispatch:" this is a sign that the workflow can only be run when the user requests it, the third part is the jobs section, as the name suggests, this is the session that will work later , there isn't just one session, there can actually be many. In the session we add any processes that will be run in that session, for example the code above, the build session will run the "Remote Desktop Connection" and "ZeroTier" processes, and in the last process there is a repeat ipconfig (this aims to avoid the workflow ending, because if There are no processes that can be run, your workflow will end with a success or failure status.
Remember, the maximum limit per workflow is 6 hours. Note: Don't forget to set the secret variable "ZEROTIER_NETWORK_ID".
- 1. Go to repo settings (Not account settings)
- 2. Find "Secrets and variables" and select "Actions"
- 3. Create a new Repository secret named "ZEROTIER_NETWORK_ID"
Lastly, just run your workflow in the Actions menu (not in settings) and select the workflow called CI, then if it says "Run Workflow" click on it and run your workflow. After that, wait and when it's finished, copy the IPv4 Zerotier workflow and don't forget to also connect to the same Zerotier network so that it can run smoothly. After you copy the IPv4, open the remote desktop connection and enter the IP and use the username "runneradmin" and password "P@ssw0rd!" so you can connect. BTW, here is the link for the file. Go to the file
No comments:
Post a Comment