Skip to content

Commit 08b0c52

Browse files
committed
Merge #1297: Refactor packages: extract axum-health-check-api-server package
3e81d3e refactor: [#1287] extract axum-health-check-api-server package (Jose Celano) Pull request description: Refactor packages: extract `axum-health-check-api-server` package. ACKs for top commit: josecelano: ACK 3e81d3e Tree-SHA512: 918775dd14abe6a52e655aecd3fffda32f9e5cd522502b9155c34dcd127a9593c4b6bc6aa6abfa738c34bbc3173a0ef698e2ea5f5eba9a59b9371e5ca3d7348b
2 parents 6415d09 + 3e81d3e commit 08b0c52

File tree

17 files changed

+769
-14
lines changed

17 files changed

+769
-14
lines changed

.github/workflows/deployment.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
cargo publish -p bittorrent-tracker-core
6262
cargo publish -p bittorrent-udp-tracker-core
6363
cargo publish -p bittorrent-udp-tracker-protocol
64+
cargo publish -p torrust-axum-health-check-api-server
6465
cargo publish -p torrust-axum-http-tracker-server
6566
cargo publish -p torrust-axum-server
6667
cargo publish -p torrust-torrust-server-lib
@@ -75,5 +76,3 @@ jobs:
7576
cargo publish -p torrust-tracker-primitives
7677
cargo publish -p torrust-tracker-test-helpers
7778
cargo publish -p torrust-tracker-torrent-repository
78-
79-

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ serde_repr = "0"
7070
serde_with = { version = "3", features = ["json"] }
7171
thiserror = "2"
7272
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
73+
torrust-axum-health-check-api-server = { version = "3.0.0-develop", path = "packages/axum-health-check-api-server" }
7374
torrust-axum-http-tracker-server = { version = "3.0.0-develop", path = "packages/axum-http-tracker-server" }
7475
torrust-axum-server = { version = "3.0.0-develop", path = "packages/axum-server" }
7576
torrust-server-lib = { version = "3.0.0-develop", path = "packages/server-lib" }

cSpell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"gecos",
6464
"Grcov",
6565
"hasher",
66+
"healthcheck",
6667
"heaptrack",
6768
"hexlify",
6869
"hlocalhost",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
authors.workspace = true
3+
description = "The Torrust Bittorrent HTTP tracker."
4+
documentation.workspace = true
5+
edition.workspace = true
6+
homepage.workspace = true
7+
keywords = ["axum", "bittorrent", "healthcheck", "http", "server", "torrust", "tracker"]
8+
license.workspace = true
9+
name = "torrust-axum-health-check-api-server"
10+
publish.workspace = true
11+
readme = "README.md"
12+
repository.workspace = true
13+
rust-version.workspace = true
14+
version.workspace = true
15+
16+
[dependencies]
17+
axum = { version = "0", features = ["macros"] }
18+
axum-server = { version = "0", features = ["tls-rustls-no-provider"] }
19+
futures = "0"
20+
hyper = "1"
21+
serde = { version = "1", features = ["derive"] }
22+
serde_json = { version = "1", features = ["preserve_order"] }
23+
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
24+
torrust-axum-server = { version = "3.0.0-develop", path = "../axum-server" }
25+
torrust-server-lib = { version = "3.0.0-develop", path = "../server-lib" }
26+
tower-http = { version = "0", features = ["compression-full", "cors", "propagate-header", "request-id", "trace"] }
27+
tracing = "0"
28+
29+
[dev-dependencies]

packages/axum-health-check-api-server/LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Torrust Axum HTTP Tracker
2+
3+
The Torrust Tracker Health Check API.
4+
5+
The Torrust tracker container starts a local HTTP server on port 1313 to check all services.
6+
7+
It's used for the container health check.
8+
9+
URL: <http://127.0.0.1:1313/health_check>
10+
11+
Example response:
12+
13+
```json
14+
{
15+
"status": "Ok",
16+
"message": "",
17+
"details": [
18+
{
19+
"binding": "0.0.0.0:6969",
20+
"info": "checking the udp tracker health check at: 0.0.0.0:6969",
21+
"result": {
22+
"Ok": "Connected"
23+
}
24+
},
25+
{
26+
"binding": "0.0.0.0:1212",
27+
"info": "checking api health check at: http://0.0.0.0:1212/api/health_check",
28+
"result": {
29+
"Ok": "200 OK"
30+
}
31+
},
32+
{
33+
"binding": "0.0.0.0:7070",
34+
"info": "checking http tracker health check at: http://0.0.0.0:7070/health_check",
35+
"result": {
36+
"Ok": "200 OK"
37+
}
38+
}
39+
]
40+
}
41+
```
42+
43+
## Documentation
44+
45+
[Crate documentation](https://docs.rs/torrust-axum-health-check-api-server).
46+
47+
## License
48+
49+
The project is licensed under the terms of the [GNU AFFERO GENERAL PUBLIC LICENSE](./LICENSE).

0 commit comments

Comments
 (0)