Skip to content

Commit ff8bf0f

Browse files
committed
feat(trogon-sink-github): GitHub webhook receiver → NATS JetStream
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
1 parent c70081c commit ff8bf0f

File tree

13 files changed

+1372
-85
lines changed

13 files changed

+1372
-85
lines changed

devops/docker/compose/compose.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,49 @@ services:
44
nats:
55
image: nats:latest
66
container_name: nats
7-
command:
7+
command:
88
- "--jetstream"
99
- "--store_dir=/data"
10+
- "--http_port=8222"
11+
ports:
12+
- "4222:4222"
13+
- "8222:8222"
1014
volumes:
1115
- nats_data:/data
16+
restart: unless-stopped
17+
healthcheck:
18+
test: ["CMD", "wget", "-qO-", "http://localhost:8222/healthz"]
19+
interval: 5s
20+
timeout: 3s
21+
start_period: 5s
22+
retries: 3
23+
24+
trogon-sink-github:
25+
build:
26+
context: ../../../rsworkspace
27+
dockerfile: crates/trogon-sink-github/Dockerfile
28+
ports:
29+
- "${GITHUB_WEBHOOK_PORT:-8080}:${GITHUB_WEBHOOK_PORT:-8080}"
30+
environment:
31+
NATS_URL: "nats:4222"
32+
GITHUB_WEBHOOK_SECRET: "${GITHUB_WEBHOOK_SECRET}"
33+
GITHUB_WEBHOOK_PORT: "${GITHUB_WEBHOOK_PORT:-8080}"
34+
GITHUB_SUBJECT_PREFIX: "${GITHUB_SUBJECT_PREFIX:-github}"
35+
GITHUB_STREAM_NAME: "${GITHUB_STREAM_NAME:-GITHUB}"
36+
GITHUB_STREAM_MAX_AGE_SECS: "${GITHUB_STREAM_MAX_AGE_SECS:-604800}"
37+
GITHUB_NATS_ACK_TIMEOUT_SECS: "${GITHUB_NATS_ACK_TIMEOUT_SECS:-10}"
38+
GITHUB_MAX_BODY_SIZE: "${GITHUB_MAX_BODY_SIZE:-26214400}"
39+
RUST_LOG: "${RUST_LOG:-info}"
40+
depends_on:
41+
nats:
42+
condition: service_healthy
43+
restart: unless-stopped
44+
healthcheck:
45+
test: ["CMD", "curl", "-sf", "http://localhost:${GITHUB_WEBHOOK_PORT:-8080}/health"]
46+
interval: 10s
47+
timeout: 3s
48+
start_period: 10s
49+
retries: 3
1250

1351
volumes:
1452
nats_data:

rsworkspace/.dockerignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Rust build artifacts — largest offender, can be many GBs
2+
target/
3+
4+
# Dev tooling
5+
.git/
6+
.github/
7+
.cargo/
8+
9+
# Test/CI artifacts
10+
lcov.info
11+
coverage.xml
12+
*.profraw
13+
*.profdata
14+
mutants.out*/
15+
16+
# IDE / OS
17+
.idea/
18+
.vscode/
19+
.DS_Store
20+
Thumbs.db
21+
*.swp
22+
*.swo
23+
24+
# Environment files with secrets
25+
.env
26+
.env.*
27+
!.env.example

0 commit comments

Comments
 (0)