Watch
0
0
Fork
You've already forked hyperhive
0

seven daemons log through hive-log so the log store gets their severities

This commit is contained in:
maia 2026-11-19 07:26:38 +01:00 • committed by mara
commit b21a3e3632
15 changed files with 21 additions and 74 deletions

14
Cargo.lock generated
View file

@ -1970,6 +1970,7 @@ dependencies = [
"forge-client", "forge-client",
"forgejo-api", "forgejo-api",
"hive-agent-sock", "hive-agent-sock",
"hive-log",
"hive-sock-client", "hive-sock-client",
"reqwest", "reqwest",
"serde", "serde",
@ -1977,7 +1978,6 @@ dependencies = [
"time", "time",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber",
"url", "url",
] ]
@ -2094,6 +2094,7 @@ name = "hive-priv"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"hive-log",
"hive-priv-sock", "hive-priv-sock",
"hive-types", "hive-types",
"libc", "libc",
@ -2102,7 +2103,6 @@ dependencies = [
"serde_json", "serde_json",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber",
] ]
[[package]] [[package]]
@ -5273,6 +5273,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
"hive-log",
"hive-types", "hive-types",
"reqwest", "reqwest",
"rustix", "rustix",
@ -5283,7 +5284,6 @@ dependencies = [
"swarm-secret-client", "swarm-secret-client",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber",
] ]
[[package]] [[package]]
@ -5442,12 +5442,12 @@ dependencies = [
"axum", "axum",
"clap", "clap",
"futures-util", "futures-util",
"hive-log",
"sha2 0.11.1", "sha2 0.11.1",
"swarm-agent-verify", "swarm-agent-verify",
"swarm-secret-client", "swarm-secret-client",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber",
] ]
[[package]] [[package]]
@ -5467,11 +5467,11 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
"hive-log",
"swarm-matrix-client", "swarm-matrix-client",
"swarm-secret-client", "swarm-secret-client",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber",
] ]
[[package]] [[package]]
@ -5495,13 +5495,13 @@ dependencies = [
"axum", "axum",
"chrono", "chrono",
"clap", "clap",
"hive-log",
"mockall", "mockall",
"serde", "serde",
"subtle", "subtle",
"swarm-secret-client", "swarm-secret-client",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber",
] ]
[[package]] [[package]]
@ -5514,6 +5514,7 @@ dependencies = [
"clap", "clap",
"data-encoding", "data-encoding",
"futures-util", "futures-util",
"hive-log",
"nats-jwt", "nats-jwt",
"nkeys", "nkeys",
"reqwest", "reqwest",
@ -5526,7 +5527,6 @@ dependencies = [
"swarm-wire", "swarm-wire",
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber",
] ]
[[package]] [[package]]

View file

@ -19,6 +19,7 @@ backon.workspace = true
forgejo-api.workspace = true forgejo-api.workspace = true
hive-agent-sock.workspace = true hive-agent-sock.workspace = true
forge-client.workspace = true forge-client.workspace = true
hive-log.workspace = true
hive-sock-client.workspace = true hive-sock-client.workspace = true
reqwest.workspace = true reqwest.workspace = true
serde.workspace = true serde.workspace = true
@ -26,7 +27,6 @@ serde_json.workspace = true
time.workspace = true time.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
tracing-subscriber.workspace = true
url.workspace = true url.workspace = true
[dev-dependencies] [dev-dependencies]

View file

@ -50,16 +50,7 @@ pub fn agent_socket() -> std::path::PathBuf {
/// Install the tracing subscriber both binaries use: `RUST_LOG` when set, /// Install the tracing subscriber both binaries use: `RUST_LOG` when set,
/// `info` otherwise. /// `info` otherwise.
pub fn init_tracing() { pub fn init_tracing() {
tracing_subscriber::fmt() hive_log::init();
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_env("RUST_LOG")
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
)
// This is a systemd-managed daemon — stdout always goes to journald,
// never a human terminal, and journald doesn't strip ANSI escapes:
// they land in victorialogs as raw byte-array spam otherwise.
.with_ansi(false)
.init();
} }
/// Read `HYPERHIVE_STATE_DIR`, the directory holding the agent's /// Read `HYPERHIVE_STATE_DIR`, the directory holding the agent's

View file

@ -9,6 +9,7 @@ workspace = true
[dependencies] [dependencies]
anyhow.workspace = true anyhow.workspace = true
hive-log.workspace = true
hive-priv-sock.workspace = true hive-priv-sock.workspace = true
hive-types.workspace = true hive-types.workspace = true
libc.workspace = true libc.workspace = true
@ -16,7 +17,6 @@ rustix.workspace = true
serde_json.workspace = true serde_json.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
tracing-subscriber.workspace = true
[dev-dependencies] [dev-dependencies]
mockall.workspace = true mockall.workspace = true

View file

@ -67,15 +67,7 @@ async fn main() -> Result<()> {
std::process::exit(code); std::process::exit(code);
} }
tracing_subscriber::fmt() hive_log::init();
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()),
)
// This is a systemd-managed daemon — stdout always goes to journald,
// never a human terminal, and journald doesn't strip ANSI escapes:
// they land in victorialogs as raw byte-array spam otherwise.
.with_ansi(false)
.init();
container_config::init_exe()?; container_config::init_exe()?;
let listener = socket_listener()?; let listener = socket_listener()?;

View file

@ -9,6 +9,7 @@ name = "swarm-authelia-bridge"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]
hive-log.workspace = true
hive-types.workspace = true hive-types.workspace = true
anyhow.workspace = true anyhow.workspace = true
axum.workspace = true axum.workspace = true
@ -23,7 +24,6 @@ swarm-authelia-bridge-sock.workspace = true
swarm-secret-client.workspace = true swarm-secret-client.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
tracing-subscriber.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -107,15 +107,7 @@ struct AppState {
#[tokio::main] #[tokio::main]
async fn main() -> Result<()> { async fn main() -> Result<()> {
let stop = swarm_secret_client::shutdown_signal(); let stop = swarm_secret_client::shutdown_signal();
tracing_subscriber::fmt() hive_log::init();
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()),
)
// This is a systemd-managed daemon — stdout always goes to journald,
// never a human terminal, and journald doesn't strip ANSI escapes:
// they land in victorialogs as raw byte-array spam otherwise.
.with_ansi(false)
.init();
let health = swarm_secret_client::health::Health::from_env( let health = swarm_secret_client::health::Health::from_env(
"SWARM_AUTHELIA_BRIDGE_HEALTH_ADDR", "SWARM_AUTHELIA_BRIDGE_HEALTH_ADDR",

View file

@ -11,13 +11,13 @@ path = "src/main.rs"
anyhow.workspace = true anyhow.workspace = true
axum.workspace = true axum.workspace = true
clap.workspace = true clap.workspace = true
hive-log.workspace = true
# The verdict cache's key: a digest of the bearer, never the bearer. # The verdict cache's key: a digest of the bearer, never the bearer.
sha2.workspace = true sha2.workspace = true
swarm-agent-verify.workspace = true swarm-agent-verify.workspace = true
swarm-secret-client.workspace = true swarm-secret-client.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
tracing-subscriber.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -201,14 +201,7 @@ async fn handle(
async fn main() -> anyhow::Result<()> { async fn main() -> anyhow::Result<()> {
let stop = swarm_secret_client::shutdown_signal(); let stop = swarm_secret_client::shutdown_signal();
swarm_secret_client::install_crypto_provider(); swarm_secret_client::install_crypto_provider();
tracing_subscriber::fmt() hive_log::init();
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
)
// stdout is journald, which keeps ANSI escapes as raw bytes.
.with_ansi(false)
.init();
let args = Args::parse(); let args = Args::parse();
let health = swarm_secret_client::health::Health::start( let health = swarm_secret_client::health::Health::start(
swarm_secret_client::health::STALE_AFTER, swarm_secret_client::health::STALE_AFTER,

View file

@ -14,6 +14,7 @@ anyhow.workspace = true
# next thing that has to run in the matrix container is a subcommand here, not a # next thing that has to run in the matrix container is a subcommand here, not a
# new crate. # new crate.
clap.workspace = true clap.workspace = true
hive-log.workspace = true
# The token generator, shared with `swarm-controller`. # The token generator, shared with `swarm-controller`.
swarm-matrix-client.workspace = true swarm-matrix-client.workspace = true
# The agreement this binary is one end of: where the credential lives, what the # The agreement this binary is one end of: where the credential lives, what the
@ -21,7 +22,6 @@ swarm-matrix-client.workspace = true
swarm-secret-client.workspace = true swarm-secret-client.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
tracing-subscriber.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -51,12 +51,7 @@ enum Appservice {
#[tokio::main] #[tokio::main]
async fn main() -> Result<()> { async fn main() -> Result<()> {
tracing_subscriber::fmt() hive_log::init();
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
)
.init();
match Cli::parse().command { match Cli::parse().command {
Command::Appservice(Appservice::Render) => appservice::render().await, Command::Appservice(Appservice::Render) => appservice::render().await,

View file

@ -13,13 +13,13 @@ axum.workspace = true
# The read time in the fallback log line. # The read time in the fallback log line.
chrono.workspace = true chrono.workspace = true
clap.workspace = true clap.workspace = true
hive-log.workspace = true
serde.workspace = true serde.workspace = true
# Comparing the presented bearer with the stored one. # Comparing the presented bearer with the stored one.
subtle.workspace = true subtle.workspace = true
swarm-secret-client.workspace = true swarm-secret-client.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
tracing-subscriber.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -288,14 +288,7 @@ async fn handle(State(responder): State<Arc<Responder<Store>>>, headers: HeaderM
async fn main() -> anyhow::Result<()> { async fn main() -> anyhow::Result<()> {
let stop = swarm_secret_client::shutdown_signal(); let stop = swarm_secret_client::shutdown_signal();
swarm_secret_client::install_crypto_provider(); swarm_secret_client::install_crypto_provider();
tracing_subscriber::fmt() hive_log::init();
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
)
// stdout is journald, which keeps ANSI escapes as raw bytes.
.with_ansi(false)
.init();
let args = Args::parse(); let args = Args::parse();
let health = swarm_secret_client::health::Health::start( let health = swarm_secret_client::health::Health::start(
swarm_secret_client::health::STALE_AFTER, swarm_secret_client::health::STALE_AFTER,

View file

@ -16,6 +16,7 @@ clap.workspace = true
data-encoding.workspace = true data-encoding.workspace = true
# StreamExt::next on the subscription: async-nats returns a Stream. # StreamExt::next on the subscription: async-nats returns a Stream.
futures-util.workspace = true futures-util.workspace = true
hive-log.workspace = true
# `xkeys` for the callout xkey: opening sealed requests and sealing replies. # `xkeys` for the callout xkey: opening sealed requests and sealing replies.
nkeys = { workspace = true, features = ["xkeys"] } nkeys = { workspace = true, features = ["xkeys"] }
reqwest.workspace = true reqwest.workspace = true
@ -36,7 +37,6 @@ swarm-agent-verify.workspace = true
swarm-wire.workspace = true swarm-wire.workspace = true
tokio.workspace = true tokio.workspace = true
tracing.workspace = true tracing.workspace = true
tracing-subscriber.workspace = true
[dev-dependencies] [dev-dependencies]
# A loopback stand-in `IdP` for `oidc_secret`'s test of a non-2xx # A loopback stand-in `IdP` for `oidc_secret`'s test of a non-2xx

View file

@ -189,16 +189,7 @@ struct Args {
async fn main() -> anyhow::Result<()> { async fn main() -> anyhow::Result<()> {
let stop = swarm_secret_client::shutdown_signal(); let stop = swarm_secret_client::shutdown_signal();
swarm_secret_client::install_crypto_provider(); swarm_secret_client::install_crypto_provider();
tracing_subscriber::fmt() hive_log::init();
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
)
// This is a systemd-managed daemon — stdout always goes to journald,
// never a human terminal, and journald doesn't strip ANSI escapes:
// they land in victorialogs as raw byte-array spam otherwise.
.with_ansi(false)
.init();
let cli = Cli::parse(); let cli = Cli::parse();
match (cli.command, cli.responder) { match (cli.command, cli.responder) {
( (