mirror of
https://github.com/modrinth/code.git
synced 2026-09-03 13:36:48 +00:00
Improve environment variable handling and reading (#5389)
* wip: better env var reading * move most env vars to env.rs * migrate more env vars * more migration * more migrations * More migration * 🦀 dotenvy is gone (almost) * 🦀 dotenvy is gone 🦀 * Fix mural source account env var handling * Remove defaults from admin key vars * dummy commit to update github pr * fix ci
This commit is contained in:
@@ -7,6 +7,7 @@ use crate::database::models::image_item;
|
||||
use crate::database::models::notification_item::NotificationBuilder;
|
||||
use crate::database::models::thread_item::ThreadMessageBuilder;
|
||||
use crate::database::redis::RedisPool;
|
||||
use crate::env::ENV;
|
||||
use crate::file_hosting::{FileHost, FileHostPublicity};
|
||||
use crate::models::ids::{ThreadId, ThreadMessageId};
|
||||
use crate::models::images::{Image, ImageContext};
|
||||
@@ -631,9 +632,8 @@ pub async fn message_delete(
|
||||
let images =
|
||||
database::DBImage::get_many_contexted(context, &mut transaction)
|
||||
.await?;
|
||||
let cdn_url = dotenvy::var("CDN_URL")?;
|
||||
for image in images {
|
||||
let name = image.url.split(&format!("{cdn_url}/")).nth(1);
|
||||
let name = image.url.split(&format!("{}/", ENV.CDN_URL)).nth(1);
|
||||
if let Some(icon_path) = name {
|
||||
file_host
|
||||
.delete_file(
|
||||
|
||||
Reference in New Issue
Block a user