Build static musl OCSP image in Gitea Actions
This commit is contained in:
@@ -75,7 +75,18 @@ async fn health() -> &'static str {
|
||||
|
||||
fn healthcheck() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
use std::io::{Read, Write};
|
||||
let mut stream = std::net::TcpStream::connect("127.0.0.1:2560")?;
|
||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||
let config = config::load_config()?;
|
||||
let host = if config.listen.ip().is_unspecified() {
|
||||
match config.listen.ip() {
|
||||
IpAddr::V4(_) => IpAddr::V4(Ipv4Addr::LOCALHOST),
|
||||
IpAddr::V6(_) => IpAddr::V6(std::net::Ipv6Addr::LOCALHOST),
|
||||
}
|
||||
} else {
|
||||
config.listen.ip()
|
||||
};
|
||||
let socket = SocketAddr::new(host, config.listen.port());
|
||||
let mut stream = std::net::TcpStream::connect(socket)?;
|
||||
stream.write_all(b"GET /healthz HTTP/1.0\r\nHost: localhost\r\n\r\n")?;
|
||||
let mut response = String::new();
|
||||
stream.read_to_string(&mut response)?;
|
||||
|
||||
@@ -46,12 +46,12 @@ impl ObjectStore for StatusStore {
|
||||
.key(key)
|
||||
.send()
|
||||
.await
|
||||
.map_err(|error| StoreError::S3(error.to_string()))?;
|
||||
.map_err(|error| StoreError::S3(format!("{error:?}")))?;
|
||||
let data = response
|
||||
.body
|
||||
.collect()
|
||||
.await
|
||||
.map_err(|error| StoreError::S3(error.to_string()))?
|
||||
.map_err(|error| StoreError::S3(format!("{error:?}")))?
|
||||
.into_bytes();
|
||||
Ok(data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user