holy shit minio

This commit is contained in:
Andrea Toska 2025-04-27 11:12:26 +02:00
commit 8a48cab347
No known key found for this signature in database
GPG key ID: 5B3C83807CCBE9A2
2 changed files with 20 additions and 4 deletions

View file

@ -102,19 +102,19 @@ async fn launch() -> _ {
.connect(&act_database_url).await
.expect("unable to create pool");
static S3_URL_STRING: Lazy<Box<str>> = Lazy::new(||
pub static S3_URL_STRING: Lazy<Box<str>> = Lazy::new(||
env::var("S3_URL").expect("S3_URL not specified").into_boxed_str()
);
static S3_URL: Lazy<BaseUrl> = Lazy::new(||
pub static S3_URL: Lazy<BaseUrl> = Lazy::new(||
S3_URL_STRING.parse().unwrap()
);
static S3_USER: Lazy<Box<str>> = Lazy::new(||
pub static S3_USER: Lazy<Box<str>> = Lazy::new(||
env::var("S3_USER").expect("S3_USER not specified").into_boxed_str()
);
static S3_PASSWD: Lazy<Box<str>> = Lazy::new(||
pub static S3_PASSWD: Lazy<Box<str>> = Lazy::new(||
env::var("S3_PASSWD").expect("S3_PASSWD not specified").into_boxed_str()
);

View file

@ -31,6 +31,22 @@ const DATABASE_ERROR: Errors = Errors{
]
};
pub static S3_URL_STRING: Lazy<Box<str>> = Lazy::new(||
env::var("S3_URL").expect("S3_URL not specified").into_boxed_str()
);
pub static S3_URL: Lazy<BaseUrl> = Lazy::new(||
S3_URL_STRING.parse().unwrap()
);
pub static S3_USER: Lazy<Box<str>> = Lazy::new(||
env::var("S3_USER").expect("S3_USER not specified").into_boxed_str()
);
pub static S3_PASSWD: Lazy<Box<str>> = Lazy::new(||
env::var("S3_PASSWD").expect("S3_PASSWD not specified").into_boxed_str()
);
fn get_mii_img_url_path(pid: i32, format: &str) -> String{
format!("mii/{}/main.{}", pid, format)
}