|
| 1 | +# SSH Tunnel |
| 2 | + |
| 3 | +The ssh-tunnel action will create a reverse tunnel over webrtc to port 22 on the runner. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +In order to use this action you must have a sdp offer from your local host and a ssh key pair. |
| 8 | +Start with creating an sdp offer on your local machine. Provide these values to the ssh-tunnel |
| 9 | +action and wait for output from the action with the sdp reply. Provide the reply to the local |
| 10 | +rtcforward.py process by pasting it to stdin. If all goes well the local port on your maching |
| 11 | +will be forwarded to the ssh port on the runner. |
| 12 | + |
| 13 | +### Getting an sdp offer |
| 14 | + |
| 15 | +To get an sdp offer start rtcforward.py on you local machine with the offer command. |
| 16 | +You can also specify which port on the local machine will be used for the tunnel. |
| 17 | + |
| 18 | +``` bash |
| 19 | +$ python3 .github/actions/ssh-tunnel/rtcforward.py offer --port 5222 |
| 20 | +``` |
| 21 | + |
| 22 | +rtcforward.py will create an offer an display it to your terminal. (This example offer has been truncated) |
| 23 | +After showing the offer the `rtcforward.py` process will wait for a reply. |
| 24 | +``` |
| 25 | +-- offer -- |
| 26 | +eyJzZHAiOiAidj0wXHJcbm89LSAzOTQ3Mzg4NjUzIDM5NDczODg2NTMgSU4gSVA0IDAuMC4wLjBcclxu |
| 27 | +cz0tXHJcbnQ9MCAwXHJcbmE9Z3JvdXA6QlVORExFIDBcclxuYT1tc2lkLXNlbWFudGljOldNUyAqXHJc |
| 28 | +bm09YXBwbGljYXRpb24gMzUyNjkgRFRMUy9TQ1RQIDUwMDBcclxuYz1JTiBJUDQgMTkyLjE2OC4wLjIw |
| 29 | +IHVkcCAxNjk0NDk4ODE1IDE4NC4xNzkuMjEwLjE1MiAzNTI2OSB0eXAgc3JmbHggcmFkZHIgMTkyLjE2 |
| 30 | +OC4wLjIwMSBycG9ydCAzNTI2OVxyXG5hPWNhbmRpZGF0ZTozZWFjMzJiZTZkY2RkMTAwZDcwMTFiNWY0 |
| 31 | +NTo4Qzo2MDoxMTpFQTo3NzpDMTo5RTo1QTo3QzpDQzowRDowODpFQzo2NDowQToxM1xyXG5hPWZpbmdl |
| 32 | +cnByaW50OnNoYS01MTIgNjY6MzI6RUQ6MDA6N0I6QjY6NTQ6NzA6MzE6OTA6M0I6Mjg6Q0I6QTk6REU6 |
| 33 | +MzQ6QjI6NDY6NzE6NUI6MjM6ODA6Nzg6Njg6RDA6QTA6QTg6MjU6QkY6MDQ6ODY6NUY6OTA6QUY6MUQ6 |
| 34 | +QjA6QzY6ODA6QUY6OTc6QTI6MkM6NDI6QUU6MkI6Q0Q6Mjk6RUQ6MkI6ODc6NTU6ODg6NDY6QTM6ODk6 |
| 35 | +OEY6ODk6OTE6QTE6QTI6NDM6NTc6M0E6MjZcclxuYT1zZXR1cDphY3RwYXNzXHJcbiIsICJ0eXBlIjog |
| 36 | +Im9mZmVyIn0= |
| 37 | +-- end offer -- |
| 38 | +-- Please enter a message from remote party -- |
| 39 | +``` |
| 40 | + |
| 41 | +### Getting an sdp answer |
| 42 | + |
| 43 | +Provide the offer to the ssh-tunnel action. When the action runs, an answer to the offer will be generated. |
| 44 | +In the action output you will see that the offer was recieved and the reply in the output. |
| 45 | + |
| 46 | +``` |
| 47 | +-- Please enter a message from remote party -- |
| 48 | +-- Message received -- |
| 49 | +-- reply -- |
| 50 | +eyJzZHAiOiAidj0wXHJcbm89LSAzOTQ3Mzg3NDcxIDM5NDczODc0NzEgSU4gSVA0IDAuMC4wLjBcclxu |
| 51 | +cz0tXHJcbnQ9MCAwXHJcbmE9Z3JvdXA6QlVORExFIDBcclxuYT1tc2lkLXNlbWFudGljOldNUyAqXHJc |
| 52 | +bm09YXBwbGljYXRpb24gNTcwMzkgRFRMUy9TQ1RQIDUwMDBcclxuYz1JTiBJUDQgMTkyLjE2OC42NC4x |
| 53 | +MFxyXG5hPW1pZDowXHJcbmE9c2N0cG1hcDo1MDAwIHdlYnJ0Yy1kYXRhY2hhbm5lbCA2NTUzNVxyXG5h |
| 54 | +MTc6MEI6RTA6OTA6QUM6RjU6RTk6RUI6Q0E6RUE6NTY6REI6NTA6QTk6REY6NTU6MzY6MkM6REI6OUE6 |
| 55 | +MDc6Mzc6QTM6NDc6NjlcclxuYT1maW5nZXJwcmludDpzaGEtNTEyIDMyOjRDOjk0OkRDOjNFOkU5OkU3 |
| 56 | +OjNCOjc5OjI4OjZDOjc5OkFEOkVDOjIzOkJDOjRBOjRBOjE5OjlCOjg5OkE3OkE2OjZBOjAwOjJFOkM5 |
| 57 | +OkE0OjlEOjAwOjM0OjFFOjRDOkVGOjcwOkY5OkNBOjg0OjlEOjcxOjI5OkVCOkIxOkREOkFEOjg5OjUx |
| 58 | +OkZFOjhCOjI3OjFDOjFBOkJEOjUxOjQ2OjE4OjBBOjhFOjVBOjI1OjQzOjQzOjZGOkRBXHJcbmE9c2V0 |
| 59 | +dXA6YWN0aXZlXHJcbiIsICJ0eXBlIjogImFuc3dlciJ9 |
| 60 | +-- end reply -- |
| 61 | +``` |
| 62 | + |
| 63 | +# Finalizing the tunnel |
| 64 | + |
| 65 | +Paste the sdp reply from the running action into the running `rtcforward.py` process that created the offer. |
| 66 | +After receiveing the offer you will see `-- Message received --` and tunnel will be created. |
| 67 | + |
| 68 | +``` |
| 69 | +-- offer -- |
| 70 | +eyJzZHAiOiAidj0wXHJcbm89LSAzOTQ3Mzg4NjUzIDM5NDczODg2NTMgSU4gSVA0IDAuMC4wLjBcclxu |
| 71 | +cz0tXHJcbnQ9MCAwXHJcbmE9Z3JvdXA6QlVORExFIDBcclxuYT1tc2lkLXNlbWFudGljOldNUyAqXHJc |
| 72 | +bm09YXBwbGljYXRpb24gMzUyNjkgRFRMUy9TQ1RQIDUwMDBcclxuYz1JTiBJUDQgMTkyLjE2OC4wLjIw |
| 73 | +IHVkcCAxNjk0NDk4ODE1IDE4NC4xNzkuMjEwLjE1MiAzNTI2OSB0eXAgc3JmbHggcmFkZHIgMTkyLjE2 |
| 74 | +OC4wLjIwMSBycG9ydCAzNTI2OVxyXG5hPWNhbmRpZGF0ZTozZWFjMzJiZT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RDOjNFOkU5OkU3 |
| 89 | +OjNCOjc5OjI4OjZDOjc5OkFEOkVDOjIzOkJDOjRBOjRBOjE5OjlCOjg5OkE3OkE2OjZBOjAwOjJFOkM5 |
| 90 | +OkE0OjlEOjAwOjM0OjFFOjRDOkVGOjcwOkY5OkNBOjg0OjlEOjcxOjI5OkVCOkIxOkREOkFEOjg5OjUx |
| 91 | +OkZFOjhCOjI3OjFDOjFBOkJEOjUxOjQ2OjE4OjBBOjhFOjVBOjI1OjQzOjQzOjZGOkRBXHJcbmE9c2V0 |
| 92 | +dXA6YWN0aXZlXHJcbiIsICJ0eXBlIjogImFuc3dlciJ9 |
| 93 | +-- Message received -- |
| 94 | +``` |
0 commit comments