zap-stream-core/src/settings.rs

58 lines
1.5 KiB
Rust
Raw Normal View History

2024-03-20 22:46:19 +00:00
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Settings {
/// List of listen endpoints
///
/// - srt://localhost:3333
/// - tcp://localhost:3334
/// - rtmp://localhost:1935
pub endpoints: Vec<String>,
2024-11-15 15:54:51 +00:00
/// Where to store output (static files)
2024-03-20 22:46:19 +00:00
pub output_dir: String,
2024-11-18 16:05:25 +00:00
/// Public facing URL that maps to [output_dir]
pub public_url: String,
/// Binding address for http server serving files from [output_dir]
pub listen_http: String,
2024-11-15 15:54:51 +00:00
/// Overseer service see [crate::overseer::Overseer] for more info
pub overseer: OverseerConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum OverseerConfig {
/// Static output
2024-11-22 16:54:32 +00:00
Local,
2024-11-15 15:54:51 +00:00
/// Control system via external API
Webhook {
/// Webhook service URL
url: String,
},
/// NIP-53 service (i.e. zap.stream backend)
ZapStream {
2024-11-18 16:05:25 +00:00
/// MYSQL database connection string
2024-11-15 15:54:51 +00:00
database: String,
2024-11-18 16:05:25 +00:00
/// LND node connection details
2024-11-15 15:54:51 +00:00
lnd: LndSettings,
2024-11-18 16:05:25 +00:00
/// Relays to publish events to
2024-11-15 15:54:51 +00:00
relays: Vec<String>,
2024-11-18 16:05:25 +00:00
/// Nsec to sign nostr events
2024-11-15 15:54:51 +00:00
nsec: String,
2024-11-18 16:05:25 +00:00
/// Blossom servers
blossom: Option<Vec<String>>,
2024-12-09 11:36:05 +00:00
/// Cost (milli-sats) / second / variant
cost: i64,
2024-11-15 15:54:51 +00:00
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LndSettings {
pub address: String,
pub cert: String,
pub macaroon: String,
2024-09-03 14:09:30 +01:00
}