Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from imgproxy:master #433

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
## [Unreleased]
# Add
- Add `imgproxy.source_image_url` and `imgproxy.processing_options` attributes to New Relic, DataDog, and OpenTelemetry traces.
- Add [IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE](https://docs.imgproxy.net/latest/configuration/options#IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE) config.
- (pro) Add [monochrome](https://docs.imgproxy.net/latest/usage/processing#monochrome) processing option.
- (pro) Add [duotone](https://docs.imgproxy.net/latest/usage/processing#duotone) processing option.
- (pro) Add `objw` [gravity](https://docs.imgproxy.net/latest/usage/processing#gravity) type.
- (pro) Add an object pseudo-class `all` that can be used with the `obj` and `objw` [gravity](https://docs.imgproxy.net/latest/usage/processing#gravity) types to match all detected objects.
- (docker) Add a script for [building Linux packages](https://docs.imgproxy.net/latest/installation#building-linux-packages).

# Change
- Properly set the `net.host.name` and `http.url` tags in OpenTelemetry traces.
- (pro) Object detection: [class names file](https://docs.imgproxy.net/latest/object_detection#class-names-file) can contain object classes' weights.

# Fix
- Fix handling `#` symbols in `local://`, `s3://`, `gcs://`, `abs://`, and `swift://` URLs.
Expand Down
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ var (
S3Enabled bool
S3Region string
S3Endpoint string
S3EndpointUsePathStyle bool
S3AssumeRoleArn string
S3AssumeRoleExternalID string
S3MultiRegion bool
Expand Down Expand Up @@ -308,6 +309,7 @@ func Reset() {
S3Enabled = false
S3Region = ""
S3Endpoint = ""
S3EndpointUsePathStyle = true
S3AssumeRoleArn = ""
S3AssumeRoleExternalID = ""
S3MultiRegion = false
Expand Down Expand Up @@ -539,6 +541,7 @@ func Configure() error {
configurators.Bool(&S3Enabled, "IMGPROXY_USE_S3")
configurators.String(&S3Region, "IMGPROXY_S3_REGION")
configurators.String(&S3Endpoint, "IMGPROXY_S3_ENDPOINT")
configurators.Bool(&S3EndpointUsePathStyle, "IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE")
configurators.String(&S3AssumeRoleArn, "IMGPROXY_S3_ASSUME_ROLE_ARN")
configurators.String(&S3AssumeRoleExternalID, "IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID")
configurators.Bool(&S3MultiRegion, "IMGPROXY_S3_MULTI_REGION")
Expand Down
15 changes: 9 additions & 6 deletions docker/imgproxy-build-package
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ echo
echo "Packaging..."

VERSION=$(imgproxy version)
RELEASE=$(printf '%(%y%m%d%H%M)T\n' -1)

case $PACKAGE_TYPE in
# TAR package ----------------------------------------------------------------
tar)
RESULT_FILE=imgproxy-$VERSION.$(dpkg --print-architecture).tar.gz
RESULT_FILE=imgproxy-$VERSION-$RELEASE.$(dpkg --print-architecture).tar.gz

tar -czf $RESULT_FILE -C opt imgproxy
cp $RESULT_FILE $TARGET_DIR
Expand All @@ -196,7 +197,7 @@ case $PACKAGE_TYPE in
# DEB package ----------------------------------------------------------------
deb)
DEB_ARCH=$(dpkg --print-architecture)
RESULT_FILE=imgproxy-$VERSION.$DEB_ARCH.deb
RESULT_FILE=imgproxy-$VERSION-$RELEASE.$DEB_ARCH.deb

mkdir -p imgproxy
mv opt imgproxy/
Expand All @@ -208,11 +209,11 @@ case $PACKAGE_TYPE in

cat << EOF > imgproxy/DEBIAN/control
Package: imgproxy
Version: $VERSION
Version: $VERSION-$RELEASE
Section: base
Priority: optional
Architecture: $DEB_ARCH
Depends: bash, libc6, libstdc++6, fontconfig-config, ca-certificates
Depends: bash, libc6, libstdc++6, fontconfig-config, ca-certificates, media-types
Maintainer: Foxes With Matches <info@imgproxy.net>
Homepage: https://imgproxy.net
Description: imgproxy
Expand Down Expand Up @@ -261,7 +262,7 @@ EOF
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends rpm

RPM_ARCH=$(rpm --eval '%{_arch}')
RESULT_FILE=imgproxy-$VERSION-1.$RPM_ARCH.rpm
RESULT_FILE=imgproxy-$VERSION-$RELEASE.$RPM_ARCH.rpm

mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
mkdir -p rpmbuild/SOURCES/imgproxy
Expand All @@ -273,7 +274,7 @@ EOF
cat << 'EOF' > rpmbuild/SPECS/imgproxy.spec
Name: imgproxy
Version: %{version}
Release: 1
Release: %{release}
Summary: imgproxy
License: MIT
URL: https://imgproxy.net
Expand All @@ -285,6 +286,7 @@ Requires: glibc
Requires: libstdc++
Requires: fontconfig
Requires: ca-certificates
Requires: shared-mime-info
Requires(interp): /bin/bash
Requires(post): /bin/bash
Requires(preun): /bin/bash
Expand Down Expand Up @@ -326,6 +328,7 @@ EOF
rpmbuild \
--define "_topdir $(pwd)/rpmbuild" \
--define "version $VERSION" \
--define "release $RELEASE" \
-bb rpmbuild/SPECS/imgproxy.spec

cp rpmbuild/RPMS/$RPM_ARCH/$RESULT_FILE $TARGET_DIR
Expand Down
2 changes: 1 addition & 1 deletion transport/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func New() (http.RoundTripper, error) {
}
clientOptions = append(clientOptions, func(o *s3.Options) {
o.BaseEndpoint = aws.String(endpoint)
o.UsePathStyle = true
o.UsePathStyle = config.S3EndpointUsePathStyle
})
}

Expand Down
Loading