Merge remote-tracking branch 'chimiana/develop' into develop

This commit is contained in:
ThatOneCalculator 2022-12-17 09:25:08 -08:00
commit 0cc74b6a8d
No known key found for this signature in database
GPG key ID: 8703CACD01000000
5 changed files with 18 additions and 3 deletions

3
.gitignore vendored
View file

@ -33,6 +33,9 @@ coverage
!/.config/example.yml !/.config/example.yml
!/.config/docker_example.env !/.config/docker_example.env
#docker dev config
/dev/docker-compose.yml
# misskey # misskey
/build /build
built built

View file

@ -4,6 +4,7 @@ services:
web: web:
image: docker.io/thatonecalculator/calckey image: docker.io/thatonecalculator/calckey
build: .. build: ..
container_name: calckey_web
restart: always restart: always
depends_on: depends_on:
- db - db
@ -13,12 +14,14 @@ services:
- "3000:3000" - "3000:3000"
networks: networks:
- network - network
# - web
volumes: volumes:
- ../files:/calckey/files - ../files:/calckey/files
- ../.config:/calckey/.config:ro - ../.config:/calckey/.config:ro
redis: redis:
restart: always restart: always
container_name: calckey_redis
image: docker.io/redis:7.0-alpine image: docker.io/redis:7.0-alpine
networks: networks:
- network - network
@ -28,6 +31,7 @@ services:
db: db:
restart: always restart: always
image: docker.io/postgres:13.9-alpine image: docker.io/postgres:13.9-alpine
container_name: calckey_db
networks: networks:
- network - network
env_file: env_file:
@ -48,3 +52,6 @@ services:
networks: networks:
network: network:
# web:
# external:
# name: web

View file

@ -3,6 +3,7 @@ version: "3"
services: services:
web: web:
image: docker.io/thatonecalculator/calckey image: docker.io/thatonecalculator/calckey
container_name: calckey_web
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:
- db - db
@ -17,11 +18,12 @@ services:
NODE_ENV: production NODE_ENV: production
volumes: volumes:
- ./files:/calckey/files - ./files:/calckey/files
- ./config:/calckey/.config:ro - ./.config:/calckey/.config:ro
redis: redis:
restart: unless-stopped restart: unless-stopped
image: docker.io/redis:7.0-alpine image: docker.io/redis:7.0-alpine
container_name: calckey_redis
networks: networks:
- calcnet - calcnet
volumes: volumes:
@ -30,6 +32,7 @@ services:
db: db:
restart: unless-stopped restart: unless-stopped
image: docker.io/postgres:13.9-alpine image: docker.io/postgres:13.9-alpine
container_name: calckey_db
networks: networks:
- calcnet - calcnet
env_file: env_file:

View file

@ -217,8 +217,10 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
logger.info('creating web image'); logger.info('creating web image');
try { try {
if (['image/jpeg', 'image/webp'].includes(type)) { if (['image/jpeg'].includes(type)) {
webpublic = await convertSharpToJpeg(img, 2048, 2048); webpublic = await convertSharpToJpeg(img, 2048, 2048);
} else if (['image/webp'].includes(type)) {
webpublic = await convertSharpToPng(img, 2048, 2048);
} else if (['image/png'].includes(type)) { } else if (['image/png'].includes(type)) {
webpublic = await convertSharpToPng(img, 2048, 2048); webpublic = await convertSharpToPng(img, 2048, 2048);
} else if (['image/svg+xml'].includes(type)) { } else if (['image/svg+xml'].includes(type)) {

View file

@ -18,7 +18,7 @@ export const uploads = ref<Uploading[]>([]);
const compressTypeMap = { const compressTypeMap = {
'image/jpeg': { quality: 0.85, mimeType: 'image/jpeg' }, 'image/jpeg': { quality: 0.85, mimeType: 'image/jpeg' },
'image/webp': { quality: 0.85, mimeType: 'image/jpeg' }, 'image/webp': { quality: 0.85, mimeType: 'image/png' },
'image/svg+xml': { quality: 1, mimeType: 'image/png' }, 'image/svg+xml': { quality: 1, mimeType: 'image/png' },
} as const; } as const;