diff --git a/.config/redis.config.php b/.config/redis.config.php index a5b13da6..2069812f 100644 --- a/.config/redis.config.php +++ b/.config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/28/apache/config/redis.config.php b/28/apache/config/redis.config.php index a5b13da6..2069812f 100644 --- a/28/apache/config/redis.config.php +++ b/28/apache/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/28/fpm-alpine/config/redis.config.php b/28/fpm-alpine/config/redis.config.php index a5b13da6..2069812f 100644 --- a/28/fpm-alpine/config/redis.config.php +++ b/28/fpm-alpine/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/28/fpm/config/redis.config.php b/28/fpm/config/redis.config.php index a5b13da6..2069812f 100644 --- a/28/fpm/config/redis.config.php +++ b/28/fpm/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/29/apache/config/redis.config.php b/29/apache/config/redis.config.php index a5b13da6..2069812f 100644 --- a/29/apache/config/redis.config.php +++ b/29/apache/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/29/fpm-alpine/config/redis.config.php b/29/fpm-alpine/config/redis.config.php index a5b13da6..2069812f 100644 --- a/29/fpm-alpine/config/redis.config.php +++ b/29/fpm-alpine/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/29/fpm/config/redis.config.php b/29/fpm/config/redis.config.php index a5b13da6..2069812f 100644 --- a/29/fpm/config/redis.config.php +++ b/29/fpm/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/30/apache/config/redis.config.php b/30/apache/config/redis.config.php index a5b13da6..2069812f 100644 --- a/30/apache/config/redis.config.php +++ b/30/apache/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/30/fpm-alpine/config/redis.config.php b/30/fpm-alpine/config/redis.config.php index a5b13da6..2069812f 100644 --- a/30/fpm-alpine/config/redis.config.php +++ b/30/fpm-alpine/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/30/fpm/config/redis.config.php b/30/fpm/config/redis.config.php index a5b13da6..2069812f 100644 --- a/30/fpm/config/redis.config.php +++ b/30/fpm/config/redis.config.php @@ -14,4 +14,8 @@ if (getenv('REDIS_HOST')) { } elseif (getenv('REDIS_HOST')[0] != '/') { $CONFIG['redis']['port'] = 6379; } + + if (getenv('REDIS_HOST_USER') !== false) { + $CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER'); + } } diff --git a/README.md b/README.md index 6745faa3..6fdd5ec9 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,7 @@ To use Redis for memory caching as well as PHP session storage, specify the foll - `REDIS_HOST` (not set by default) Name of Redis container - `REDIS_HOST_PORT` (default: `6379`) Optional port for Redis, only use for external Redis servers that run on non-standard ports. +- `REDIS_HOST_USER` (not set by default) Optional username for Redis, only use for external Redis servers that require a user. - `REDIS_HOST_PASSWORD` (not set by default) Redis password Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html) for more information. diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index f65b49ed..bdee5160 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -70,6 +70,24 @@ latest=$( cat latest.txt ) versions=( */ ) versions=( "${versions[@]%/}" ) for version in "${versions[@]}"; do + + if [ "$version" = "notify_push" ]; then + commit="$(dockerfileCommit "$version")" + fullversion="$( awk '$1 == "ENV" && $2 == "NOTIFY_PUSH_VERSION" { print $3; exit }' "$version/Dockerfile" )" + versionAliases=( "$fullversion" "${fullversion%.*}" "${fullversion%.*.*}" ) + variantAliases=( "${versionAliases[@]/%/-$version}" $version ) + + cat <<-EOE + + Tags: $(join ', ' "${variantAliases[@]}") + Architectures: amd64, arm32v7, arm64v8 + GitCommit: $commit + Directory: $version + EOE + + continue + fi + variants=( $version/*/ ) variants=( $(for variant in "${variants[@]%/}"; do echo "$(basename "$variant")" diff --git a/notify_push/Dockerfile b/notify_push/Dockerfile new file mode 100644 index 00000000..56ac7787 --- /dev/null +++ b/notify_push/Dockerfile @@ -0,0 +1,27 @@ +FROM alpine:3.13 + +RUN apk add --no-cache ca-certificates + +# https://github.com/nextcloud/notify_push/releases +ENV NOTIFY_PUSH_VERSION 0.1.6 + +RUN set -ex; \ + \ + apkArch="$(apk --print-arch)"; \ + npTriplet="unknown-linux-musl"; \ + case "$apkArch" in \ + aarch64|x86_64) npArch="$apkArch" ;; \ + armv7) npArch="$apkArch"; $npTriplet="${npTriplet}-eabihf" ;; \ + *) echo >&2 "error: unsupported arch: $apkArch"; exit 1 ;; \ + esac; \ + \ + wget -O /usr/local/bin/notify_push "https://github.com/nextcloud/notify_push/releases/download/v${NOTIFY_PUSH_VERSION}/notify_push-$npArch-$npTriplet"; \ + \ + chmod +x /usr/local/bin/notify_push; \ + notify_push --version + +USER nobody + +EXPOSE 7867 + +CMD ["notify_push"] diff --git a/update.sh b/update.sh index 89f3d6f2..daa6b362 100755 --- a/update.sh +++ b/update.sh @@ -71,6 +71,16 @@ imagick_version="$( | tail -1 )" +notify_push_version="$( + git ls-remote --tags https://github.com/nextcloud/notify_push.git \ + | cut -d/ -f3 \ + | grep -vE -- '-rc|-b' \ + | tr -d '^{}' \ + | sed -E 's/^v//' \ + | sort -V \ + | tail -1 +)" + declare -A pecl_versions=( [APCu]="$apcu_version" [memcached]="$memcached_version" @@ -179,3 +189,6 @@ for version in "${versions[@]}"; do done fi done + +echo "updating notify_push $notify_push_version" +sed -re 's/^ENV NOTIFY_PUSH_VERSION .*$/ENV NOTIFY_PUSH_VERSION '"$notify_push_version"'/;' -i "notify_push/Dockerfile"