seven daemons log through hive-log so the log store gets their severities
This commit is contained in:
parent
c7d37ca455
commit
b21a3e3632
15 changed files with 21 additions and 74 deletions
14
Cargo.lock
generated
14
Cargo.lock
generated
|
|
@ -1970,6 +1970,7 @@ dependencies = [
|
|||
"forge-client",
|
||||
"forgejo-api",
|
||||
"hive-agent-sock",
|
||||
"hive-log",
|
||||
"hive-sock-client",
|
||||
"reqwest",
|
||||
"serde",
|
||||
|
|
@ -1977,7 +1978,6 @@ dependencies = [
|
|||
"time",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
]
|
||||
|
||||
|
|
@ -2094,6 +2094,7 @@ name = "hive-priv"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"hive-log",
|
||||
"hive-priv-sock",
|
||||
"hive-types",
|
||||
"libc",
|
||||
|
|
@ -2102,7 +2103,6 @@ dependencies = [
|
|||
"serde_json",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5273,6 +5273,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
"hive-log",
|
||||
"hive-types",
|
||||
"reqwest",
|
||||
"rustix",
|
||||
|
|
@ -5283,7 +5284,6 @@ dependencies = [
|
|||
"swarm-secret-client",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5442,12 +5442,12 @@ dependencies = [
|
|||
"axum",
|
||||
"clap",
|
||||
"futures-util",
|
||||
"hive-log",
|
||||
"sha2 0.11.1",
|
||||
"swarm-agent-verify",
|
||||
"swarm-secret-client",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5467,11 +5467,11 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"hive-log",
|
||||
"swarm-matrix-client",
|
||||
"swarm-secret-client",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5495,13 +5495,13 @@ dependencies = [
|
|||
"axum",
|
||||
"chrono",
|
||||
"clap",
|
||||
"hive-log",
|
||||
"mockall",
|
||||
"serde",
|
||||
"subtle",
|
||||
"swarm-secret-client",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5514,6 +5514,7 @@ dependencies = [
|
|||
"clap",
|
||||
"data-encoding",
|
||||
"futures-util",
|
||||
"hive-log",
|
||||
"nats-jwt",
|
||||
"nkeys",
|
||||
"reqwest",
|
||||
|
|
@ -5526,7 +5527,6 @@ dependencies = [
|
|||
"swarm-wire",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ backon.workspace = true
|
|||
forgejo-api.workspace = true
|
||||
hive-agent-sock.workspace = true
|
||||
forge-client.workspace = true
|
||||
hive-log.workspace = true
|
||||
hive-sock-client.workspace = true
|
||||
reqwest.workspace = true
|
||||
serde.workspace = true
|
||||
|
|
@ -26,7 +27,6 @@ serde_json.workspace = true
|
|||
time.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
url.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
|||
|
|
@ -50,16 +50,7 @@ pub fn agent_socket() -> std::path::PathBuf {
|
|||
/// Install the tracing subscriber both binaries use: `RUST_LOG` when set,
|
||||
/// `info` otherwise.
|
||||
pub fn init_tracing() {
|
||||
tracing_subscriber::fmt()
|
||||
.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();
|
||||
hive_log::init();
|
||||
}
|
||||
|
||||
/// Read `HYPERHIVE_STATE_DIR`, the directory holding the agent's
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ workspace = true
|
|||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
hive-log.workspace = true
|
||||
hive-priv-sock.workspace = true
|
||||
hive-types.workspace = true
|
||||
libc.workspace = true
|
||||
|
|
@ -16,7 +17,6 @@ rustix.workspace = true
|
|||
serde_json.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
mockall.workspace = true
|
||||
|
|
|
|||
|
|
@ -67,15 +67,7 @@ async fn main() -> Result<()> {
|
|||
std::process::exit(code);
|
||||
}
|
||||
|
||||
tracing_subscriber::fmt()
|
||||
.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();
|
||||
hive_log::init();
|
||||
container_config::init_exe()?;
|
||||
|
||||
let listener = socket_listener()?;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ name = "swarm-authelia-bridge"
|
|||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
hive-log.workspace = true
|
||||
hive-types.workspace = true
|
||||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
|
|
@ -23,7 +24,6 @@ swarm-authelia-bridge-sock.workspace = true
|
|||
swarm-secret-client.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
|
|
@ -107,15 +107,7 @@ struct AppState {
|
|||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let stop = swarm_secret_client::shutdown_signal();
|
||||
tracing_subscriber::fmt()
|
||||
.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();
|
||||
hive_log::init();
|
||||
|
||||
let health = swarm_secret_client::health::Health::from_env(
|
||||
"SWARM_AUTHELIA_BRIDGE_HEALTH_ADDR",
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ path = "src/main.rs"
|
|||
anyhow.workspace = true
|
||||
axum.workspace = true
|
||||
clap.workspace = true
|
||||
hive-log.workspace = true
|
||||
# The verdict cache's key: a digest of the bearer, never the bearer.
|
||||
sha2.workspace = true
|
||||
swarm-agent-verify.workspace = true
|
||||
swarm-secret-client.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
|
|
@ -201,14 +201,7 @@ async fn handle(
|
|||
async fn main() -> anyhow::Result<()> {
|
||||
let stop = swarm_secret_client::shutdown_signal();
|
||||
swarm_secret_client::install_crypto_provider();
|
||||
tracing_subscriber::fmt()
|
||||
.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();
|
||||
hive_log::init();
|
||||
let args = Args::parse();
|
||||
let health = swarm_secret_client::health::Health::start(
|
||||
swarm_secret_client::health::STALE_AFTER,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ anyhow.workspace = true
|
|||
# next thing that has to run in the matrix container is a subcommand here, not a
|
||||
# new crate.
|
||||
clap.workspace = true
|
||||
hive-log.workspace = true
|
||||
# The token generator, shared with `swarm-controller`.
|
||||
swarm-matrix-client.workspace = true
|
||||
# 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
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
|
|
@ -51,12 +51,7 @@ enum Appservice {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(
|
||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||
)
|
||||
.init();
|
||||
hive_log::init();
|
||||
|
||||
match Cli::parse().command {
|
||||
Command::Appservice(Appservice::Render) => appservice::render().await,
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ axum.workspace = true
|
|||
# The read time in the fallback log line.
|
||||
chrono.workspace = true
|
||||
clap.workspace = true
|
||||
hive-log.workspace = true
|
||||
serde.workspace = true
|
||||
# Comparing the presented bearer with the stored one.
|
||||
subtle.workspace = true
|
||||
swarm-secret-client.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
|
|
@ -288,14 +288,7 @@ async fn handle(State(responder): State<Arc<Responder<Store>>>, headers: HeaderM
|
|||
async fn main() -> anyhow::Result<()> {
|
||||
let stop = swarm_secret_client::shutdown_signal();
|
||||
swarm_secret_client::install_crypto_provider();
|
||||
tracing_subscriber::fmt()
|
||||
.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();
|
||||
hive_log::init();
|
||||
let args = Args::parse();
|
||||
let health = swarm_secret_client::health::Health::start(
|
||||
swarm_secret_client::health::STALE_AFTER,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ clap.workspace = true
|
|||
data-encoding.workspace = true
|
||||
# StreamExt::next on the subscription: async-nats returns a Stream.
|
||||
futures-util.workspace = true
|
||||
hive-log.workspace = true
|
||||
# `xkeys` for the callout xkey: opening sealed requests and sealing replies.
|
||||
nkeys = { workspace = true, features = ["xkeys"] }
|
||||
reqwest.workspace = true
|
||||
|
|
@ -36,7 +37,6 @@ swarm-agent-verify.workspace = true
|
|||
swarm-wire.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
# A loopback stand-in `IdP` for `oidc_secret`'s test of a non-2xx
|
||||
|
|
|
|||
|
|
@ -189,16 +189,7 @@ struct Args {
|
|||
async fn main() -> anyhow::Result<()> {
|
||||
let stop = swarm_secret_client::shutdown_signal();
|
||||
swarm_secret_client::install_crypto_provider();
|
||||
tracing_subscriber::fmt()
|
||||
.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();
|
||||
hive_log::init();
|
||||
let cli = Cli::parse();
|
||||
match (cli.command, cli.responder) {
|
||||
(
|
||||
|
|
|
|||
Loading…
Reference in a new issue