From 35d2349ec5f50ccda7bb1db36e18da77d4afe814 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Fri, 30 Jun 2023 15:00:42 +0200 Subject: [PATCH] more changes :3 --- docker-compose.yml | 2 ++ lemmyprivacycheck/__main__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5a6b3d5..9645f2a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,3 +3,5 @@ services: build: . ports: - "8868:8868" + volumes: + - .:/app diff --git a/lemmyprivacycheck/__main__.py b/lemmyprivacycheck/__main__.py index 95f76ca..a28a420 100644 --- a/lemmyprivacycheck/__main__.py +++ b/lemmyprivacycheck/__main__.py @@ -19,7 +19,7 @@ async def root(): async def getImage(request: fastapi.Request): img2 = img.copy() draw = ImageDraw.Draw(img2) - draw.text((img2.width/2,img2.height/2), request.client.host, (255,255,255), font=font, stroke_width=5, stroke_fill=(0,0,0), anchor="mm") + draw.text((img2.width/2,img2.height/2), request.headers["x-forwarded-for"], (255,255,255), font=font, stroke_width=5, stroke_fill=(0,0,0), anchor="mm") img_bin = BytesIO() img2.save(img_bin, format="jpeg") return fastapi.Response(content=img_bin.getvalue(), media_type="image/jpeg")