Skip to content

Commit 7a550b7

Browse files
Correctly handle GitHub ping & bump dependencies
1 parent 8dac770 commit 7a550b7

5 files changed

Lines changed: 23 additions & 21 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The app can be started using the following `compose.yml`:
3939
services:
4040
containers-up:
4141
# https://github.com/DigitallyRefined/containers-up/releases
42-
image: ghcr.io/digitallyrefined/containers-up:1.4.0
42+
image: ghcr.io/digitallyrefined/containers-up:1.4.1
4343
restart: unless-stopped
4444
ports:
4545
- 3000:3000
@@ -63,7 +63,7 @@ Optional system wide configuration can be changed by copying `.env.default` to `
6363
services:
6464
containers-up:
6565
# https://github.com/DigitallyRefined/containers-up/releases
66-
image: ghcr.io/digitallyrefined/containers-up:1.4.0
66+
image: ghcr.io/digitallyrefined/containers-up:1.4.1
6767
restart: unless-stopped
6868
volumes:
6969
- ./containers-up/storage:/storage

bun.lock

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
containers-up:
33
# https://github.com/DigitallyRefined/containers-up/releases
4-
image: ghcr.io/digitallyrefined/containers-up:1.4.0
4+
image: ghcr.io/digitallyrefined/containers-up:1.4.1
55
container_name: containers-up
66
restart: unless-stopped
77
volumes:

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "containers-up",
3-
"version": "1.3.8",
3+
"version": "1.4.1",
44
"description": "Containers Up! a web based platform designed to manage and update containers",
55
"author": "DigitallyRefined",
66
"license": "ISC",
@@ -51,7 +51,7 @@
5151
"devDependencies": {
5252
"@biomejs/biome": "2.3.13",
5353
"@tailwindcss/cli": "^4.1.18",
54-
"@types/bun": "^1.3.6",
54+
"@types/bun": "^1.3.7",
5555
"@types/pino": "^7.0.5",
5656
"@types/pino-pretty": "^5.0.0",
5757
"@types/react": "^19.2.10",

src/backend/endpoints/webhook/request-handler.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ export const handleWebhookRequest = async (
4343
return new Response('Unauthorized (bad signature)', { status: 401 });
4444
}
4545

46+
const eventType = req.headers.get('X-GitHub-Event');
47+
if (eventType === 'ping') {
48+
const msg = `${options.name} webhook ping received for host: ${selectedHost.name}`;
49+
mainLogger.info(msg);
50+
logDb.create({
51+
hostId: selectedHost.id,
52+
level: 30,
53+
time: Date.now(),
54+
event: `${options.name} webhook ping`,
55+
msg,
56+
});
57+
return Response.json({ message: 'webhook ping received' });
58+
}
59+
4660
const json = new TextDecoder().decode(bodyBuffer);
4761
let webhookData: Record<string, any> | undefined;
4862
if (!json) {
@@ -51,19 +65,6 @@ export const handleWebhookRequest = async (
5165
try {
5266
webhookData = JSON.parse(json);
5367
} catch {
54-
// Basic ping check for GitHub
55-
if (json.includes('Speak+like+a+human')) {
56-
const msg = `${options.name} webhook ping received for host: ${selectedHost.name}`;
57-
mainLogger.info(msg);
58-
logDb.create({
59-
hostId: selectedHost.id,
60-
level: 30,
61-
time: Date.now(),
62-
event: `${options.name} webhook ping`,
63-
msg,
64-
});
65-
return Response.json({ message: 'webhook ping received' });
66-
}
6768
return Response.json({ message: 'Invalid JSON payload', json }, { status: 400 });
6869
}
6970

0 commit comments

Comments
 (0)