-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e593892
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Ngrok tunelling Github Action | ||
|
||
This is a Github Action that can be used in your Github Workflow to tunnel incoming/outgoing TCP traffic in your workflow environment. | ||
|
||
The original use case for this was to achieve temporary deployment for CTF challenges under development but it can be as well used in many more other cases. | ||
|
||
## How to use this Action | ||
|
||
This action accepts the following parameters | ||
|
||
| Name| Description | Required | Default | | ||
| ------------- |-------------|-----|-----| | ||
| timeout | After this timeout the deployment will automatically shutdown the tunelling and therefore stop the action. (max is 6 hours) | No | 1h | | ||
| port | The port in localhost to forward traffic from/to | Yes | - | | ||
| ngrok_authtoken | Your ngrok authtoken| Yes | - | | ||
|
||
Here is an example of using this action: | ||
|
||
``` | ||
name: CI | ||
on: push | ||
jobs: | ||
deploy: | ||
name: Deploy challenge | ||
runs-on: ubuntu-latest | ||
needs: cancel | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Run container | ||
run: docker-compose up -d | ||
- uses: ./ | ||
with: | ||
timeout: 1h | ||
port: 4000 | ||
ngrok_authtoken: ${{ secrets.NGROK_AUTHTOKEN }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: 'Ngrok TCP Tunelling' | ||
description: 'A github action for tunelling TCP traffic from within Workflow environemt' | ||
inputs: | ||
timeout: | ||
description: 'Challenge deployment timeout' | ||
required: true | ||
default: '1h' | ||
port: | ||
description: 'The port to forward traffic to' | ||
required: true | ||
ngrok_authtoken: | ||
description: 'Ngrok authorization token' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- run: wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | ||
shell: bash | ||
- run: unzip -qq ngrok-stable-linux-amd64.zip | ||
shell: bash | ||
- run: ./ngrok authtoken ${{ inputs.ngrok_authtoken }} | ||
shell: bash | ||
- run: timeout ${{ inputs.timeout }} ./ngrok tcp ${{ inputs.port }} | ||
shell: bash |