This commit is contained in:
Tom Alexander 2024-07-20 12:10:32 -04:00
parent 7e44e5da4a
commit a6000833b2
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 25 additions and 23 deletions

View File

@ -46,7 +46,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
TimeoutLayer::new(Duration::from_secs(600)),
));
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await?;
let listener = tokio::net::TcpListener::bind("0.0.0.0:9988").await?;
tracing::info!("listening on {}", listener.local_addr().unwrap());
axum::serve(listener, app)
.with_graceful_shutdown(shutdown_signal())

View File

@ -9,14 +9,14 @@ function main() {
payload=$(cat <<EOF
{
"ref": "refs/heads/main",
"before": "25c06cbffd1cd2b372e790732bc8566e575a7f01",
"after": "8fb5a83e8672cf9c317087b70cef329cb604eeed",
"compare_url": "https://code.fizz.buzz/talexander/webhook_bridge/compare/25c06cbffd1cd2b372e790732bc8566e575a7f01...8fb5a83e8672cf9c317087b70cef329cb604eeed",
"before": "2a544017179b6bd125deacb7919566e8b62e73ea",
"after": "7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
"compare_url": "https://code.fizz.buzz/talexander/webhook_bridge/compare/2a544017179b6bd125deacb7919566e8b62e73ea...7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
"commits": [
{
"id": "8fb5a83e8672cf9c317087b70cef329cb604eeed",
"message": "Access log.\n",
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/8fb5a83e8672cf9c317087b70cef329cb604eeed",
"id": "7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
"message": "Add signature verification middleware.\n",
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
"author": {
"name": "Tom Alexander",
"email": "tom@fizz.buzz",
@ -28,21 +28,22 @@ function main() {
"username": ""
},
"verification": null,
"timestamp": "2024-07-14T15:50:13-04:00",
"timestamp": "2024-07-15T21:02:30-04:00",
"added": [],
"removed": [],
"modified": [
"Cargo.lock",
"Cargo.toml",
"src/main.rs"
"src/main.rs",
"src/webhook.rs"
]
}
],
"total_commits": 1,
"head_commit": {
"id": "8fb5a83e8672cf9c317087b70cef329cb604eeed",
"message": "Access log.\n",
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/8fb5a83e8672cf9c317087b70cef329cb604eeed",
"id": "7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
"message": "Add signature verification middleware.\n",
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
"author": {
"name": "Tom Alexander",
"email": "tom@fizz.buzz",
@ -54,13 +55,14 @@ function main() {
"username": ""
},
"verification": null,
"timestamp": "2024-07-14T15:50:13-04:00",
"timestamp": "2024-07-15T21:02:30-04:00",
"added": [],
"removed": [],
"modified": [
"Cargo.lock",
"Cargo.toml",
"src/main.rs"
"src/main.rs",
"src/webhook.rs"
]
},
"repository": {
@ -97,7 +99,7 @@ function main() {
"template": false,
"parent": null,
"mirror": false,
"size": 45,
"size": 103,
"language": "",
"languages_url": "https://code.fizz.buzz/api/v1/repos/talexander/webhook_bridge/languages",
"html_url": "https://code.fizz.buzz/talexander/webhook_bridge",
@ -116,7 +118,7 @@ function main() {
"default_branch": "main",
"archived": false,
"created_at": "2024-07-14T18:48:52Z",
"updated_at": "2024-07-14T19:43:45Z",
"updated_at": "2024-07-15T03:11:13Z",
"archived_at": "1970-01-01T00:00:00Z",
"permissions": {
"admin": true,
@ -204,19 +206,19 @@ curl -v \
--http2-prior-knowledge \
-X POST \
-H 'Content-Type: application/json' \
-H 'X-GitHub-Delivery: 2187f277-1104-4011-845b-a88a5a98731f' \
-H 'X-GitHub-Delivery: 04036b0e-6660-4761-896e-e2b6a7631a22' \
-H 'X-GitHub-Event: push' \
-H 'X-GitHub-Event-Type: push' \
-H 'X-Gitea-Delivery: 2187f277-1104-4011-845b-a88a5a98731f' \
-H 'X-Gitea-Delivery: 04036b0e-6660-4761-896e-e2b6a7631a22' \
-H 'X-Gitea-Event: push' \
-H 'X-Gitea-Event-Type: push' \
-H 'X-Gitea-Signature: 5f5ca80269a5cebd41c3ef2de547b86c40b35418fbefc9f59459602435d2d9ea' \
-H 'X-Gogs-Delivery: 2187f277-1104-4011-845b-a88a5a98731f' \
-H 'X-Gitea-Signature: ea67493aae634655aed55474e6df6d075f7d5f48c35542c9d5fa5c56f5ed9e79' \
-H 'X-Gogs-Delivery: 04036b0e-6660-4761-896e-e2b6a7631a22' \
-H 'X-Gogs-Event: push' \
-H 'X-Gogs-Event-Type: push' \
-H 'X-Gogs-Signature: 5f5ca80269a5cebd41c3ef2de547b86c40b35418fbefc9f59459602435d2d9ea' \
-H 'X-Hub-Signature: sha1=6e13417e9a9ce53fc08a684635350aa2c60ce7bc' \
-H 'X-Hub-Signature-256: sha256=5f5ca80269a5cebd41c3ef2de547b86c40b35418fbefc9f59459602435d2d9ea' \
-H 'X-Gogs-Signature: ea67493aae634655aed55474e6df6d075f7d5f48c35542c9d5fa5c56f5ed9e79' \
-H 'X-Hub-Signature: sha1=291432b9e22fe0dbdb8c809e4f5c5557fbdd48d8' \
-H 'X-Hub-Signature-256: sha256=ea67493aae634655aed55474e6df6d075f7d5f48c35542c9d5fa5c56f5ed9e79' \
-d @- \
'http://127.0.0.1:8080/hook' <<<"$payload"
}