Skip to content

Commit 625fcfc

Browse files
committed
docs: Update README.md
1 parent f3ec28d commit 625fcfc

File tree

2 files changed

+58
-12
lines changed

2 files changed

+58
-12
lines changed

README.md

+57-10
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ This action installs [cloudflared](https://github.com/cloudflare/cloudflared) fo
55

66
This action will automatically sign in and start Cloudflare Tunnel.
77

8-
Other virtual environments besides Ubuntu are not supported yet.
8+
This GitHub action participated on [GitHub Actions Hackathon 2021](https://dev.to/animmouse/expose-your-web-server-on-github-actions-to-the-internet-using-cloudflare-tunnel-ego), but sadly, it lost.
99

10-
[Test page for setup-cloudflared](https://setup-cloudflared.0000004.xyz) (This will only work when the test action is running.)
10+
Test page for setup-cloudflared: https://setup-cloudflared.44444444.xyz (This will only work when the test action is running.)
1111

1212
## Usage
13-
1. Encode the JSON credential in base64 using this command `base64 -w 0 <cloudflare-tunnel-id>.json` and paste it to `CLOUDFLARE_TUNNEL_CREDENTIAL` secret.
14-
2. At the config.yaml, set `credentials-file:` to `/home/runner/.cloudflared/<cloudflare-tunnel-id>.json`
15-
3. Encode the config.yaml in base64 using this command `base64 -w 0 config.yaml` and paste it to `CLOUDFLARE_TUNNEL_CONFIGURATION` secret.
13+
1. Encode the JSON credential in Base64 using this command `base64 -w 0 <cloudflare-tunnel-id>.json` and paste it to `CLOUDFLARE_TUNNEL_CREDENTIAL` secret.
14+
2. At the config.yaml, set `credentials-file:` to:
15+
1. Ubuntu: `/home/runner/.cloudflared/<cloudflare-tunnel-id>.json`
16+
2. Windows: `C:\Users\runneradmin\.cloudflared\<cloudflare-tunnel-id>.json`
17+
3. macOS: `/Users/runner/.cloudflared/<cloudflare-tunnel-id>.json`
18+
3. Encode the config.yaml in Base64 using this command `base64 -w 0 config.yaml` and paste it to `CLOUDFLARE_TUNNEL_CONFIGURATION` secret.
1619
4. Add the Cloudflare Tunnel ID to `CLOUDFLARE_TUNNEL_ID` secret.
1720

1821
To gracefully shutdown Cloudflare Tunnel after being started in the background, use the `AnimMouse/setup-cloudflared/shutdown` action as composite actions does not support `post:` yet.\
1922
The `Shutdown Cloudflare Tunnel` action should have `if: always()` so that it will run even if the workflow failed or canceled.
2023

2124
```yaml
2225
steps:
23-
- name: Setup Cloudflare Tunnel
26+
- name: Setup cloudflared
2427
uses: AnimMouse/setup-cloudflared@v1
2528
with:
2629
cloudflare_tunnel_credential: ${{ secrets.CLOUDFLARE_TUNNEL_CREDENTIAL }}
@@ -30,7 +33,7 @@ steps:
3033
- name: Start Python HTTP server
3134
run: timeout 5m python -m http.server 8080 || true
3235

33-
- name: Shutdown and view logs of Cloudflare Tunnel
36+
- name: Shutdown and view logs of cloudflared
3437
if: always()
3538
uses: AnimMouse/setup-cloudflared/shutdown@v1
3639
```
@@ -39,26 +42,70 @@ If you don't want to autostart Cloudflare Tunnel, set `autostart:` to `false`.
3942

4043
```yaml
4144
steps:
42-
- name: Setup Cloudflare Tunnel
45+
- name: Setup cloudflared
4346
uses: AnimMouse/setup-cloudflared@v1
4447
with:
4548
cloudflare_tunnel_credential: ${{ secrets.CLOUDFLARE_TUNNEL_CREDENTIAL }}
4649
cloudflare_tunnel_configuration: ${{ secrets.CLOUDFLARE_TUNNEL_CONFIGURATION }}
4750
cloudflare_tunnel_id: ${{ secrets.CLOUDFLARE_TUNNEL_ID }}
4851
autostart: false
4952
50-
- name: Manually start Cloudflare Tunnel
53+
- name: Manually start cloudflared
5154
run: timeout 5m cloudflared tunnel run || true
5255
```
5356

57+
### Specific version
58+
You can specify the version you want. By default, this action downloads the latest version if version is not specified.
59+
60+
```yaml
61+
steps:
62+
- name: Setup cloudflared
63+
uses: AnimMouse/setup-cloudflared@v1
64+
with:
65+
cloudflare_tunnel_credential: ${{ secrets.CLOUDFLARE_TUNNEL_CREDENTIAL }}
66+
cloudflare_tunnel_configuration: ${{ secrets.CLOUDFLARE_TUNNEL_CONFIGURATION }}
67+
cloudflare_tunnel_id: ${{ secrets.CLOUDFLARE_TUNNEL_ID }}
68+
version: 2023.8.1
69+
```
70+
71+
### GitHub token
72+
This action automatically uses a GitHub token in order to authenticate with GitHub API and avoid rate limiting. You can also specify your own read-only fine-grained personal access token.
73+
74+
```yaml
75+
steps:
76+
- name: Setup cloudflared
77+
uses: AnimMouse/setup-cloudflared@v1
78+
with:
79+
cloudflare_tunnel_credential: ${{ secrets.CLOUDFLARE_TUNNEL_CREDENTIAL }}
80+
cloudflare_tunnel_configuration: ${{ secrets.CLOUDFLARE_TUNNEL_CONFIGURATION }}
81+
cloudflare_tunnel_id: ${{ secrets.CLOUDFLARE_TUNNEL_ID }}
82+
token: ${{ secrets.GH_PAT }}
83+
```
84+
5485
### Example config.yaml file
86+
Ubuntu:
5587
```yaml
5688
url: http://localhost:8080
5789
tunnel: deadbeef-1234-4321-abcd-123456789abc
5890
credentials-file: /home/runner/.cloudflared/deadbeef-1234-4321-abcd-123456789abc.json
5991
```
6092

93+
Windows:
94+
```yaml
95+
url: http://localhost:8080
96+
tunnel: deadbeef-1234-4321-abcd-123456789abc
97+
credentials-file: C:\Users\runneradmin\.cloudflared\deadbeef-1234-4321-abcd-123456789abc.json
98+
```
99+
100+
macOS:
101+
```yaml
102+
url: http://localhost:8080
103+
tunnel: deadbeef-1234-4321-abcd-123456789abc
104+
credentials-file: /Users/runner/.cloudflared/deadbeef-1234-4321-abcd-123456789abc.json
105+
```
106+
61107
### Similar actions
62108
1. [vmactions/cf-tunnel](https://github.com/vmactions/cf-tunnel)
63109
2. [apogiatzis/ngrok-tunneling-action](https://github.com/apogiatzis/ngrok-tunneling-action)
64-
3. [vmactions/ngrok-tunnel](https://github.com/vmactions/ngrok-tunnel)
110+
3. [vmactions/ngrok-tunnel](https://github.com/vmactions/ngrok-tunnel)
111+
4. [debugci/setup-cloudflared](https://github.com/debugci/setup-cloudflared)

action.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ inputs:
1414
description: Cloudflare Tunnel ID (deadbeef-1234-4321-abcd-123456789abc)
1515
required: true
1616
autostart:
17-
description: Autostart Cloudflare Tunnel in the background
18-
required: false
17+
description: Autostart cloudflared in the background
1918
default: true
2019
version:
2120
description: cloudflared version

0 commit comments

Comments
 (0)