@@ -30,31 +30,51 @@ docker compose up -d
3030- ** LABELS** - Runner labels (comma separated). Uses ` "docker-node,${os_name}-${architecture}" `
3131- ** REUSE_EXISTING** - Re-use existing configuration. Defaults to ` false `
3232
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>
3557
3658> [!WARNING]
3759Using this image **without** the env var `GIT_REPOSITORY` will create an organization level runner.
3860Using self-hosted runners in public repositories pose some considerable security threats.
3961> - [#self-hosted-runner-security]
4062> - [#restricting-the-use-of-self-hosted-runners]
4163> - [#configuring-required-approval-for-workflows-from-public-forks]
42- >
43- > ** Author Note:** _ Be mindful of the env vars you set when spinning up containers_
4464
4565<details>
46- <summary ><strong >Env vars for startup notifications</strong ></summary >
66+ <summary><strong>Env vars for notifications</strong></summary>
4767
48- > This project supports [ ntfy] and [ telegram bot] for startup notifications.
68+ > This project supports [ntfy] and [telegram bot] for startup/shutdown notifications.
4969
5070**NTFY**
5171
5272Choose ntfy setup instructions with [basic][ntfy-setup-basic] **OR** [authentication][ntfy-setup-auth] abilities
5373
54- - ** NTFY_USERNAME** - Ntfy username for authentication _ (if topic is protected)_
55- - ** NTFY_PASSWORD** - Ntfy password for authentication _ (if topic is protected)_
5674- **NTFY_URL** - Ntfy endpoint for notifications.
5775- **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)_
5878
5979**Telegram**
6080
@@ -63,16 +83,22 @@ Steps for telegram bot configuration
63831. Use [BotFather] to create a telegram bot token
64842. Send a test message to the Telegram bot you created
65853. 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
6787
6888```shell
6989export TELEGRAM_BOT_TOKEN="your-bot-token"
7090export 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' )
7291```
7392
7493- ** TELEGRAM_BOT_TOKEN** - Telegram Bot token
7594- ** 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+ > ` ` `
76102
77103< /details>
78104
@@ -105,6 +131,8 @@ docker build --build-arg RUNNER_VERSION=$RUNNER_VERSION -t runner .
105131[ ntfy-setup-basic ] : https://docs.ntfy.sh/install/
106132[ ntfy-setup-auth ] : https://community.home-assistant.io/t/setting-up-private-and-secure-ntfy-messaging-for-ha-notifications/632952
107133[ 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
108136
109137[ #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
110138[ #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