pub struct Config {Show 22 fields
pub port: u16,
pub database_url: String,
pub jwt_secret: String,
pub s3_bucket: String,
pub s3_region: String,
pub s3_endpoint: Option<String>,
pub max_plugin_size: usize,
pub rate_limit_per_minute: u32,
pub analytics_db_path: Option<String>,
pub shutdown_timeout_secs: u64,
pub redis_url: Option<String>,
pub skip_migrations: bool,
pub two_factor_enabled: Option<bool>,
pub app_base_url: String,
pub stripe_secret_key: Option<String>,
pub stripe_price_id_pro: Option<String>,
pub stripe_price_id_team: Option<String>,
pub stripe_webhook_secret: Option<String>,
pub oauth_github_client_id: Option<String>,
pub oauth_github_client_secret: Option<String>,
pub oauth_google_client_id: Option<String>,
pub oauth_google_client_secret: Option<String>,
}Fields§
§port: u16Server port
database_url: StringDatabase connection URL
jwt_secret: StringJWT secret for authentication
s3_bucket: StringS3 configuration
s3_region: String§s3_endpoint: Option<String>§max_plugin_size: usizeUpload limits
rate_limit_per_minute: u32Rate limiting
analytics_db_path: Option<String>Analytics database path (optional, defaults to “mockforge-analytics.db” in current directory)
shutdown_timeout_secs: u64Graceful shutdown timeout in seconds
redis_url: Option<String>Redis URL for caching and temporary storage (optional)
skip_migrations: boolSkip running database migrations on startup (default: false) Set SKIP_MIGRATIONS=true when running migrations as a separate K8s Job
two_factor_enabled: Option<bool>Whether two-factor authentication is enabled (requires Redis)
app_base_url: StringBase URL of the application (for OAuth callbacks and email links)
stripe_secret_key: Option<String>Stripe secret key for billing
stripe_price_id_pro: Option<String>Stripe price ID for Pro plan
stripe_price_id_team: Option<String>Stripe price ID for Team plan
stripe_webhook_secret: Option<String>Stripe webhook secret for verifying webhook signatures
oauth_github_client_id: Option<String>GitHub OAuth client ID
oauth_github_client_secret: Option<String>GitHub OAuth client secret
oauth_google_client_id: Option<String>Google OAuth client ID
oauth_google_client_secret: Option<String>Google OAuth client secret
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load configuration from environment variables.
Required environment variables:
DATABASE_URL: Database connection URLJWT_SECRET: Secret key for JWT token signing
Optional environment variables (with defaults):
PORT: Server port (default: 8080)S3_BUCKET: S3 bucket name (default: “mockforge-plugins”)S3_REGION: S3 region (default: “us-east-1”)S3_ENDPOINT: Custom S3 endpoint for MinIO/compatible storageMAX_PLUGIN_SIZE: Maximum plugin size in bytes (default: 52428800 / 50MB)RATE_LIMIT_PER_MINUTE: Rate limit per minute (default: 60)ANALYTICS_DB_PATH: Path to analytics databaseSHUTDOWN_TIMEOUT_SECS: Graceful shutdown timeout in seconds (default: 30)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more