wip
This commit is contained in:
parent
7e44e5da4a
commit
a6000833b2
|
@ -46,7 +46,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
TimeoutLayer::new(Duration::from_secs(600)),
|
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());
|
tracing::info!("listening on {}", listener.local_addr().unwrap());
|
||||||
axum::serve(listener, app)
|
axum::serve(listener, app)
|
||||||
.with_graceful_shutdown(shutdown_signal())
|
.with_graceful_shutdown(shutdown_signal())
|
||||||
|
|
|
@ -9,14 +9,14 @@ function main() {
|
||||||
payload=$(cat <<EOF
|
payload=$(cat <<EOF
|
||||||
{
|
{
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"before": "25c06cbffd1cd2b372e790732bc8566e575a7f01",
|
"before": "2a544017179b6bd125deacb7919566e8b62e73ea",
|
||||||
"after": "8fb5a83e8672cf9c317087b70cef329cb604eeed",
|
"after": "7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
|
||||||
"compare_url": "https://code.fizz.buzz/talexander/webhook_bridge/compare/25c06cbffd1cd2b372e790732bc8566e575a7f01...8fb5a83e8672cf9c317087b70cef329cb604eeed",
|
"compare_url": "https://code.fizz.buzz/talexander/webhook_bridge/compare/2a544017179b6bd125deacb7919566e8b62e73ea...7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
|
||||||
"commits": [
|
"commits": [
|
||||||
{
|
{
|
||||||
"id": "8fb5a83e8672cf9c317087b70cef329cb604eeed",
|
"id": "7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
|
||||||
"message": "Access log.\n",
|
"message": "Add signature verification middleware.\n",
|
||||||
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/8fb5a83e8672cf9c317087b70cef329cb604eeed",
|
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Tom Alexander",
|
"name": "Tom Alexander",
|
||||||
"email": "tom@fizz.buzz",
|
"email": "tom@fizz.buzz",
|
||||||
|
@ -28,21 +28,22 @@ function main() {
|
||||||
"username": ""
|
"username": ""
|
||||||
},
|
},
|
||||||
"verification": null,
|
"verification": null,
|
||||||
"timestamp": "2024-07-14T15:50:13-04:00",
|
"timestamp": "2024-07-15T21:02:30-04:00",
|
||||||
"added": [],
|
"added": [],
|
||||||
"removed": [],
|
"removed": [],
|
||||||
"modified": [
|
"modified": [
|
||||||
"Cargo.lock",
|
"Cargo.lock",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
"src/main.rs"
|
"src/main.rs",
|
||||||
|
"src/webhook.rs"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"total_commits": 1,
|
"total_commits": 1,
|
||||||
"head_commit": {
|
"head_commit": {
|
||||||
"id": "8fb5a83e8672cf9c317087b70cef329cb604eeed",
|
"id": "7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
|
||||||
"message": "Access log.\n",
|
"message": "Add signature verification middleware.\n",
|
||||||
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/8fb5a83e8672cf9c317087b70cef329cb604eeed",
|
"url": "https://code.fizz.buzz/talexander/webhook_bridge/commit/7e44e5da4af3fe7e3db39f43d4d7be5b7e92170d",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Tom Alexander",
|
"name": "Tom Alexander",
|
||||||
"email": "tom@fizz.buzz",
|
"email": "tom@fizz.buzz",
|
||||||
|
@ -54,13 +55,14 @@ function main() {
|
||||||
"username": ""
|
"username": ""
|
||||||
},
|
},
|
||||||
"verification": null,
|
"verification": null,
|
||||||
"timestamp": "2024-07-14T15:50:13-04:00",
|
"timestamp": "2024-07-15T21:02:30-04:00",
|
||||||
"added": [],
|
"added": [],
|
||||||
"removed": [],
|
"removed": [],
|
||||||
"modified": [
|
"modified": [
|
||||||
"Cargo.lock",
|
"Cargo.lock",
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
"src/main.rs"
|
"src/main.rs",
|
||||||
|
"src/webhook.rs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -97,7 +99,7 @@ function main() {
|
||||||
"template": false,
|
"template": false,
|
||||||
"parent": null,
|
"parent": null,
|
||||||
"mirror": false,
|
"mirror": false,
|
||||||
"size": 45,
|
"size": 103,
|
||||||
"language": "",
|
"language": "",
|
||||||
"languages_url": "https://code.fizz.buzz/api/v1/repos/talexander/webhook_bridge/languages",
|
"languages_url": "https://code.fizz.buzz/api/v1/repos/talexander/webhook_bridge/languages",
|
||||||
"html_url": "https://code.fizz.buzz/talexander/webhook_bridge",
|
"html_url": "https://code.fizz.buzz/talexander/webhook_bridge",
|
||||||
|
@ -116,7 +118,7 @@ function main() {
|
||||||
"default_branch": "main",
|
"default_branch": "main",
|
||||||
"archived": false,
|
"archived": false,
|
||||||
"created_at": "2024-07-14T18:48:52Z",
|
"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",
|
"archived_at": "1970-01-01T00:00:00Z",
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"admin": true,
|
"admin": true,
|
||||||
|
@ -204,19 +206,19 @@ curl -v \
|
||||||
--http2-prior-knowledge \
|
--http2-prior-knowledge \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H 'Content-Type: application/json' \
|
-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: push' \
|
||||||
-H 'X-GitHub-Event-Type: 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: push' \
|
||||||
-H 'X-Gitea-Event-Type: push' \
|
-H 'X-Gitea-Event-Type: push' \
|
||||||
-H 'X-Gitea-Signature: 5f5ca80269a5cebd41c3ef2de547b86c40b35418fbefc9f59459602435d2d9ea' \
|
-H 'X-Gitea-Signature: ea67493aae634655aed55474e6df6d075f7d5f48c35542c9d5fa5c56f5ed9e79' \
|
||||||
-H 'X-Gogs-Delivery: 2187f277-1104-4011-845b-a88a5a98731f' \
|
-H 'X-Gogs-Delivery: 04036b0e-6660-4761-896e-e2b6a7631a22' \
|
||||||
-H 'X-Gogs-Event: push' \
|
-H 'X-Gogs-Event: push' \
|
||||||
-H 'X-Gogs-Event-Type: push' \
|
-H 'X-Gogs-Event-Type: push' \
|
||||||
-H 'X-Gogs-Signature: 5f5ca80269a5cebd41c3ef2de547b86c40b35418fbefc9f59459602435d2d9ea' \
|
-H 'X-Gogs-Signature: ea67493aae634655aed55474e6df6d075f7d5f48c35542c9d5fa5c56f5ed9e79' \
|
||||||
-H 'X-Hub-Signature: sha1=6e13417e9a9ce53fc08a684635350aa2c60ce7bc' \
|
-H 'X-Hub-Signature: sha1=291432b9e22fe0dbdb8c809e4f5c5557fbdd48d8' \
|
||||||
-H 'X-Hub-Signature-256: sha256=5f5ca80269a5cebd41c3ef2de547b86c40b35418fbefc9f59459602435d2d9ea' \
|
-H 'X-Hub-Signature-256: sha256=ea67493aae634655aed55474e6df6d075f7d5f48c35542c9d5fa5c56f5ed9e79' \
|
||||||
-d @- \
|
-d @- \
|
||||||
'http://127.0.0.1:8080/hook' <<<"$payload"
|
'http://127.0.0.1:8080/hook' <<<"$payload"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue