From 95025adaca14e94a52dcf2a0dce53a143d50d9ca Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 26 Oct 2023 13:25:47 +0200 Subject: [PATCH] testing --- crates/routes/src/images.rs | 7 +------ docker/docker-compose.yml | 2 +- docker/lemmy.hjson | 1 + src/api_routes_http.rs | 2 ++ 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/routes/src/images.rs b/crates/routes/src/images.rs index 26ca3807b..6a0c7d6b8 100644 --- a/crates/routes/src/images.rs +++ b/crates/routes/src/images.rs @@ -40,12 +40,7 @@ pub fn config( ) // This has optional query params: /image/{filename}?format=jpg&thumbnail=256 .service(web::resource("/pictrs/image/{filename}").route(web::get().to(full_res))) - .service(web::resource("/pictrs/image/delete/{token}/{filename}").route(web::get().to(delete))) - .service( - web::scope("/api/v3") - .wrap(rate_limit.message()) - .route("image_proxy", web::post().to(image_proxy)), - ); + .service(web::resource("/pictrs/image/delete/{token}/{filename}").route(web::get().to(delete))); } #[derive(Debug, Serialize, Deserialize)] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index bd339aabb..f2933cc4e 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -77,7 +77,7 @@ services: init: true pictrs: - image: asonix/pictrs:0.4.0-beta.19 + image: asonix/pictrs:0.5.0-alpha.20 # this needs to match the pictrs url in lemmy.hjson hostname: pictrs # we can set options to pictrs like this, here we set max. image size and forced format for conversion diff --git a/docker/lemmy.hjson b/docker/lemmy.hjson index 4756ddadf..d998a65f7 100644 --- a/docker/lemmy.hjson +++ b/docker/lemmy.hjson @@ -22,6 +22,7 @@ url: "http://pictrs:8080/" # api_key: "API_KEY" cache_remote_images: true + image_proxy: true } #opentelemetry_url: "http://otel:4137" diff --git a/src/api_routes_http.rs b/src/api_routes_http.rs index fb784b3b3..67db366cc 100644 --- a/src/api_routes_http.rs +++ b/src/api_routes_http.rs @@ -124,11 +124,13 @@ use lemmy_apub::api::{ search::search, user_settings_backup::{export_settings, import_settings}, }; +use lemmy_routes::images::image_proxy; use lemmy_utils::rate_limit::RateLimitCell; pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) { cfg.service( web::scope("/api/v3") + .route("/image_proxy", web::get().to(image_proxy)) // Site .service( web::scope("/site")