Add dotenv

This commit is contained in:
Jon Staab
2026-02-25 15:16:48 -08:00
parent 9bc6c42aee
commit de4a16adbf
11 changed files with 3790 additions and 7 deletions
+2 -2
View File
@@ -20,13 +20,13 @@ pub struct Config {
impl Config {
pub fn from_env() -> Self {
let database_url =
env::var("DATABASE_URL").unwrap_or_else(|_| "sqlite://data/hosting.db".to_string());
env::var("DATABASE_URL").unwrap_or_else(|_| "sqlite://data/caravel.db".to_string());
let host = env::var("HOST").unwrap_or_else(|_| "127.0.0.1".to_string());
let port = env::var("PORT")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(3000);
let admin_pubkeys = env::var("HOSTING_ADMIN_PUBKEYS")
let admin_pubkeys = env::var("PLATFORM_ADMIN_PUBKEYS")
.unwrap_or_default()
.split(',')
.map(|v| v.trim().to_string())
+2
View File
@@ -27,6 +27,8 @@ use crate::repo::Repo;
#[tokio::main]
async fn main() -> Result<()> {
dotenvy::dotenv().ok();
tracing_subscriber::registry()
.with(tracing_subscriber::EnvFilter::from_default_env())
.with(tracing_subscriber::fmt::layer())