bootstrap rust services, auth, and compose stack

This commit is contained in:
2026-03-05 14:51:02 +01:00
parent 1238079454
commit 88db9805b5
25 changed files with 3576 additions and 22 deletions

9
crates/core/Cargo.toml Normal file
View File

@@ -0,0 +1,9 @@
[package]
name = "stripstream-core"
version.workspace = true
edition.workspace = true
license.workspace = true
[dependencies]
anyhow.workspace = true
serde.workspace = true

47
crates/core/src/config.rs Normal file
View File

@@ -0,0 +1,47 @@
use anyhow::{Context, Result};
#[derive(Debug, Clone)]
pub struct ApiConfig {
pub listen_addr: String,
pub database_url: String,
pub api_bootstrap_token: String,
}
impl ApiConfig {
pub fn from_env() -> Result<Self> {
Ok(Self {
listen_addr: std::env::var("API_LISTEN_ADDR").unwrap_or_else(|_| "0.0.0.0:8080".to_string()),
database_url: std::env::var("DATABASE_URL").context("DATABASE_URL is required")?,
api_bootstrap_token: std::env::var("API_BOOTSTRAP_TOKEN")
.context("API_BOOTSTRAP_TOKEN is required")?,
})
}
}
#[derive(Debug, Clone)]
pub struct IndexerConfig {
pub listen_addr: String,
}
impl IndexerConfig {
pub fn from_env() -> Self {
Self {
listen_addr: std::env::var("INDEXER_LISTEN_ADDR")
.unwrap_or_else(|_| "0.0.0.0:8081".to_string()),
}
}
}
#[derive(Debug, Clone)]
pub struct AdminUiConfig {
pub listen_addr: String,
}
impl AdminUiConfig {
pub fn from_env() -> Self {
Self {
listen_addr: std::env::var("ADMIN_UI_LISTEN_ADDR")
.unwrap_or_else(|_| "0.0.0.0:8082".to_string()),
}
}
}

1
crates/core/src/lib.rs Normal file
View File

@@ -0,0 +1 @@
pub mod config;

View File

@@ -0,0 +1,8 @@
[package]
name = "parsers"
version.workspace = true
edition.workspace = true
license.workspace = true
[dependencies]
anyhow.workspace = true

View File

@@ -0,0 +1,3 @@
pub fn supported_formats() -> &'static [&'static str] {
&["cbz", "cbr", "pdf"]
}