diff --git a/Dockerfile b/Dockerfile index e905ab825..ffc2186ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,25 +12,10 @@ RUN cd /build && sed -i "s|.\/pics|${IMG_PATH}|g" config.json \ && sed -i 's/127.0.0.1/0.0.0.0/g' config.json \ && go build -ldflags="-s -w" -o webp-server . -FROM debian:bookworm-slim as libwebp -RUN apt update && apt install -y wget gcc make autoconf automake libtool libgif-dev \ - libjpeg-dev libjpeg62-turbo libjpeg62-turbo-dev libpng-dev libpng-tools libpng16-16 libtiff-dev libtiff6 libtiffxx6 -RUN mkdir libwebp && mkdir -p /build/usr && mkdir /build/usr/lib/ && cd libwebp && \ - wget https://chromium.googlesource.com/webm/libwebp/+archive/refs/heads/1.3.2.tar.gz && \ - tar xf 1.3.2.tar.gz && rm -f 1.3.2.tar.gz && \ - ./autogen.sh && \ - ./configure --prefix=/build/usr --libdir=/build/usr/lib --enable-everything && \ - make && make install - FROM debian:bookworm-slim RUN apt update && apt install --no-install-recommends libvips ca-certificates libjemalloc2 libtcmalloc-minimal4 -y && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt/archives/* -# for CVE-2023-4863 -RUN dpkg --remove --force-depends libwebp-dev libwebp7 libwebpdemux2 libwebpmux3 -COPY --from=libwebp /build/usr/lib/* /usr/lib/temp-linux-gnu/ -RUN mv /usr/lib/temp-linux-gnu/* /usr/lib/$(uname -m)-linux-gnu/ && ldconfig - COPY --from=builder /build/webp-server /usr/bin/webp-server COPY --from=builder /build/config.json /etc/config.json diff --git a/config/config.go b/config/config.go index 8ca923901..4532df39e 100644 --- a/config/config.go +++ b/config/config.go @@ -47,7 +47,7 @@ var ( ProxyMode bool Prefetch bool Config = NewWebPConfig() - Version = "0.10.7" + Version = "0.10.8" WriteLock = cache.New(5*time.Minute, 10*time.Minute) ConvertLock = cache.New(5*time.Minute, 10*time.Minute) RemoteRaw = "./remote-raw" diff --git a/encoder/encoder.go b/encoder/encoder.go index c7c604795..1d28d7f66 100644 --- a/encoder/encoder.go +++ b/encoder/encoder.go @@ -120,15 +120,15 @@ func convertImage(rawPath, optimizedPath, imageType string, extraParams config.E switch imageType { case "webp": - err = webpEncoder(img, rawPath, optimizedPath, extraParams) + err = webpEncoder(img, rawPath, optimizedPath) case "avif": - err = avifEncoder(img, rawPath, optimizedPath, extraParams) + err = avifEncoder(img, rawPath, optimizedPath) } return err } -func avifEncoder(img *vips.ImageRef, rawPath string, optimizedPath string, extraParams config.ExtraParams) error { +func avifEncoder(img *vips.ImageRef, rawPath string, optimizedPath string) error { var ( buf []byte quality = config.Config.Quality @@ -163,7 +163,7 @@ func avifEncoder(img *vips.ImageRef, rawPath string, optimizedPath string, extra return nil } -func webpEncoder(img *vips.ImageRef, rawPath string, optimizedPath string, extraParams config.ExtraParams) error { +func webpEncoder(img *vips.ImageRef, rawPath string, optimizedPath string) error { var ( buf []byte quality = config.Config.Quality diff --git a/encoder/prefetch.go b/encoder/prefetch.go index ec319757b..5735abd11 100644 --- a/encoder/prefetch.go +++ b/encoder/prefetch.go @@ -18,7 +18,7 @@ func PrefetchImages() { var sTime = time.Now() log.Infof("Prefetching using %d cores", config.Jobs) var finishChan = make(chan int, config.Jobs) - for _ = range config.Jobs { + for range config.Jobs { finishChan <- 1 } diff --git a/webp-server.go b/webp-server.go index f4ca860d2..094b72600 100644 --- a/webp-server.go +++ b/webp-server.go @@ -59,7 +59,7 @@ func init() { ▘ ▘▝▀▘▀▀ ▘ ▝▀ ▝▀▘▘ ▘ ▝▀▘▘ ▝▀ ▝▀ WebP Server Go - v%s - Develop by WebP Server team. https://github.com/webp-sh`, config.Version) + Developed by WebP Server team. https://github.com/webp-sh`, config.Version) // main init is the last one to be called flag.Parse() // process cli params