@@ -30,31 +30,51 @@ docker compose up -d
30
30
- ** LABELS** - Runner labels (comma separated). Uses ` "docker-node,${os_name}-${architecture}" `
31
31
- ** REUSE_EXISTING** - Re-use existing configuration. Defaults to ` false `
32
32
33
- > ` REUSE_EXISTING ` can come in handy when a container restarts due to a problem,
34
- > or when a container is terminated without gracefully shutting down.
33
+ > [ !NOTE]
34
+ > ` REUSE_EXISTING ` flag can be useful when a container restarts due to an issue or
35
+ > when a container is reused after being terminated without shutting down gracefully.
36
+ > <details >
37
+ > <summary ><strong >More info</strong ></summary >
38
+ >
39
+ > Following files/directories are created (commonly across ` macOS ` , ` Linux ` and ` Windows ` runners)
40
+ > only when the runner has been configured
41
+ > - ` _work `
42
+ > - ` _diag `
43
+ > - ` .runner `
44
+ > - ` .credentials `
45
+ > - ` .credentials_rsaparams `
46
+ >
47
+ > So, a simple check on one or more of these files' presence should confirm if the runner has been configured already
48
+ >
49
+ > ** Note:** Warnings like the ones below are common, and GitHub typically reconnects the runner automatically.
50
+ > ``` text
51
+ > A session for this runner already exists.
52
+ > ```
53
+ > ```
54
+ > Runner connect error: The actions runner i-058175xh7908r2u46 already has an active session.. Retrying until reconnected.
55
+ > ```
56
+ > </details>
35
57
36
58
> [!WARNING]
37
59
Using this image **without** the env var `GIT_REPOSITORY` will create an organization level runner.
38
60
Using self-hosted runners in public repositories pose some considerable security threats.
39
61
> - [#self-hosted-runner-security]
40
62
> - [#restricting-the-use-of-self-hosted-runners]
41
63
> - [#configuring-required-approval-for-workflows-from-public-forks]
42
- >
43
- > ** Author Note:** _ Be mindful of the env vars you set when spinning up containers_
44
64
45
65
<details>
46
- <summary ><strong >Env vars for startup notifications</strong ></summary >
66
+ <summary><strong>Env vars for notifications</strong></summary>
47
67
48
- > This project supports [ ntfy] and [ telegram bot] for startup notifications.
68
+ > This project supports [ntfy] and [telegram bot] for startup/shutdown notifications.
49
69
50
70
**NTFY**
51
71
52
72
Choose ntfy setup instructions with [basic][ntfy-setup-basic] **OR** [authentication][ntfy-setup-auth] abilities
53
73
54
- - ** NTFY_USERNAME** - Ntfy username for authentication _ (if topic is protected)_
55
- - ** NTFY_PASSWORD** - Ntfy password for authentication _ (if topic is protected)_
56
74
- **NTFY_URL** - Ntfy endpoint for notifications.
57
75
- **NTFY_TOPIC** - Topic to which the notifications have to be sent.
76
+ - **NTFY_USERNAME** - Ntfy username for authentication _(if topic is protected)_
77
+ - **NTFY_PASSWORD** - Ntfy password for authentication _(if topic is protected)_
58
78
59
79
**Telegram**
60
80
@@ -63,16 +83,22 @@ Steps for telegram bot configuration
63
83
1. Use [BotFather] to create a telegram bot token
64
84
2. Send a test message to the Telegram bot you created
65
85
3. Use the URL https://api.telegram.org/bot{token}/getUpdates to get the Chat ID
66
- - You can also use Thread ID to send notifications to a particular thread within a chat window
86
+ - You can also use Thread ID to send notifications to a particular thread within a group
67
87
68
88
```shell
69
89
export TELEGRAM_BOT_TOKEN="your-bot-token"
70
90
export CHAT_ID=$(curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getUpdates" | jq -r '.result[0].message.chat.id')
71
- export THREAD_ID=$( curl -s " https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN} /getUpdates" | jq -r ' .result[0]|.update_id' )
72
91
```
73
92
74
93
- ** TELEGRAM_BOT_TOKEN** - Telegram Bot token
75
94
- ** TELEGRAM_CHAT_ID** - Chat ID to which the notifications have to be sent.
95
+ - ** THREAD_ID** - Optional thread ID to send notifications to a specific thread.
96
+
97
+ > ** Note:** To send notifications to threads, the bot should be added to a group with [ Topics] [ telegram-topics ] enabled.<br >
98
+ > Send a message to the bot in a group thread
99
+ > ``` shell
100
+ > export THREAD_ID=$( curl -s " https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN} /getUpdates" | jq -r ' .result[0]|.update_id' )
101
+ > ` ` `
76
102
77
103
< /details>
78
104
@@ -105,6 +131,8 @@ docker build --build-arg RUNNER_VERSION=$RUNNER_VERSION -t runner .
105
131
[ ntfy-setup-basic ] : https://docs.ntfy.sh/install/
106
132
[ ntfy-setup-auth ] : https://community.home-assistant.io/t/setting-up-private-and-secure-ntfy-messaging-for-ha-notifications/632952
107
133
[ BotFather ] : https://t.me/botfather
134
+ [ telegram-topics ] : https://telegram.org/blog/topics-in-groups-collectible-usernames
135
+ [ telegram-threads ] : https://core.telegram.org/api/threads
108
136
109
137
[ #restricting-the-use-of-self-hosted-runners ] : https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#restricting-the-use-of-self-hosted-runners
110
138
[ #self-hosted-runner-security ] : https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#self-hosted-runner-security
0 commit comments