remove OIDC/Postgres, replace ApiError w/ AppError, move params to api-types

This commit is contained in:
2026-07-12 05:14:17 +02:00
parent c0e685a4ee
commit 9b18d3ff6d
42 changed files with 243 additions and 3367 deletions

View File

@@ -41,9 +41,6 @@ pub enum DbError {
pub enum DbPool {
#[cfg(feature = "sqlite")]
Sqlite(sqlx::SqlitePool),
#[cfg(feature = "postgres")]
Postgres(sqlx::PgPool),
}
impl DbPool {
@@ -60,11 +57,6 @@ impl DbPool {
let pool = sqlx::SqlitePool::connect(database_url).await?;
Ok(Self::Sqlite(pool))
}
#[cfg(feature = "postgres")]
"postgres" | "postgresql" => {
let pool = sqlx::PgPool::connect(database_url).await?;
Ok(Self::Postgres(pool))
}
other => Err(DbError::UnsupportedScheme(other.to_string())),
}
}
@@ -77,10 +69,6 @@ impl DbPool {
.run(pool)
.await?;
}
#[cfg(feature = "postgres")]
Self::Postgres(_pool) => {
tracing::warn!("postgres migrations not yet available");
}
}
Ok(())
}
@@ -112,11 +100,6 @@ pub struct Config {
pub jwt_expiry_hours: u64,
pub jwt_refresh_expiry_days: u64,
pub allow_registration: bool,
pub oidc_issuer_url: Option<String>,
pub oidc_client_id: Option<String>,
pub oidc_client_secret: Option<String>,
pub oidc_redirect_url: Option<String>,
pub oidc_resource_id: Option<String>,
pub jellyfin_url: Option<String>,
pub jellyfin_api_key: Option<String>,
pub jellyfin_user_id: Option<String>,
@@ -178,12 +161,6 @@ impl Config {
.and_then(|s| s.parse().ok())
.unwrap_or(DEFAULT_JWT_REFRESH_EXPIRY_DAYS);
let oidc_issuer_url = env::var("OIDC_ISSUER").ok();
let oidc_client_id = env::var("OIDC_CLIENT_ID").ok();
let oidc_client_secret = env::var("OIDC_CLIENT_SECRET").ok();
let oidc_redirect_url = env::var("OIDC_REDIRECT_URL").ok();
let oidc_resource_id = env::var("OIDC_RESOURCE_ID").ok();
let is_production = env::var("PRODUCTION")
.or_else(|_| env::var("RUST_ENV"))
.map(|v| {
@@ -234,11 +211,6 @@ impl Config {
jwt_expiry_hours,
jwt_refresh_expiry_days,
allow_registration,
oidc_issuer_url,
oidc_client_id,
oidc_client_secret,
oidc_redirect_url,
oidc_resource_id,
jellyfin_url,
jellyfin_api_key,
jellyfin_user_id,