feat: add image proxy for youtube thumbnails etc.

This commit is contained in:
Niklas 2023-10-24 20:16:23 +02:00
parent 53f03b3f56
commit a7d9a8bab9
5 changed files with 24 additions and 1 deletions

4
.env
View File

@ -27,3 +27,7 @@ AVATAR_FIGUREMAP_URL=http://assets/assets/gamedata/FigureMap.json
AVATAR_EFFECTMAP_URL=http://assets/assets/gamedata/EffectMap.json
AVATAR_ASSET_URL=http://assets/assets/bundled/figure/%libname%.nitro
AVATAR_ASSET_EFFECT_URL=http://assets/assets/bundled/effect/%libname%.nitro
IMAGEPROXY_USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
IMAGEPROXY_ADDR=0.0.0.0:8080
IMAGEPROXY_CACHE=/tmp/imageproxy

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ assets/swf
assets/usercontent/**/*.png
~$*.xlsx
export/
assets/usercontent/imageproxy/

View File

@ -80,6 +80,8 @@ UPDATE emulator_settings SET `value`='/app/assets/usercontent/badgeparts/' WHERE
UPDATE emulator_settings SET `value`='/app/assets/swf/c_images/Badgeparts' WHERE `key`='imager.location.badgeparts';
UPDATE emulator_settings SET `value`='http://127.0.0.1:8080/api/imageproxy/0x0/http://img.youtube.com/vi/%video%/default.jpg' WHERE `key`='imager.url.youtube';
UPDATE emulator_settings SET `value`='0' WHERE `key`='console.mode';
```

View File

@ -35,6 +35,10 @@ server {
return 403;
}
location ^~ /api/imageproxy/ {
proxy_pass http://imgproxy:8080/;
}
location ~* (.*/thumbnail)/(.+\.png)$ {
# kill cache
expires -1;

View File

@ -104,5 +104,17 @@ services:
restart: unless-stopped
networks: [nitro]
imgproxy:
image: ghcr.io/willnorris/imageproxy
depends_on:
# proxied through nginx of assets
- assets
volumes:
- "./assets/usercontent/imageproxy/cache:/tmp/imageproxy"
env_file:
- .env
restart: unless-stopped
networks: [nitro]
networks:
nitro: