Skip to main content

jax_daemon/
service_config.rs

1use std::net::SocketAddr;
2use std::path::PathBuf;
3
4use common::prelude::SecretKey;
5
6use crate::state::BlobStoreConfig;
7
8#[derive(Debug)]
9pub struct Config {
10    // peer configuration
11    /// address for our jax peer to listen on,
12    ///  if not set then an ephemeral port will be used
13    pub node_listen_addr: Option<SocketAddr>,
14    /// on system file path to our secret,
15    ///  if not set then a new secret will be generated
16    pub node_secret: Option<SecretKey>,
17
18    // blob store configuration
19    /// Blob storage backend configuration
20    pub blob_store: BlobStoreConfig,
21    /// Path to the jax directory (absolute path, used for legacy blobs and cache)
22    pub jax_dir: PathBuf,
23
24    // http server configuration - separate ports for API and gateway
25    /// Port for the API HTTP server (private, mutation/RPC).
26    pub api_port: u16,
27    /// Port for the gateway HTTP server (public, read-only).
28    pub gateway_port: u16,
29
30    // data store configuration
31    /// a path to a sqlite database, if not set then an
32    ///  in-memory database will be used
33    pub sqlite_path: Option<PathBuf>,
34
35    // logging
36    pub log_level: tracing::Level,
37    /// Directory for log files (optional, logs to stdout only if not set)
38    pub log_dir: Option<PathBuf>,
39
40    // url configuration
41    /// External gateway URL (e.g., "https://gateway.example.com")
42    /// Used for generating share/download links
43    pub gateway_url: Option<String>,
44}
45
46// TODO (amiller68): real error handling
47#[allow(dead_code)]
48#[derive(Debug, thiserror::Error)]
49pub enum ConfigError {}