Mobile support to come.
use std::env;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Settings {
pub port: String,
pub git_project_root: String,
pub database_url: String,
pub supabase_jwt_public_key: String,
pub oauth_device_verification_uri: String,
}
impl Settings {
pub fn new() -> anyhow::Result<Self> {
Ok(Self {
port: env::var("PORT").unwrap_or_else(|_| "8080".to_string()),
git_project_root: env::var("GIT_PROJECT_ROOT")
.unwrap_or_else(|_| "/srv/git".to_string()),
database_url: env::var("DATABASE_URL").expect("DATABASE_URL must be set"),
supabase_jwt_public_key: env::var("SUPABASE_JWT_PUBLIC_KEY")
.expect("SUPABASE_JWT_PUBLIC_KEY must be set"),
oauth_device_verification_uri: env::var("OAUTH_DEVICE_VERIFICATION_URI")
.expect("OAUTH_DEVICE_VERIFICATION_URI must be set"),
})
}
pub fn get_server_address(&self) -> String {
format!("0.0.0.0:{}", self.port)
}
}
removed unnecessary envs
mikkel•2a7368f3d ago
implemented create user endpoint
mikkel•5b3ad656d ago
updated get device code request into query param
mikkel•5152d6c8d ago
wired up oauth in backend
mikkel•13cdd308d ago
implemented optional extractor to extract auth user from jwt token in request header
mike•988f77f22d ago
added org server in app state
mike•e95ce8623d ago
updated both app state and settings to derive from Debug
mike•333649a1mo ago
created gitdot lib
mike•d2ec2131mo ago