Thanks for offering to help me test out using GitHub Sponsors as an authentication method for the SSH gateway we built for GitHub Actions.
This should take < 5 minutes.
Create a new repo in your personal user account.
Add the following file: .github/workflows/connect.yaml
:
name: connect
on:
pull_request:
branches:
- '*'
push:
branches:
- master
- main
workflow_dispatch:
permissions:
id-token: write
contents: read
actions: read
jobs:
connect:
name: connect
runs-on: ubuntu-latest
steps:
- uses: self-actuated/connect-ssh@master
Commit the file and navigate to the sessions page
Look for your connection and SSH command and copy/paste it into a terminal.
Either have a step in the job that starts a server/daemon, or connect via SSH and start Nginx:
docker run --name nginx -p 8080:80 -d nginx:latest
Next, edit the SSH command given to you, and add:
-L 8080:127.0.0.1:8080
Head over to: http://127.0.0.1:8080 and you'll be accessing the server directly from within the runner.
To forward multiple services:
-L 3000:127.0.0.1:3000 -L 9090:127.0.0.1:9090
And so forth.
Connect via SSH using port forwarding as per above:
-L 3128:127.0.0.1:3128
Install Squid:
sudo apt install -qy squid
Make a curl request and see that you have the public IP of the GitHub Actions runner:
curl -x http://127.0.0.1:3128 -i https://checkip.amazonaws.com
HTTP/1.1 200 Connection established
HTTP/1.1 200 OK
Date: Thu, 21 Dec 2023 12:24:18 GMT
Server: Not Available
Content-Length: 12
Connection: keep-alive
4.227.115.6
The CLI has an "ssh connect" command to make the above quicker/easier.
You'll need arkade, or to download the binary for actuated-cli from its releases page.
arkade get actuated-cli
actuated-cli auth
actuated-cli ssh list
actuated-cli ssh connect