Compare commits

...

2 Commits

Author SHA1 Message Date
470af79a24 fix: enable libx265
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-11 15:59:52 +01:00
5048c4104a fix: disable quota checks when not configured 2025-06-11 15:58:43 +01:00
3 changed files with 47 additions and 49 deletions

View File

@ -12,13 +12,14 @@ RUN apt update && \
apt install -y \
build-essential \
libx264-dev \
libx265-dev \
libwebp-dev \
libvpx-dev \
nasm \
libclang-dev \
protobuf-compiler && \
rm -rf /var/lib/apt/lists/*
RUN git clone --single-branch --branch master https://git.v0l.io/ffmpeg/FFmpeg.git && \
RUN git clone --single-branch --branch release/7.1 https://git.v0l.io/ffmpeg/FFmpeg.git && \
cd FFmpeg && \
./configure \
--prefix=${FFMPEG_DIR} \
@ -27,6 +28,7 @@ RUN git clone --single-branch --branch master https://git.v0l.io/ffmpeg/FFmpeg.g
--disable-network \
--enable-gpl \
--enable-libx264 \
--enable-libx265 \
--enable-libwebp \
--enable-libvpx \
--disable-static \

View File

@ -364,13 +364,10 @@ async fn process_upload(
return e;
}
// check quota
// check quota (only if payments are configured)
#[cfg(feature = "payments")]
{
let free_quota = settings
.payments
.as_ref()
.and_then(|p| p.free_quota_bytes)
if let Some(payment_config) = &settings.payments {
let free_quota = payment_config.free_quota_bytes
.unwrap_or(104857600); // Default to 100MB
let pubkey_vec = auth.event.pubkey.to_bytes().to_vec();
@ -442,13 +439,11 @@ where
}
};
// Post-upload quota check if we didn't have size information before upload
// Post-upload quota check if we didn't have size information before upload (only if payments are configured)
#[cfg(feature = "payments")]
if size == 0 {
let free_quota = settings
.payments
.as_ref()
.and_then(|p| p.free_quota_bytes)
if let Some(payment_config) = &settings.payments {
let free_quota = payment_config.free_quota_bytes
.unwrap_or(104857600); // Default to 100MB
match db.check_user_quota(pubkey, upload.size, free_quota).await {
@ -469,6 +464,7 @@ where
Ok(true) => {} // Quota check passed
}
}
}
if let Err(e) = db.add_file(&upload, user_id).await {
error!("{}", e);
BlossomResponse::error(format!("Error saving file (db): {}", e))

View File

@ -205,11 +205,10 @@ async fn upload(
let pubkey_vec = auth.event.pubkey.to_bytes().to_vec();
// check quota
// check quota (only if payments are configured)
#[cfg(feature = "payments")]
{
let free_quota = settings.payments.as_ref()
.and_then(|p| p.free_quota_bytes)
if let Some(payment_config) = &settings.payments {
let free_quota = payment_config.free_quota_bytes
.unwrap_or(104857600); // Default to 100MB
if upload_size > 0 {
@ -255,11 +254,11 @@ async fn upload(
Err(e) => return Nip96Response::error(&format!("Could not save user: {}", e)),
};
// Post-upload quota check if we didn't have size information before upload
// Post-upload quota check if we didn't have size information before upload (only if payments are configured)
#[cfg(feature = "payments")]
if upload_size == 0 {
let free_quota = settings.payments.as_ref()
.and_then(|p| p.free_quota_bytes)
if let Some(payment_config) = &settings.payments {
let free_quota = payment_config.free_quota_bytes
.unwrap_or(104857600); // Default to 100MB
match db.check_user_quota(&pubkey_vec, upload.size, free_quota).await {
@ -280,6 +279,7 @@ async fn upload(
Ok(true) => {} // Quota check passed
}
}
}
if let Err(e) = db.add_file(&upload, user_id).await {
error!("{}", e);