#![warn(missing_docs)]
#![warn(rustdoc::missing_crate_level_docs)]
pub mod ai;
pub mod config;
pub mod error;
pub mod handlers;
pub mod middleware;
pub mod models;
pub mod server;
pub mod services;
pub mod telemetry;
pub mod utils;
use clap::Parser;
#[derive(Parser, Debug)]
#[command(
name = "openserve",
version = env!("CARGO_PKG_VERSION"),
author = "OpenServe Team <team@openserve.io>",
about = "An AI-powered, cloud-native file server with intelligent features.",
long_about = "OpenServe is a modern, high-performance file server built in Rust. \
It provides a flexible and scalable platform for serving files with \
advanced capabilities like AI-powered search, content analysis, and more."
)]
pub struct Args {
#[arg(default_value = ".", env = "OPENSERVE_PATH")]
pub path: String,
#[arg(short, long, default_value = "5000", env = "OPENSERVE_PORT")]
pub port: u16,
#[arg(short = 'b', long, default_value = "0.0.0.0", env = "OPENSERVE_HOST")]
pub host: String,
#[arg(long, env = "OPENSERVE_AI_ENABLED")]
pub ai: bool,
#[arg(long, env = "OPENAI_API_KEY", hide = true)]
pub openai_api_key: Option<String>,
#[arg(short, long, env = "OPENSERVE_CONFIG")]
pub config: Option<String>,
#[arg(long, default_value = "info", env = "OPENSERVE_LOG_LEVEL")]
pub log_level: String,
#[arg(long, env = "OPENSERVE_TLS_ENABLED")]
pub tls: bool,
#[arg(long, requires = "tls", env = "OPENSERVE_TLS_CERT")]
pub tls_cert: Option<String>,
#[arg(long, requires = "tls", env = "OPENSERVE_TLS_KEY")]
pub tls_key: Option<String>,
}
pub use config::Config;
pub use server::Server;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub mod prelude {
pub use crate::{
config::{Config, ServerConfig, AiConfig, AuthConfig, SearchConfig, TelemetryConfig},
server::Server,
models::{
self,
file::{File, Directory, FileMetadata, UploadResponse},
ai::{AnalysisRequest, AnalysisResult, ChatRequest, ChatResponse},
auth::{Claims, AuthToken, User},
search::{SearchRequest, SearchResult},
},
services::{FileService, SearchService, AuthService},
ai::AiService,
};
}