From 82399079d5e10a96bf709b63048ab4d07e4c3209 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 04:23:24 +0000 Subject: [PATCH 01/75] deploy: d4a0a6f53b36cbd1aa064eab3d301d73879e8770 --- .nojekyll | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .nojekyll diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 From 91c4e743da053646f6ebcff4b9e939d542bf8791 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 04:32:13 +0000 Subject: [PATCH 02/75] deploy: 6f93accd9a5ad4caa9e7c4b9607bb7760d17c8d2 --- .nojekyll | 0 apache/.htaccess | 9 +++ apache/Dockerfile | 38 ++++++++++++ apache/config-docker.php | 107 ++++++++++++++++++++++++++++++++ apache/docker-entrypoint.sh | 67 ++++++++++++++++++++ fpm-alpine/Dockerfile | 38 ++++++++++++ fpm-alpine/config-docker.php | 107 ++++++++++++++++++++++++++++++++ fpm-alpine/docker-entrypoint.sh | 67 ++++++++++++++++++++ fpm/Dockerfile | 37 +++++++++++ fpm/config-docker.php | 107 ++++++++++++++++++++++++++++++++ fpm/docker-entrypoint.sh | 67 ++++++++++++++++++++ 11 files changed, 644 insertions(+) delete mode 100644 .nojekyll create mode 100644 apache/.htaccess create mode 100644 apache/Dockerfile create mode 100644 apache/config-docker.php create mode 100755 apache/docker-entrypoint.sh create mode 100644 fpm-alpine/Dockerfile create mode 100644 fpm-alpine/config-docker.php create mode 100755 fpm-alpine/docker-entrypoint.sh create mode 100644 fpm/Dockerfile create mode 100644 fpm/config-docker.php create mode 100755 fpm/docker-entrypoint.sh diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/apache/.htaccess b/apache/.htaccess new file mode 100644 index 0000000..60bf53e --- /dev/null +++ b/apache/.htaccess @@ -0,0 +1,9 @@ +# BEGIN YOURLS + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.*$ /yourls-loader.php [L] + +# END YOURLS diff --git a/apache/Dockerfile b/apache/Dockerfile new file mode 100644 index 0000000..8f1d68b --- /dev/null +++ b/apache/Dockerfile @@ -0,0 +1,38 @@ +FROM php:8.0-apache + +# SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# install the PHP extensions we need +RUN set -eux; \ + docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + +# set recommended PHP.ini settings +# see https://secure.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.fast_shutdown=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + +RUN a2enmod rewrite expires + +ENV YOURLS_VERSION 1.8.1 +ENV YOURLS_SHA256 92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4 + +RUN set -eux; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ + echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + tar -xf yourls.tar.gz -C /usr/src/; \ +# move back to a common /usr/src/yourls + mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + rm yourls.tar.gz; \ + chown -R www-data:www-data /usr/src/yourls + +COPY docker-entrypoint.sh /usr/local/bin/ +COPY config-docker.php /usr/src/yourls/user/ +COPY .htaccess /usr/src/yourls/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/apache/config-docker.php b/apache/config-docker.php new file mode 100644 index 0000000..ea28847 --- /dev/null +++ b/apache/config-docker.php @@ -0,0 +1,107 @@ + getenv_docker('YOURLS_PASS'), +]; + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); + +/* +** URL Shortening settings +*/ + +/** URL shortening method: 36 or 62 */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); +/* + * 36: generates all lowercase keywords (ie: 13jkm) + * 62: generates mixed case keywords (ie: 13jKm or 13JKm) + * Stick to one setting. It's best not to change after you've started creating links. + */ + +/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ +define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); + +/** + * Reserved keywords (so that generated URLs won't match them) + * Define here negative, unwanted or potentially misleading keywords. + */ +$yourls_reserved_URL = [ + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', +]; + +/* + ** Personal settings would go after here. + */ diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh new file mode 100755 index 0000000..eb6e6d0 --- /dev/null +++ b/apache/docker-entrypoint.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -euo pipefail + +if [ ! -e /var/www/html/yourls-loader.php ]; then + tar cf - --one-file-system -C /usr/src/yourls . | tar xf - + chown -R www-data:www-data /var/www/html +fi + +if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then + if [ "$(id -u)" = '0' ]; then + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -e /var/www/html/user/config.php ] || [ ! -s /var/www/html/user/config.php ]; then + cp /var/www/html/user/config-docker.php /var/www/html/user/config.php + chown www-data:www-data /var/www/html/user/config.php + fi + + : "${YOURLS_USER:=}" + : "${YOURLS_PASS:=}" + if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) + echo "$result" > /var/www/html/user/config.php + fi + + TERM=dumb php -- <<'EOPHP' +connect_error) { + fwrite($stderr, "\nMySQL Connection Error: ({$mysql->connect_errno}) {$mysql->connect_error}\n"); + --$maxTries; + if ($maxTries <= 0) { + exit(1); + } + sleep(3); + } +} while ($mysql->connect_error); + +if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `'.$mysql->real_escape_string(YOURLS_DB_NAME).'`')) { + fwrite($stderr, "\nMySQL \"CREATE DATABASE\" Error: {$mysql->error}\n"); + $mysql->close(); + exit(1); +} + +$mysql->close(); +EOPHP + fi +fi + +exec "$@" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile new file mode 100644 index 0000000..cc279ec --- /dev/null +++ b/fpm-alpine/Dockerfile @@ -0,0 +1,38 @@ +FROM php:8.0-fpm-alpine + +# SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# install the PHP extensions we need +RUN set -eux; \ + docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + +# set recommended PHP.ini settings +# see https://secure.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.fast_shutdown=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + +RUN apk add --no-cache bash + +ENV YOURLS_VERSION 1.8.1 +ENV YOURLS_SHA256 92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4 + +RUN set -eux; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ + echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + tar -xf yourls.tar.gz -C /usr/src/; \ +# move back to a common /usr/src/yourls + mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + rm yourls.tar.gz; \ + chown -R www-data:www-data /usr/src/yourls + +COPY docker-entrypoint.sh /usr/local/bin/ +COPY config-docker.php /usr/src/yourls/user/ + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["php-fpm"] diff --git a/fpm-alpine/config-docker.php b/fpm-alpine/config-docker.php new file mode 100644 index 0000000..ea28847 --- /dev/null +++ b/fpm-alpine/config-docker.php @@ -0,0 +1,107 @@ + getenv_docker('YOURLS_PASS'), +]; + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); + +/* +** URL Shortening settings +*/ + +/** URL shortening method: 36 or 62 */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); +/* + * 36: generates all lowercase keywords (ie: 13jkm) + * 62: generates mixed case keywords (ie: 13jKm or 13JKm) + * Stick to one setting. It's best not to change after you've started creating links. + */ + +/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ +define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); + +/** + * Reserved keywords (so that generated URLs won't match them) + * Define here negative, unwanted or potentially misleading keywords. + */ +$yourls_reserved_URL = [ + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', +]; + +/* + ** Personal settings would go after here. + */ diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh new file mode 100755 index 0000000..eb6e6d0 --- /dev/null +++ b/fpm-alpine/docker-entrypoint.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -euo pipefail + +if [ ! -e /var/www/html/yourls-loader.php ]; then + tar cf - --one-file-system -C /usr/src/yourls . | tar xf - + chown -R www-data:www-data /var/www/html +fi + +if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then + if [ "$(id -u)" = '0' ]; then + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -e /var/www/html/user/config.php ] || [ ! -s /var/www/html/user/config.php ]; then + cp /var/www/html/user/config-docker.php /var/www/html/user/config.php + chown www-data:www-data /var/www/html/user/config.php + fi + + : "${YOURLS_USER:=}" + : "${YOURLS_PASS:=}" + if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) + echo "$result" > /var/www/html/user/config.php + fi + + TERM=dumb php -- <<'EOPHP' +connect_error) { + fwrite($stderr, "\nMySQL Connection Error: ({$mysql->connect_errno}) {$mysql->connect_error}\n"); + --$maxTries; + if ($maxTries <= 0) { + exit(1); + } + sleep(3); + } +} while ($mysql->connect_error); + +if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `'.$mysql->real_escape_string(YOURLS_DB_NAME).'`')) { + fwrite($stderr, "\nMySQL \"CREATE DATABASE\" Error: {$mysql->error}\n"); + $mysql->close(); + exit(1); +} + +$mysql->close(); +EOPHP + fi +fi + +exec "$@" diff --git a/fpm/Dockerfile b/fpm/Dockerfile new file mode 100644 index 0000000..2564bc3 --- /dev/null +++ b/fpm/Dockerfile @@ -0,0 +1,37 @@ +FROM php:8.0-fpm + +# SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# install the PHP extensions we need +RUN set -eux; \ + docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + +# set recommended PHP.ini settings +# see https://secure.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.fast_shutdown=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + + +ENV YOURLS_VERSION 1.8.1 +ENV YOURLS_SHA256 92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4 + +RUN set -eux; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ + echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + tar -xf yourls.tar.gz -C /usr/src/; \ +# move back to a common /usr/src/yourls + mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + rm yourls.tar.gz; \ + chown -R www-data:www-data /usr/src/yourls + +COPY docker-entrypoint.sh /usr/local/bin/ +COPY config-docker.php /usr/src/yourls/user/ + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["php-fpm"] diff --git a/fpm/config-docker.php b/fpm/config-docker.php new file mode 100644 index 0000000..ea28847 --- /dev/null +++ b/fpm/config-docker.php @@ -0,0 +1,107 @@ + getenv_docker('YOURLS_PASS'), +]; + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); + +/* +** URL Shortening settings +*/ + +/** URL shortening method: 36 or 62 */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); +/* + * 36: generates all lowercase keywords (ie: 13jkm) + * 62: generates mixed case keywords (ie: 13jKm or 13JKm) + * Stick to one setting. It's best not to change after you've started creating links. + */ + +/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ +define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); + +/** + * Reserved keywords (so that generated URLs won't match them) + * Define here negative, unwanted or potentially misleading keywords. + */ +$yourls_reserved_URL = [ + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', +]; + +/* + ** Personal settings would go after here. + */ diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh new file mode 100755 index 0000000..eb6e6d0 --- /dev/null +++ b/fpm/docker-entrypoint.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -euo pipefail + +if [ ! -e /var/www/html/yourls-loader.php ]; then + tar cf - --one-file-system -C /usr/src/yourls . | tar xf - + chown -R www-data:www-data /var/www/html +fi + +if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then + if [ "$(id -u)" = '0' ]; then + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -e /var/www/html/user/config.php ] || [ ! -s /var/www/html/user/config.php ]; then + cp /var/www/html/user/config-docker.php /var/www/html/user/config.php + chown www-data:www-data /var/www/html/user/config.php + fi + + : "${YOURLS_USER:=}" + : "${YOURLS_PASS:=}" + if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) + echo "$result" > /var/www/html/user/config.php + fi + + TERM=dumb php -- <<'EOPHP' +connect_error) { + fwrite($stderr, "\nMySQL Connection Error: ({$mysql->connect_errno}) {$mysql->connect_error}\n"); + --$maxTries; + if ($maxTries <= 0) { + exit(1); + } + sleep(3); + } +} while ($mysql->connect_error); + +if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `'.$mysql->real_escape_string(YOURLS_DB_NAME).'`')) { + fwrite($stderr, "\nMySQL \"CREATE DATABASE\" Error: {$mysql->error}\n"); + $mysql->close(); + exit(1); +} + +$mysql->close(); +EOPHP + fi +fi + +exec "$@" From c72757a7e60fda39db0406dc1302c0afdbe397aa Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 05:13:53 +0000 Subject: [PATCH 03/75] deploy: 318d943502e43298d5477d2f2a36c88c76eebadb --- bin/generate-variants.sh | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 bin/generate-variants.sh diff --git a/bin/generate-variants.sh b/bin/generate-variants.sh new file mode 100755 index 0000000..d785074 --- /dev/null +++ b/bin/generate-variants.sh @@ -0,0 +1,64 @@ +#!/bin/bash +set -e + +declare -A cmd=( + [apache]='apache2-foreground' + [fpm]='php-fpm' + [fpm-alpine]='php-fpm' +) + +declare -A extras=( + [apache]='\nRUN a2enmod rewrite expires' + [fpm]='' + [fpm-alpine]='\nRUN apk add --no-cache bash' +) + +declare -A files=( + [apache]='COPY .htaccess \/usr\/src\/yourls\/' + [fpm]='' + [fpm-alpine]='' +) + +cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" + +current="$1" +# Using Packagist API +#if [ -z "$current" ]; then +# current="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r '.packages["yourls/yourls"]')" +#fi +#sha256="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r ".packages['yourls/yourls']['${current}'].dist.shasum")" + +# Using GitHub API +if [ -z "$current" ]; then + current="$(curl -fsSL 'https://api.github.com/repos/YOURLS/YOURLS/releases/latest' | jq -r '.tag_name')" +fi +sha256="$(curl -fsSL "https://github.com/YOURLS/YOURLS/archive/${current}.tar.gz" | sha256sum | awk '{ print $1 }')" + +base_folder="$2" + +for variant in apache fpm fpm-alpine; do + mkdir -p "$base_folder$variant" + + cp Dockerfile.template "$base_folder$variant/Dockerfile" + + sed -ri \ + -e 's/%%VARIANT%%/'"$variant"'/' \ + -e 's/%%VARIANT_EXTRAS%%/'"${extras[$variant]}"'/' \ + -e 's/%%VARIANT_FILES%%/'"${files[$variant]}"'/' \ + -e 's/%%VERSION%%/'"$current"'/' \ + -e 's/%%SHA256%%/'"$sha256"'/' \ + -e 's/%%CMD%%/'"${cmd[$variant]}"'/' \ + "$base_folder$variant/Dockerfile" + + cp -a docker-entrypoint.sh "$base_folder$variant/docker-entrypoint.sh" + cp -a config-docker.php "$base_folder$variant/config-docker.php" + + if [ "$variant" = 'apache' ]; then + cp -a yourls.vhost "$base_folder$variant/.htaccess" + fi + + ciVariants="$variant${ciVariants:+, $ciVariants}" +done + +sed -i "s/version:.*/version: [$current]/g" .github/workflows/ci.yml +sed -i "s/variant:.*/variant: [$ciVariants]/g" .github/workflows/ci.yml From 5c5a901b158f5c0170f440947f31536dd010ea60 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 05:15:40 +0000 Subject: [PATCH 04/75] deploy: 8fc73bc253287e74425c4a2ef235afd353788417 --- bin/generate-stackbrew-library.sh | 93 +++++++++++++++++++++++++++++++ bin/generate-variants.sh | 64 --------------------- 2 files changed, 93 insertions(+), 64 deletions(-) create mode 100755 bin/generate-stackbrew-library.sh delete mode 100755 bin/generate-variants.sh diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh new file mode 100755 index 0000000..37aa395 --- /dev/null +++ b/bin/generate-stackbrew-library.sh @@ -0,0 +1,93 @@ +#!/bin/bash +set -eu + +self="$(basename "${BASH_SOURCE[0]}")" +cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" + +# get the most recent commit which modified any of "$@" +fileCommit() { + git log -1 --format='format:%H' HEAD -- "$@" +} + +# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile" +dirCommit() { + local dir="$1"; shift + ( + cd "$dir" + fileCommit \ + Dockerfile \ + "$(git show HEAD:./Dockerfile | awk ' + toupper($1) == "COPY" { + for (i = 2; i < NF; i++) { + print $i + } + } + ')" + ) +} + +getArches() { + local repo="$1"; shift + local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' + + eval "declare -g -A parentRepoToArches=( $( + find . -name 'Dockerfile' -exec awk ' + toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { + print "'"$officialImagesUrl"'" $2 + } + ' '{}' + \ + | sort -u \ + | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' + ) )" +} +getArches 'yourls' + +cat <<-EOH +# this file is generated via https://github.com/YOURLS/docker-yourls/blob/$(fileCommit "$self")/$self + +Maintainers: YOURLS (@YOURLS), + Léo Colombaro (@LeoColomb) +GitRepo: https://github.com/YOURLS/docker-yourls.git +EOH + +# prints "$2$1$3$1...$N" +join() { + local sep="$1"; shift + local out; printf -v out "${sep//%/%%}%s" "$@" + echo "${out#$sep}" +} + +for variant in apache fpm fpm-alpine; do + commit="$(dirCommit "$variant")" + + fullVersion="$(git show "${commit}:${variant}/Dockerfile" | awk '$1 == "ENV" && $2 == "YOURLS_VERSION" { print $3; exit }')" + + versionAliases=() + while [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do + versionAliases+=( "$fullVersion" ) + fullVersion="${fullVersion%[.-]*}" + done + versionAliases+=( + "$fullVersion" + latest + ) + + variantAliases=( "${versionAliases[@]/%/-$variant}" ) + variantAliases=( "${variantAliases[@]//latest-/}" ) + + if [ "$variant" = 'apache' ]; then + variantAliases+=( "${versionAliases[@]}" ) + fi + + variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")" + # shellcheck disable=SC2154 + variantArches="${parentRepoToArches[$variantParent]}" + + echo + cat <<-EOE + Tags: $(join ', ' "${variantAliases[@]}") + Architectures: $(join ', ' $variantArches) + GitCommit: $commit + Directory: $variant + EOE +done diff --git a/bin/generate-variants.sh b/bin/generate-variants.sh deleted file mode 100755 index d785074..0000000 --- a/bin/generate-variants.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -set -e - -declare -A cmd=( - [apache]='apache2-foreground' - [fpm]='php-fpm' - [fpm-alpine]='php-fpm' -) - -declare -A extras=( - [apache]='\nRUN a2enmod rewrite expires' - [fpm]='' - [fpm-alpine]='\nRUN apk add --no-cache bash' -) - -declare -A files=( - [apache]='COPY .htaccess \/usr\/src\/yourls\/' - [fpm]='' - [fpm-alpine]='' -) - -cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" - -current="$1" -# Using Packagist API -#if [ -z "$current" ]; then -# current="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r '.packages["yourls/yourls"]')" -#fi -#sha256="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r ".packages['yourls/yourls']['${current}'].dist.shasum")" - -# Using GitHub API -if [ -z "$current" ]; then - current="$(curl -fsSL 'https://api.github.com/repos/YOURLS/YOURLS/releases/latest' | jq -r '.tag_name')" -fi -sha256="$(curl -fsSL "https://github.com/YOURLS/YOURLS/archive/${current}.tar.gz" | sha256sum | awk '{ print $1 }')" - -base_folder="$2" - -for variant in apache fpm fpm-alpine; do - mkdir -p "$base_folder$variant" - - cp Dockerfile.template "$base_folder$variant/Dockerfile" - - sed -ri \ - -e 's/%%VARIANT%%/'"$variant"'/' \ - -e 's/%%VARIANT_EXTRAS%%/'"${extras[$variant]}"'/' \ - -e 's/%%VARIANT_FILES%%/'"${files[$variant]}"'/' \ - -e 's/%%VERSION%%/'"$current"'/' \ - -e 's/%%SHA256%%/'"$sha256"'/' \ - -e 's/%%CMD%%/'"${cmd[$variant]}"'/' \ - "$base_folder$variant/Dockerfile" - - cp -a docker-entrypoint.sh "$base_folder$variant/docker-entrypoint.sh" - cp -a config-docker.php "$base_folder$variant/config-docker.php" - - if [ "$variant" = 'apache' ]; then - cp -a yourls.vhost "$base_folder$variant/.htaccess" - fi - - ciVariants="$variant${ciVariants:+, $ciVariants}" -done - -sed -i "s/version:.*/version: [$current]/g" .github/workflows/ci.yml -sed -i "s/variant:.*/variant: [$ciVariants]/g" .github/workflows/ci.yml From a358b4f51a61732a89347ba35d59c7bc4c65f6e6 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 18:37:39 +0000 Subject: [PATCH 05/75] deploy: 4675fb1c8687f72efea1e7fd7277f4e1575b5343 --- bin/generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 37aa395..50fbeaf 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eu -self="$(basename "${BASH_SOURCE[0]}")" +self="bin/$(basename "${BASH_SOURCE[0]}")" cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" # get the most recent commit which modified any of "$@" From 0b8dc066336508aeafae001698f970af7ca1ec27 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 22:02:24 +0000 Subject: [PATCH 06/75] deploy: 4014dcb6627c187013d06e0237167dfcab1c2cb9 --- bin/generate-stackbrew-library.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 50fbeaf..0e01795 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -48,6 +48,7 @@ cat <<-EOH Maintainers: YOURLS (@YOURLS), Léo Colombaro (@LeoColomb) GitRepo: https://github.com/YOURLS/docker-yourls.git +GitFetch: refs/heads/dist EOH # prints "$2$1$3$1...$N" From cc85f4664f08acb938177e82c31179d5b1c3030f Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 22:53:14 +0000 Subject: [PATCH 07/75] deploy: ca8daea5b2f2253abe041c67c93ce78d6bbe2a1a --- bin/generate-aliases.sh | 30 ++++++++++++++++++++++++++++++ bin/generate-stackbrew-library.sh | 21 +-------------------- 2 files changed, 31 insertions(+), 20 deletions(-) create mode 100755 bin/generate-aliases.sh diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh new file mode 100755 index 0000000..238411b --- /dev/null +++ b/bin/generate-aliases.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +variant="$1" +commit="$(dirCommit "$variant")" + +fullVersion="$(git show "${commit}:${variant}/Dockerfile" | awk '$1 == "ENV" && $2 == "YOURLS_VERSION" { print $3; exit }')" + +versionAliases=() +while [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do + versionAliases+=( "$fullVersion" ) + fullVersion="${fullVersion%[.-]*}" +done +versionAliases+=( + "$fullVersion" + latest +) + +variantAliases=( "${versionAliases[@]/%/-$variant}" ) +variantAliases=( "${variantAliases[@]//latest-/}" ) + +if [ "$variant" = 'apache' ]; then + variantAliases+=( "${versionAliases[@]}" ) +fi + +if [ -n "$2" ]; then + variantAliases=( "${versionAliases[@]/#/$2:}" ) +fi + +echo "$variantAliases" diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 0e01795..a2ab6ac 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -59,26 +59,7 @@ join() { } for variant in apache fpm fpm-alpine; do - commit="$(dirCommit "$variant")" - - fullVersion="$(git show "${commit}:${variant}/Dockerfile" | awk '$1 == "ENV" && $2 == "YOURLS_VERSION" { print $3; exit }')" - - versionAliases=() - while [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do - versionAliases+=( "$fullVersion" ) - fullVersion="${fullVersion%[.-]*}" - done - versionAliases+=( - "$fullVersion" - latest - ) - - variantAliases=( "${versionAliases[@]/%/-$variant}" ) - variantAliases=( "${variantAliases[@]//latest-/}" ) - - if [ "$variant" = 'apache' ]; then - variantAliases+=( "${versionAliases[@]}" ) - fi + variantAliases=$(./bin/generate-aliases.sh "$variant") variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")" # shellcheck disable=SC2154 From 28d315acd0b06913dcbf926c9adfa8792a5aa827 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 23:03:54 +0000 Subject: [PATCH 08/75] deploy: 0e0433034e160a5460a9619863f15bf506b4c03a --- bin/functions.sh | 46 +++++++++++++++++++++++ bin/generate-aliases.sh | 2 + bin/generate-stackbrew-library.sh | 45 +---------------------- bin/generate-variants.sh | 61 +++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 43 deletions(-) create mode 100755 bin/functions.sh create mode 100755 bin/generate-variants.sh diff --git a/bin/functions.sh b/bin/functions.sh new file mode 100755 index 0000000..17ee895 --- /dev/null +++ b/bin/functions.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e + +# get the most recent commit which modified any of "$@" +fileCommit() { + git log -1 --format='format:%H' HEAD -- "$@" +} + +# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile" +dirCommit() { + local dir="$1"; shift + ( + cd "$dir" + fileCommit \ + Dockerfile \ + "$(git show HEAD:./Dockerfile | awk ' + toupper($1) == "COPY" { + for (i = 2; i < NF; i++) { + print $i + } + } + ')" + ) +} + +getArches() { + local repo="$1"; shift + local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' + + eval "declare -g -A parentRepoToArches=( $( + find . -name 'Dockerfile' -exec awk ' + toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { + print "'"$officialImagesUrl"'" $2 + } + ' '{}' + \ + | sort -u \ + | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' + ) )" +} + +# prints "$2$1$3$1...$N" +join() { + local sep="$1"; shift + local out; printf -v out "${sep//%/%%}%s" "$@" + echo "${out#$sep}" +} diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh index 238411b..b12cd12 100755 --- a/bin/generate-aliases.sh +++ b/bin/generate-aliases.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +source ./functions.sh + variant="$1" commit="$(dirCommit "$variant")" diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index a2ab6ac..f0fcc07 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -1,45 +1,11 @@ #!/bin/bash set -eu +source ./functions.sh + self="bin/$(basename "${BASH_SOURCE[0]}")" cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" -# get the most recent commit which modified any of "$@" -fileCommit() { - git log -1 --format='format:%H' HEAD -- "$@" -} - -# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile" -dirCommit() { - local dir="$1"; shift - ( - cd "$dir" - fileCommit \ - Dockerfile \ - "$(git show HEAD:./Dockerfile | awk ' - toupper($1) == "COPY" { - for (i = 2; i < NF; i++) { - print $i - } - } - ')" - ) -} - -getArches() { - local repo="$1"; shift - local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' - - eval "declare -g -A parentRepoToArches=( $( - find . -name 'Dockerfile' -exec awk ' - toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { - print "'"$officialImagesUrl"'" $2 - } - ' '{}' + \ - | sort -u \ - | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' - ) )" -} getArches 'yourls' cat <<-EOH @@ -51,13 +17,6 @@ GitRepo: https://github.com/YOURLS/docker-yourls.git GitFetch: refs/heads/dist EOH -# prints "$2$1$3$1...$N" -join() { - local sep="$1"; shift - local out; printf -v out "${sep//%/%%}%s" "$@" - echo "${out#$sep}" -} - for variant in apache fpm fpm-alpine; do variantAliases=$(./bin/generate-aliases.sh "$variant") diff --git a/bin/generate-variants.sh b/bin/generate-variants.sh new file mode 100755 index 0000000..fcc0c92 --- /dev/null +++ b/bin/generate-variants.sh @@ -0,0 +1,61 @@ +#!/bin/bash +set -e + +declare -A cmd=( + [apache]='apache2-foreground' + [fpm]='php-fpm' + [fpm-alpine]='php-fpm' +) + +declare -A extras=( + [apache]='\nRUN a2enmod rewrite expires' + [fpm]='' + [fpm-alpine]='\nRUN apk add --no-cache bash' +) + +declare -A files=( + [apache]='COPY .htaccess \/usr\/src\/yourls\/' + [fpm]='' + [fpm-alpine]='' +) + +cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" + +version="$(head -n 1 yourls_version)" +# Using Packagist API +#if [ -z "$version" ]; then +# version="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r '.packages["yourls/yourls"]')" +#fi +#sha256="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r ".packages['yourls/yourls']['${version}'].dist.shasum")" + +# Using GitHub API +if [ -z "$version" ]; then + version="$(curl -fsSL 'https://api.github.com/repos/YOURLS/YOURLS/releases/latest' | jq -r '.tag_name')" +fi +sha256="$(curl -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz" | sha256sum | awk '{ print $1 }')" + +baseFolder="$1" + +for variant in apache fpm fpm-alpine; do + mkdir -p "$baseFolder$variant" + + cp Dockerfile.template "$baseFolder$variant/Dockerfile" + + sed -ri \ + -e 's/%%VARIANT%%/'"$variant"'/' \ + -e 's/%%VARIANT_EXTRAS%%/'"${extras[$variant]}"'/' \ + -e 's/%%VARIANT_FILES%%/'"${files[$variant]}"'/' \ + -e 's/%%VERSION%%/'"$version"'/' \ + -e 's/%%SHA256%%/'"$sha256"'/' \ + -e 's/%%CMD%%/'"${cmd[$variant]}"'/' \ + "$baseFolder$variant/Dockerfile" + + cp -a docker-entrypoint.sh "$baseFolder$variant/docker-entrypoint.sh" + cp -a config-docker.php "$baseFolder$variant/config-docker.php" + + if [ "$variant" = 'apache' ]; then + cp -a yourls.vhost "$baseFolder$variant/.htaccess" + fi + + ciVariants="$variant${ciVariants:+, $ciVariants}" +done From 493d27b7d3091e1279ff20fa3f19cebe23e6907f Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 23:09:32 +0000 Subject: [PATCH 09/75] deploy: 4c82c62d837bc1f937e3bbc3b9936e6c39a6421f --- bin/generate-aliases.sh | 5 +++-- bin/generate-stackbrew-library.sh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh index b12cd12..3e0a404 100755 --- a/bin/generate-aliases.sh +++ b/bin/generate-aliases.sh @@ -1,7 +1,8 @@ #!/bin/bash set -e -source ./functions.sh +# shellcheck source=functions.sh +source "${BASH_SOURCE[0]%/*}/functions.sh" variant="$1" commit="$(dirCommit "$variant")" @@ -29,4 +30,4 @@ if [ -n "$2" ]; then variantAliases=( "${versionAliases[@]/#/$2:}" ) fi -echo "$variantAliases" +echo "${variantAliases[@]}" diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index f0fcc07..caf2137 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -1,7 +1,8 @@ #!/bin/bash set -eu -source ./functions.sh +# shellcheck source=functions.sh +source "${BASH_SOURCE[0]%/*}/functions.sh" self="bin/$(basename "${BASH_SOURCE[0]}")" cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" From d362597135d1842315c7e11703a2a661f4cde8cf Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 23:19:12 +0000 Subject: [PATCH 10/75] deploy: 40a83054e069aeff99088bd5b298bbdadce0a57a --- bin/generate-aliases.sh | 2 +- bin/generate-stackbrew-library.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh index 3e0a404..d47bbcc 100755 --- a/bin/generate-aliases.sh +++ b/bin/generate-aliases.sh @@ -30,4 +30,4 @@ if [ -n "$2" ]; then variantAliases=( "${versionAliases[@]/#/$2:}" ) fi -echo "${variantAliases[@]}" +echo "$(join ', ' "${variantAliases[@]}")" diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index caf2137..862fc95 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -27,7 +27,7 @@ for variant in apache fpm fpm-alpine; do echo cat <<-EOE - Tags: $(join ', ' "${variantAliases[@]}") + Tags: $variantAliases Architectures: $(join ', ' $variantArches) GitCommit: $commit Directory: $variant From f1756127e0b8eebad4f301d4fe6790f6d9794ce2 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Fri, 19 Mar 2021 23:27:40 +0000 Subject: [PATCH 11/75] deploy: bb4b0f5ff7404040da5171b3337783d63ce336cf --- bin/generate-aliases.sh | 2 +- bin/generate-stackbrew-library.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh index d47bbcc..dd6b31e 100755 --- a/bin/generate-aliases.sh +++ b/bin/generate-aliases.sh @@ -27,7 +27,7 @@ if [ "$variant" = 'apache' ]; then fi if [ -n "$2" ]; then - variantAliases=( "${versionAliases[@]/#/$2:}" ) + variantAliases=( "${variantAliases[@]/#/$2:}" ) fi echo "$(join ', ' "${variantAliases[@]}")" diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 862fc95..3d7c861 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -19,6 +19,7 @@ GitFetch: refs/heads/dist EOH for variant in apache fpm fpm-alpine; do + commit="$(dirCommit "$variant")" variantAliases=$(./bin/generate-aliases.sh "$variant") variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")" From 6b47f916e6b48ac97caa9379c02ccd252edcddb8 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 25 Jul 2021 15:46:07 +0000 Subject: [PATCH 12/75] deploy: e74cd4d5ae34152ba7cd07d16117424751a65977 --- apache/docker-entrypoint.sh | 41 ++------------------------------- fpm-alpine/docker-entrypoint.sh | 41 ++------------------------------- fpm/docker-entrypoint.sh | 41 ++------------------------------- 3 files changed, 6 insertions(+), 117 deletions(-) diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index eb6e6d0..b7f190b 100755 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -1,5 +1,5 @@ -#!/bin/bash -set -euo pipefail +#!/usr/bin/env bash +set -Eeuo pipefail if [ ! -e /var/www/html/yourls-loader.php ]; then tar cf - --one-file-system -C /usr/src/yourls . | tar xf - @@ -24,43 +24,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) echo "$result" > /var/www/html/user/config.php fi - - TERM=dumb php -- <<'EOPHP' -connect_error) { - fwrite($stderr, "\nMySQL Connection Error: ({$mysql->connect_errno}) {$mysql->connect_error}\n"); - --$maxTries; - if ($maxTries <= 0) { - exit(1); - } - sleep(3); - } -} while ($mysql->connect_error); - -if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `'.$mysql->real_escape_string(YOURLS_DB_NAME).'`')) { - fwrite($stderr, "\nMySQL \"CREATE DATABASE\" Error: {$mysql->error}\n"); - $mysql->close(); - exit(1); -} - -$mysql->close(); -EOPHP fi fi diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh index eb6e6d0..b7f190b 100755 --- a/fpm-alpine/docker-entrypoint.sh +++ b/fpm-alpine/docker-entrypoint.sh @@ -1,5 +1,5 @@ -#!/bin/bash -set -euo pipefail +#!/usr/bin/env bash +set -Eeuo pipefail if [ ! -e /var/www/html/yourls-loader.php ]; then tar cf - --one-file-system -C /usr/src/yourls . | tar xf - @@ -24,43 +24,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) echo "$result" > /var/www/html/user/config.php fi - - TERM=dumb php -- <<'EOPHP' -connect_error) { - fwrite($stderr, "\nMySQL Connection Error: ({$mysql->connect_errno}) {$mysql->connect_error}\n"); - --$maxTries; - if ($maxTries <= 0) { - exit(1); - } - sleep(3); - } -} while ($mysql->connect_error); - -if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `'.$mysql->real_escape_string(YOURLS_DB_NAME).'`')) { - fwrite($stderr, "\nMySQL \"CREATE DATABASE\" Error: {$mysql->error}\n"); - $mysql->close(); - exit(1); -} - -$mysql->close(); -EOPHP fi fi diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh index eb6e6d0..b7f190b 100755 --- a/fpm/docker-entrypoint.sh +++ b/fpm/docker-entrypoint.sh @@ -1,5 +1,5 @@ -#!/bin/bash -set -euo pipefail +#!/usr/bin/env bash +set -Eeuo pipefail if [ ! -e /var/www/html/yourls-loader.php ]; then tar cf - --one-file-system -C /usr/src/yourls . | tar xf - @@ -24,43 +24,6 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) echo "$result" > /var/www/html/user/config.php fi - - TERM=dumb php -- <<'EOPHP' -connect_error) { - fwrite($stderr, "\nMySQL Connection Error: ({$mysql->connect_errno}) {$mysql->connect_error}\n"); - --$maxTries; - if ($maxTries <= 0) { - exit(1); - } - sleep(3); - } -} while ($mysql->connect_error); - -if (!$mysql->query('CREATE DATABASE IF NOT EXISTS `'.$mysql->real_escape_string(YOURLS_DB_NAME).'`')) { - fwrite($stderr, "\nMySQL \"CREATE DATABASE\" Error: {$mysql->error}\n"); - $mysql->close(); - exit(1); -} - -$mysql->close(); -EOPHP fi fi From 9b33835d51e0249fc2d400f34bab658820f45a44 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 28 Jul 2021 18:59:39 +0000 Subject: [PATCH 13/75] deploy: 549c92b2722f5dce4813a240ce0a84e1a8bc8729 --- apache/Dockerfile | 26 ++++++---- apache/docker-entrypoint.sh | 92 +++++++++++++++++++++++++++------ fpm-alpine/Dockerfile | 26 ++++++---- fpm-alpine/docker-entrypoint.sh | 92 +++++++++++++++++++++++++++------ fpm/Dockerfile | 26 ++++++---- fpm/docker-entrypoint.sh | 92 +++++++++++++++++++++++++++------ 6 files changed, 279 insertions(+), 75 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 8f1d68b..9177f05 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,6 +1,13 @@ FROM php:8.0-apache -# SHELL ["/bin/bash", "-o", "pipefail", "-c"] +LABEL maintainer="yourls@yourls.org" +LABEL org.opencontainers.image.title="YOURLS" +LABEL org.opencontainers.image.description="Your Own URL Shortener" +LABEL org.opencontainers.image.url="https://yourls.org/" +LABEL org.opencontainers.image.documentation="https://yourls.org/" +LABEL org.opencontainers.image.vendor="YOURLS Org" +LABEL org.opencontainers.image.authors="YOURLS" +LABEL org.opencontainers.image.version="1.8.1" # install the PHP extensions we need RUN set -eux; \ @@ -12,27 +19,26 @@ RUN { \ echo 'opcache.memory_consumption=128'; \ echo 'opcache.interned_strings_buffer=8'; \ echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.revalidate_freq=2'; \ echo 'opcache.fast_shutdown=1'; \ } > /usr/local/etc/php/conf.d/opcache-recommended.ini RUN a2enmod rewrite expires -ENV YOURLS_VERSION 1.8.1 -ENV YOURLS_SHA256 92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4 - RUN set -eux; \ - curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ - echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ -# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + version="1.8.1"; \ + sha256="92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4"; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ + echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} tar -xf yourls.tar.gz -C /usr/src/; \ # move back to a common /usr/src/yourls - mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + mv "/usr/src/YOURLS-${version}" /usr/src/yourls; \ rm yourls.tar.gz; \ chown -R www-data:www-data /usr/src/yourls +COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ COPY docker-entrypoint.sh /usr/local/bin/ -COPY config-docker.php /usr/src/yourls/user/ COPY .htaccess /usr/src/yourls/ ENTRYPOINT ["docker-entrypoint.sh"] CMD ["apache2-foreground"] diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index b7f190b..9435725 100755 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -1,28 +1,90 @@ #!/usr/bin/env bash set -Eeuo pipefail -if [ ! -e /var/www/html/yourls-loader.php ]; then - tar cf - --one-file-system -C /usr/src/yourls . | tar xf - - chown -R www-data:www-data /var/www/html -fi +if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then + uid="$(id -u)" + gid="$(id -g)" + if [ "$uid" = '0' ]; then + case "$1" in + apache2*) + user="${APACHE_RUN_USER:-www-data}" + group="${APACHE_RUN_GROUP:-www-data}" -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then - if [ "$(id -u)" = '0' ]; then - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + # strip off any '#' symbol ('#1000' is valid syntax for Apache) + pound='#' + user="${user#$pound}" + group="${group#$pound}" + ;; + *) # php-fpm + user='www-data' + group='www-data' + ;; + esac + else + user="$uid" + group="$gid" + fi - # We want to copy the initial config if the actual config file doesn't already - # exist OR if it is an empty file (e.g. it has been created for the volume mount). - if [ ! -e /var/www/html/user/config.php ] || [ ! -s /var/www/html/user/config.php ]; then - cp /var/www/html/user/config-docker.php /var/www/html/user/config.php - chown www-data:www-data /var/www/html/user/config.php + if [ ! -e yourls-loader.php ]; then + # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then + chown "$user:$group" . + fi + + echo >&2 "YOURLS not found in $PWD - copying now..." + if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then + echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" + fi + sourceTarArgs=( + --create + --file - + --directory /usr/src/yourls + --owner "$user" --group "$group" + ) + targetTarArgs=( + --extract + --file - + ) + if [ "$uid" != '0' ]; then + # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" + targetTarArgs+=(--no-overwrite-dir) fi + # loop over "pluggable" content in the source, and if it already exists in the destination, skip it + for contentPath in \ + /usr/src/yourls/.htaccess \ + /usr/src/yourls/user/*/*/ \ + ; do + contentPath="${contentPath%/}" + [ -e "$contentPath" ] || continue + contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. + if [ -e "$PWD/$contentPath" ]; then + echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" + sourceTarArgs+=(--exclude "./$contentPath") + fi + done + tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" + echo >&2 "Complete! YOURLS has been successfully copied to $PWD" + fi + + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -s user/config.php ]; then + cp /usr/src/yourls/user/config-docker.php user/config.php : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) - echo "$result" > /var/www/html/user/config.php + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + echo "$result" > user/config.php + fi + + if [ "$uid" = '0' ]; then + # attempt to ensure that wp-config.php is owned by the run user + # could be on a filesystem that doesn't allow chown (like some NFS setups) + chown "$user:$group" wp-config.php || true fi fi fi diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index cc279ec..f311013 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,6 +1,13 @@ FROM php:8.0-fpm-alpine -# SHELL ["/bin/bash", "-o", "pipefail", "-c"] +LABEL maintainer="yourls@yourls.org" +LABEL org.opencontainers.image.title="YOURLS" +LABEL org.opencontainers.image.description="Your Own URL Shortener" +LABEL org.opencontainers.image.url="https://yourls.org/" +LABEL org.opencontainers.image.documentation="https://yourls.org/" +LABEL org.opencontainers.image.vendor="YOURLS Org" +LABEL org.opencontainers.image.authors="YOURLS" +LABEL org.opencontainers.image.version="1.8.1" # install the PHP extensions we need RUN set -eux; \ @@ -12,27 +19,26 @@ RUN { \ echo 'opcache.memory_consumption=128'; \ echo 'opcache.interned_strings_buffer=8'; \ echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.revalidate_freq=2'; \ echo 'opcache.fast_shutdown=1'; \ } > /usr/local/etc/php/conf.d/opcache-recommended.ini RUN apk add --no-cache bash -ENV YOURLS_VERSION 1.8.1 -ENV YOURLS_SHA256 92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4 - RUN set -eux; \ - curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ - echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ -# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + version="1.8.1"; \ + sha256="92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4"; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ + echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} tar -xf yourls.tar.gz -C /usr/src/; \ # move back to a common /usr/src/yourls - mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + mv "/usr/src/YOURLS-${version}" /usr/src/yourls; \ rm yourls.tar.gz; \ chown -R www-data:www-data /usr/src/yourls +COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ COPY docker-entrypoint.sh /usr/local/bin/ -COPY config-docker.php /usr/src/yourls/user/ ENTRYPOINT ["docker-entrypoint.sh"] CMD ["php-fpm"] diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh index b7f190b..9435725 100755 --- a/fpm-alpine/docker-entrypoint.sh +++ b/fpm-alpine/docker-entrypoint.sh @@ -1,28 +1,90 @@ #!/usr/bin/env bash set -Eeuo pipefail -if [ ! -e /var/www/html/yourls-loader.php ]; then - tar cf - --one-file-system -C /usr/src/yourls . | tar xf - - chown -R www-data:www-data /var/www/html -fi +if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then + uid="$(id -u)" + gid="$(id -g)" + if [ "$uid" = '0' ]; then + case "$1" in + apache2*) + user="${APACHE_RUN_USER:-www-data}" + group="${APACHE_RUN_GROUP:-www-data}" -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then - if [ "$(id -u)" = '0' ]; then - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + # strip off any '#' symbol ('#1000' is valid syntax for Apache) + pound='#' + user="${user#$pound}" + group="${group#$pound}" + ;; + *) # php-fpm + user='www-data' + group='www-data' + ;; + esac + else + user="$uid" + group="$gid" + fi - # We want to copy the initial config if the actual config file doesn't already - # exist OR if it is an empty file (e.g. it has been created for the volume mount). - if [ ! -e /var/www/html/user/config.php ] || [ ! -s /var/www/html/user/config.php ]; then - cp /var/www/html/user/config-docker.php /var/www/html/user/config.php - chown www-data:www-data /var/www/html/user/config.php + if [ ! -e yourls-loader.php ]; then + # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then + chown "$user:$group" . + fi + + echo >&2 "YOURLS not found in $PWD - copying now..." + if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then + echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" + fi + sourceTarArgs=( + --create + --file - + --directory /usr/src/yourls + --owner "$user" --group "$group" + ) + targetTarArgs=( + --extract + --file - + ) + if [ "$uid" != '0' ]; then + # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" + targetTarArgs+=(--no-overwrite-dir) fi + # loop over "pluggable" content in the source, and if it already exists in the destination, skip it + for contentPath in \ + /usr/src/yourls/.htaccess \ + /usr/src/yourls/user/*/*/ \ + ; do + contentPath="${contentPath%/}" + [ -e "$contentPath" ] || continue + contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. + if [ -e "$PWD/$contentPath" ]; then + echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" + sourceTarArgs+=(--exclude "./$contentPath") + fi + done + tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" + echo >&2 "Complete! YOURLS has been successfully copied to $PWD" + fi + + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -s user/config.php ]; then + cp /usr/src/yourls/user/config-docker.php user/config.php : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) - echo "$result" > /var/www/html/user/config.php + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + echo "$result" > user/config.php + fi + + if [ "$uid" = '0' ]; then + # attempt to ensure that wp-config.php is owned by the run user + # could be on a filesystem that doesn't allow chown (like some NFS setups) + chown "$user:$group" wp-config.php || true fi fi fi diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 2564bc3..8cd5b69 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,6 +1,13 @@ FROM php:8.0-fpm -# SHELL ["/bin/bash", "-o", "pipefail", "-c"] +LABEL maintainer="yourls@yourls.org" +LABEL org.opencontainers.image.title="YOURLS" +LABEL org.opencontainers.image.description="Your Own URL Shortener" +LABEL org.opencontainers.image.url="https://yourls.org/" +LABEL org.opencontainers.image.documentation="https://yourls.org/" +LABEL org.opencontainers.image.vendor="YOURLS Org" +LABEL org.opencontainers.image.authors="YOURLS" +LABEL org.opencontainers.image.version="1.8.1" # install the PHP extensions we need RUN set -eux; \ @@ -12,26 +19,25 @@ RUN { \ echo 'opcache.memory_consumption=128'; \ echo 'opcache.interned_strings_buffer=8'; \ echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=60'; \ + echo 'opcache.revalidate_freq=2'; \ echo 'opcache.fast_shutdown=1'; \ } > /usr/local/etc/php/conf.d/opcache-recommended.ini -ENV YOURLS_VERSION 1.8.1 -ENV YOURLS_SHA256 92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4 - RUN set -eux; \ - curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ - echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ -# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + version="1.8.1"; \ + sha256="92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4"; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ + echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} tar -xf yourls.tar.gz -C /usr/src/; \ # move back to a common /usr/src/yourls - mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + mv "/usr/src/YOURLS-${version}" /usr/src/yourls; \ rm yourls.tar.gz; \ chown -R www-data:www-data /usr/src/yourls +COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ COPY docker-entrypoint.sh /usr/local/bin/ -COPY config-docker.php /usr/src/yourls/user/ ENTRYPOINT ["docker-entrypoint.sh"] CMD ["php-fpm"] diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh index b7f190b..9435725 100755 --- a/fpm/docker-entrypoint.sh +++ b/fpm/docker-entrypoint.sh @@ -1,28 +1,90 @@ #!/usr/bin/env bash set -Eeuo pipefail -if [ ! -e /var/www/html/yourls-loader.php ]; then - tar cf - --one-file-system -C /usr/src/yourls . | tar xf - - chown -R www-data:www-data /var/www/html -fi +if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then + uid="$(id -u)" + gid="$(id -g)" + if [ "$uid" = '0' ]; then + case "$1" in + apache2*) + user="${APACHE_RUN_USER:-www-data}" + group="${APACHE_RUN_GROUP:-www-data}" -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then - if [ "$(id -u)" = '0' ]; then - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + # strip off any '#' symbol ('#1000' is valid syntax for Apache) + pound='#' + user="${user#$pound}" + group="${group#$pound}" + ;; + *) # php-fpm + user='www-data' + group='www-data' + ;; + esac + else + user="$uid" + group="$gid" + fi - # We want to copy the initial config if the actual config file doesn't already - # exist OR if it is an empty file (e.g. it has been created for the volume mount). - if [ ! -e /var/www/html/user/config.php ] || [ ! -s /var/www/html/user/config.php ]; then - cp /var/www/html/user/config-docker.php /var/www/html/user/config.php - chown www-data:www-data /var/www/html/user/config.php + if [ ! -e yourls-loader.php ]; then + # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then + chown "$user:$group" . + fi + + echo >&2 "YOURLS not found in $PWD - copying now..." + if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then + echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" + fi + sourceTarArgs=( + --create + --file - + --directory /usr/src/yourls + --owner "$user" --group "$group" + ) + targetTarArgs=( + --extract + --file - + ) + if [ "$uid" != '0' ]; then + # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" + targetTarArgs+=(--no-overwrite-dir) fi + # loop over "pluggable" content in the source, and if it already exists in the destination, skip it + for contentPath in \ + /usr/src/yourls/.htaccess \ + /usr/src/yourls/user/*/*/ \ + ; do + contentPath="${contentPath%/}" + [ -e "$contentPath" ] || continue + contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. + if [ -e "$PWD/$contentPath" ]; then + echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" + sourceTarArgs+=(--exclude "./$contentPath") + fi + done + tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" + echo >&2 "Complete! YOURLS has been successfully copied to $PWD" + fi + + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -s user/config.php ]; then + cp /usr/src/yourls/user/config-docker.php user/config.php : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" /var/www/html/user/config.php) - echo "$result" > /var/www/html/user/config.php + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + echo "$result" > user/config.php + fi + + if [ "$uid" = '0' ]; then + # attempt to ensure that wp-config.php is owned by the run user + # could be on a filesystem that doesn't allow chown (like some NFS setups) + chown "$user:$group" wp-config.php || true fi fi fi From 25bcf61e6a59b30c9cc1b4e0addd1a11f2fd227a Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 28 Jul 2021 19:26:28 +0000 Subject: [PATCH 14/75] deploy: 99b5081e9423fd30bba202f725ccdd796ee3280f --- apache/Dockerfile | 1 - bin/generate-aliases.sh | 3 +-- fpm-alpine/Dockerfile | 1 - fpm/Dockerfile | 1 - yourls_version | 1 + 5 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 yourls_version diff --git a/apache/Dockerfile b/apache/Dockerfile index 9177f05..02dde21 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,6 +1,5 @@ FROM php:8.0-apache -LABEL maintainer="yourls@yourls.org" LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" LABEL org.opencontainers.image.url="https://yourls.org/" diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh index dd6b31e..80808b6 100755 --- a/bin/generate-aliases.sh +++ b/bin/generate-aliases.sh @@ -6,8 +6,7 @@ source "${BASH_SOURCE[0]%/*}/functions.sh" variant="$1" commit="$(dirCommit "$variant")" - -fullVersion="$(git show "${commit}:${variant}/Dockerfile" | awk '$1 == "ENV" && $2 == "YOURLS_VERSION" { print $3; exit }')" +fullVersion="$(head -n 1 yourls_version)" versionAliases=() while [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index f311013..c5f38f5 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,6 +1,5 @@ FROM php:8.0-fpm-alpine -LABEL maintainer="yourls@yourls.org" LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" LABEL org.opencontainers.image.url="https://yourls.org/" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 8cd5b69..9e6d8a9 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,6 +1,5 @@ FROM php:8.0-fpm -LABEL maintainer="yourls@yourls.org" LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" LABEL org.opencontainers.image.url="https://yourls.org/" diff --git a/yourls_version b/yourls_version new file mode 100644 index 0000000..a8fdfda --- /dev/null +++ b/yourls_version @@ -0,0 +1 @@ +1.8.1 From 718a26f9f501c6fba49808d004b9d0fade096b12 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 8 Sep 2021 11:45:17 +0000 Subject: [PATCH 15/75] deploy: f1baaa737a0ad338fbb4f0aaa4be8d498eb6e2df --- apache/Dockerfile | 6 +++--- fpm-alpine/Dockerfile | 6 +++--- fpm/Dockerfile | 6 +++--- yourls_version | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 02dde21..17b8f4e 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.url="https://yourls.org/" LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.version="1.8.1" +LABEL org.opencontainers.image.version="1.8.2" # install the PHP extensions we need RUN set -eux; \ @@ -25,8 +25,8 @@ RUN { \ RUN a2enmod rewrite expires RUN set -eux; \ - version="1.8.1"; \ - sha256="92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4"; \ + version="1.8.2"; \ + sha256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae"; \ curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ # upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index c5f38f5..a236528 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.url="https://yourls.org/" LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.version="1.8.1" +LABEL org.opencontainers.image.version="1.8.2" # install the PHP extensions we need RUN set -eux; \ @@ -25,8 +25,8 @@ RUN { \ RUN apk add --no-cache bash RUN set -eux; \ - version="1.8.1"; \ - sha256="92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4"; \ + version="1.8.2"; \ + sha256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae"; \ curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ # upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 9e6d8a9..00205be 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.url="https://yourls.org/" LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.version="1.8.1" +LABEL org.opencontainers.image.version="1.8.2" # install the PHP extensions we need RUN set -eux; \ @@ -24,8 +24,8 @@ RUN { \ RUN set -eux; \ - version="1.8.1"; \ - sha256="92b0666af3e3ad4a783e78cba93687e9a24acf216606a6d457819c5d36d2cfe4"; \ + version="1.8.2"; \ + sha256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae"; \ curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ # upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} diff --git a/yourls_version b/yourls_version index a8fdfda..53adb84 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.8.1 +1.8.2 From d45aa317e596cd457ba90cc62fef10ad3ccfdd34 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sat, 30 Oct 2021 00:55:43 +0000 Subject: [PATCH 16/75] deploy: 4fe274d482243febfbe107557d22857941ab319f --- apache/docker-entrypoint.sh | 4 ++-- fpm-alpine/docker-entrypoint.sh | 4 ++-- fpm/docker-entrypoint.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index 9435725..75ad289 100755 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -82,9 +82,9 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then fi if [ "$uid" = '0' ]; then - # attempt to ensure that wp-config.php is owned by the run user + # attempt to ensure that user/config.php is owned by the run user # could be on a filesystem that doesn't allow chown (like some NFS setups) - chown "$user:$group" wp-config.php || true + chown "$user:$group" user/config.php || true fi fi fi diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh index 9435725..75ad289 100755 --- a/fpm-alpine/docker-entrypoint.sh +++ b/fpm-alpine/docker-entrypoint.sh @@ -82,9 +82,9 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then fi if [ "$uid" = '0' ]; then - # attempt to ensure that wp-config.php is owned by the run user + # attempt to ensure that user/config.php is owned by the run user # could be on a filesystem that doesn't allow chown (like some NFS setups) - chown "$user:$group" wp-config.php || true + chown "$user:$group" user/config.php || true fi fi fi diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh index 9435725..75ad289 100755 --- a/fpm/docker-entrypoint.sh +++ b/fpm/docker-entrypoint.sh @@ -82,9 +82,9 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then fi if [ "$uid" = '0' ]; then - # attempt to ensure that wp-config.php is owned by the run user + # attempt to ensure that user/config.php is owned by the run user # could be on a filesystem that doesn't allow chown (like some NFS setups) - chown "$user:$group" wp-config.php || true + chown "$user:$group" user/config.php || true fi fi fi From d14d5e59418725d5480d6f023b7dd6493236be27 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 31 Oct 2021 19:59:21 +0000 Subject: [PATCH 17/75] deploy: cefed46761a3f70087a81b5897b469f9bdb1fe7f --- bin/generate-stackbrew-library.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 3d7c861..4d4ae10 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -10,11 +10,11 @@ cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" getArches 'yourls' cat <<-EOH -# this file is generated via https://github.com/YOURLS/docker-yourls/blob/$(fileCommit "$self")/$self +# this file is generated via https://github.com/YOURLS/docker/blob/$(fileCommit "$self")/$self Maintainers: YOURLS (@YOURLS), Léo Colombaro (@LeoColomb) -GitRepo: https://github.com/YOURLS/docker-yourls.git +GitRepo: https://github.com/YOURLS/docker.git GitFetch: refs/heads/dist EOH From 194f6035a6f05671e649be6eb96d189353abcc16 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 8 Dec 2021 23:25:57 +0000 Subject: [PATCH 18/75] deploy: f4d0cba0badce91052acb73080fe57effdc7d5a6 --- apache/config-docker.php | 2 +- fpm-alpine/config-docker.php | 2 +- fpm/config-docker.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/config-docker.php b/apache/config-docker.php index ea28847..cf56824 100644 --- a/apache/config-docker.php +++ b/apache/config-docker.php @@ -10,7 +10,7 @@ function getenv_docker(string $name, ?string $default = null): ?string if ($fileEnv = getenv($name . '_FILE')) { return trim(file_get_contents($fileEnv)); } - if ($value = getenv($name)) { + if (($value = getenv($name)) !== false) { return $value; } diff --git a/fpm-alpine/config-docker.php b/fpm-alpine/config-docker.php index ea28847..cf56824 100644 --- a/fpm-alpine/config-docker.php +++ b/fpm-alpine/config-docker.php @@ -10,7 +10,7 @@ function getenv_docker(string $name, ?string $default = null): ?string if ($fileEnv = getenv($name . '_FILE')) { return trim(file_get_contents($fileEnv)); } - if ($value = getenv($name)) { + if (($value = getenv($name)) !== false) { return $value; } diff --git a/fpm/config-docker.php b/fpm/config-docker.php index ea28847..cf56824 100644 --- a/fpm/config-docker.php +++ b/fpm/config-docker.php @@ -10,7 +10,7 @@ function getenv_docker(string $name, ?string $default = null): ?string if ($fileEnv = getenv($name . '_FILE')) { return trim(file_get_contents($fileEnv)); } - if ($value = getenv($name)) { + if (($value = getenv($name)) !== false) { return $value; } From 8cd40dfff4738cb136960ad7d7f67d6c66f0fb9d Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 20 Feb 2022 19:49:39 +0000 Subject: [PATCH 19/75] deploy: 52dd574b010c09a32a34838db66d08667ea9d682 --- apache/.htaccess | 9 --- apache/Dockerfile | 43 ------------ apache/config-docker.php | 107 ------------------------------ apache/docker-entrypoint.sh | 92 ------------------------- bin/functions.sh | 46 ------------- bin/generate-aliases.sh | 32 --------- bin/generate-stackbrew-library.sh | 36 ---------- bin/generate-variants.sh | 61 ----------------- fpm-alpine/Dockerfile | 43 ------------ fpm-alpine/config-docker.php | 107 ------------------------------ fpm-alpine/docker-entrypoint.sh | 92 ------------------------- fpm/Dockerfile | 42 ------------ fpm/config-docker.php | 107 ------------------------------ fpm/docker-entrypoint.sh | 92 ------------------------- yourls_version | 1 - 15 files changed, 910 deletions(-) delete mode 100644 apache/.htaccess delete mode 100644 apache/Dockerfile delete mode 100644 apache/config-docker.php delete mode 100755 apache/docker-entrypoint.sh delete mode 100755 bin/functions.sh delete mode 100755 bin/generate-aliases.sh delete mode 100755 bin/generate-stackbrew-library.sh delete mode 100755 bin/generate-variants.sh delete mode 100644 fpm-alpine/Dockerfile delete mode 100644 fpm-alpine/config-docker.php delete mode 100755 fpm-alpine/docker-entrypoint.sh delete mode 100644 fpm/Dockerfile delete mode 100644 fpm/config-docker.php delete mode 100755 fpm/docker-entrypoint.sh delete mode 100644 yourls_version diff --git a/apache/.htaccess b/apache/.htaccess deleted file mode 100644 index 60bf53e..0000000 --- a/apache/.htaccess +++ /dev/null @@ -1,9 +0,0 @@ -# BEGIN YOURLS - - RewriteEngine On - RewriteBase / - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^.*$ /yourls-loader.php [L] - -# END YOURLS diff --git a/apache/Dockerfile b/apache/Dockerfile deleted file mode 100644 index 17b8f4e..0000000 --- a/apache/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM php:8.0-apache - -LABEL org.opencontainers.image.title="YOURLS" -LABEL org.opencontainers.image.description="Your Own URL Shortener" -LABEL org.opencontainers.image.url="https://yourls.org/" -LABEL org.opencontainers.image.documentation="https://yourls.org/" -LABEL org.opencontainers.image.vendor="YOURLS Org" -LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.version="1.8.2" - -# install the PHP extensions we need -RUN set -eux; \ - docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli - -# set recommended PHP.ini settings -# see https://secure.php.net/manual/en/opcache.installation.php -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=2'; \ - echo 'opcache.fast_shutdown=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -RUN a2enmod rewrite expires - -RUN set -eux; \ - version="1.8.2"; \ - sha256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae"; \ - curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ - echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ -# upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} - tar -xf yourls.tar.gz -C /usr/src/; \ -# move back to a common /usr/src/yourls - mv "/usr/src/YOURLS-${version}" /usr/src/yourls; \ - rm yourls.tar.gz; \ - chown -R www-data:www-data /usr/src/yourls - -COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY docker-entrypoint.sh /usr/local/bin/ -COPY .htaccess /usr/src/yourls/ -ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["apache2-foreground"] diff --git a/apache/config-docker.php b/apache/config-docker.php deleted file mode 100644 index cf56824..0000000 --- a/apache/config-docker.php +++ /dev/null @@ -1,107 +0,0 @@ - getenv_docker('YOURLS_PASS'), -]; - -/** Debug mode to output some internal information - ** Default is false for live site. Enable when coding or before submitting a new issue */ -define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); - -/* -** URL Shortening settings -*/ - -/** URL shortening method: 36 or 62 */ -define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); -/* - * 36: generates all lowercase keywords (ie: 13jkm) - * 62: generates mixed case keywords (ie: 13jKm or 13JKm) - * Stick to one setting. It's best not to change after you've started creating links. - */ - -/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ -define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); - -/** - * Reserved keywords (so that generated URLs won't match them) - * Define here negative, unwanted or potentially misleading keywords. - */ -$yourls_reserved_URL = [ - 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', -]; - -/* - ** Personal settings would go after here. - */ diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh deleted file mode 100755 index 75ad289..0000000 --- a/apache/docker-entrypoint.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then - uid="$(id -u)" - gid="$(id -g)" - if [ "$uid" = '0' ]; then - case "$1" in - apache2*) - user="${APACHE_RUN_USER:-www-data}" - group="${APACHE_RUN_GROUP:-www-data}" - - # strip off any '#' symbol ('#1000' is valid syntax for Apache) - pound='#' - user="${user#$pound}" - group="${group#$pound}" - ;; - *) # php-fpm - user='www-data' - group='www-data' - ;; - esac - else - user="$uid" - group="$gid" - fi - - if [ ! -e yourls-loader.php ]; then - # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . - fi - - echo >&2 "YOURLS not found in $PWD - copying now..." - if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then - echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" - fi - sourceTarArgs=( - --create - --file - - --directory /usr/src/yourls - --owner "$user" --group "$group" - ) - targetTarArgs=( - --extract - --file - - ) - if [ "$uid" != '0' ]; then - # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" - targetTarArgs+=(--no-overwrite-dir) - fi - # loop over "pluggable" content in the source, and if it already exists in the destination, skip it - for contentPath in \ - /usr/src/yourls/.htaccess \ - /usr/src/yourls/user/*/*/ \ - ; do - contentPath="${contentPath%/}" - [ -e "$contentPath" ] || continue - contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. - if [ -e "$PWD/$contentPath" ]; then - echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" - sourceTarArgs+=(--exclude "./$contentPath") - fi - done - tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" - echo >&2 "Complete! YOURLS has been successfully copied to $PWD" - fi - - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" - - # We want to copy the initial config if the actual config file doesn't already - # exist OR if it is an empty file (e.g. it has been created for the volume mount). - if [ ! -s user/config.php ]; then - cp /usr/src/yourls/user/config-docker.php user/config.php - - : "${YOURLS_USER:=}" - : "${YOURLS_PASS:=}" - if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) - echo "$result" > user/config.php - fi - - if [ "$uid" = '0' ]; then - # attempt to ensure that user/config.php is owned by the run user - # could be on a filesystem that doesn't allow chown (like some NFS setups) - chown "$user:$group" user/config.php || true - fi - fi -fi - -exec "$@" diff --git a/bin/functions.sh b/bin/functions.sh deleted file mode 100755 index 17ee895..0000000 --- a/bin/functions.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -set -e - -# get the most recent commit which modified any of "$@" -fileCommit() { - git log -1 --format='format:%H' HEAD -- "$@" -} - -# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile" -dirCommit() { - local dir="$1"; shift - ( - cd "$dir" - fileCommit \ - Dockerfile \ - "$(git show HEAD:./Dockerfile | awk ' - toupper($1) == "COPY" { - for (i = 2; i < NF; i++) { - print $i - } - } - ')" - ) -} - -getArches() { - local repo="$1"; shift - local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' - - eval "declare -g -A parentRepoToArches=( $( - find . -name 'Dockerfile' -exec awk ' - toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { - print "'"$officialImagesUrl"'" $2 - } - ' '{}' + \ - | sort -u \ - | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' - ) )" -} - -# prints "$2$1$3$1...$N" -join() { - local sep="$1"; shift - local out; printf -v out "${sep//%/%%}%s" "$@" - echo "${out#$sep}" -} diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh deleted file mode 100755 index 80808b6..0000000 --- a/bin/generate-aliases.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -set -e - -# shellcheck source=functions.sh -source "${BASH_SOURCE[0]%/*}/functions.sh" - -variant="$1" -commit="$(dirCommit "$variant")" -fullVersion="$(head -n 1 yourls_version)" - -versionAliases=() -while [ "${fullVersion%[.-]*}" != "$fullVersion" ]; do - versionAliases+=( "$fullVersion" ) - fullVersion="${fullVersion%[.-]*}" -done -versionAliases+=( - "$fullVersion" - latest -) - -variantAliases=( "${versionAliases[@]/%/-$variant}" ) -variantAliases=( "${variantAliases[@]//latest-/}" ) - -if [ "$variant" = 'apache' ]; then - variantAliases+=( "${versionAliases[@]}" ) -fi - -if [ -n "$2" ]; then - variantAliases=( "${variantAliases[@]/#/$2:}" ) -fi - -echo "$(join ', ' "${variantAliases[@]}")" diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh deleted file mode 100755 index 4d4ae10..0000000 --- a/bin/generate-stackbrew-library.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -set -eu - -# shellcheck source=functions.sh -source "${BASH_SOURCE[0]%/*}/functions.sh" - -self="bin/$(basename "${BASH_SOURCE[0]}")" -cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" - -getArches 'yourls' - -cat <<-EOH -# this file is generated via https://github.com/YOURLS/docker/blob/$(fileCommit "$self")/$self - -Maintainers: YOURLS (@YOURLS), - Léo Colombaro (@LeoColomb) -GitRepo: https://github.com/YOURLS/docker.git -GitFetch: refs/heads/dist -EOH - -for variant in apache fpm fpm-alpine; do - commit="$(dirCommit "$variant")" - variantAliases=$(./bin/generate-aliases.sh "$variant") - - variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")" - # shellcheck disable=SC2154 - variantArches="${parentRepoToArches[$variantParent]}" - - echo - cat <<-EOE - Tags: $variantAliases - Architectures: $(join ', ' $variantArches) - GitCommit: $commit - Directory: $variant - EOE -done diff --git a/bin/generate-variants.sh b/bin/generate-variants.sh deleted file mode 100755 index fcc0c92..0000000 --- a/bin/generate-variants.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -set -e - -declare -A cmd=( - [apache]='apache2-foreground' - [fpm]='php-fpm' - [fpm-alpine]='php-fpm' -) - -declare -A extras=( - [apache]='\nRUN a2enmod rewrite expires' - [fpm]='' - [fpm-alpine]='\nRUN apk add --no-cache bash' -) - -declare -A files=( - [apache]='COPY .htaccess \/usr\/src\/yourls\/' - [fpm]='' - [fpm-alpine]='' -) - -cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" - -version="$(head -n 1 yourls_version)" -# Using Packagist API -#if [ -z "$version" ]; then -# version="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r '.packages["yourls/yourls"]')" -#fi -#sha256="$(curl -fsSL 'https://packagist.org/p/yourls/yourls.json' | jq -r ".packages['yourls/yourls']['${version}'].dist.shasum")" - -# Using GitHub API -if [ -z "$version" ]; then - version="$(curl -fsSL 'https://api.github.com/repos/YOURLS/YOURLS/releases/latest' | jq -r '.tag_name')" -fi -sha256="$(curl -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz" | sha256sum | awk '{ print $1 }')" - -baseFolder="$1" - -for variant in apache fpm fpm-alpine; do - mkdir -p "$baseFolder$variant" - - cp Dockerfile.template "$baseFolder$variant/Dockerfile" - - sed -ri \ - -e 's/%%VARIANT%%/'"$variant"'/' \ - -e 's/%%VARIANT_EXTRAS%%/'"${extras[$variant]}"'/' \ - -e 's/%%VARIANT_FILES%%/'"${files[$variant]}"'/' \ - -e 's/%%VERSION%%/'"$version"'/' \ - -e 's/%%SHA256%%/'"$sha256"'/' \ - -e 's/%%CMD%%/'"${cmd[$variant]}"'/' \ - "$baseFolder$variant/Dockerfile" - - cp -a docker-entrypoint.sh "$baseFolder$variant/docker-entrypoint.sh" - cp -a config-docker.php "$baseFolder$variant/config-docker.php" - - if [ "$variant" = 'apache' ]; then - cp -a yourls.vhost "$baseFolder$variant/.htaccess" - fi - - ciVariants="$variant${ciVariants:+, $ciVariants}" -done diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile deleted file mode 100644 index a236528..0000000 --- a/fpm-alpine/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM php:8.0-fpm-alpine - -LABEL org.opencontainers.image.title="YOURLS" -LABEL org.opencontainers.image.description="Your Own URL Shortener" -LABEL org.opencontainers.image.url="https://yourls.org/" -LABEL org.opencontainers.image.documentation="https://yourls.org/" -LABEL org.opencontainers.image.vendor="YOURLS Org" -LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.version="1.8.2" - -# install the PHP extensions we need -RUN set -eux; \ - docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli - -# set recommended PHP.ini settings -# see https://secure.php.net/manual/en/opcache.installation.php -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=2'; \ - echo 'opcache.fast_shutdown=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - -RUN apk add --no-cache bash - -RUN set -eux; \ - version="1.8.2"; \ - sha256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae"; \ - curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ - echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ -# upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} - tar -xf yourls.tar.gz -C /usr/src/; \ -# move back to a common /usr/src/yourls - mv "/usr/src/YOURLS-${version}" /usr/src/yourls; \ - rm yourls.tar.gz; \ - chown -R www-data:www-data /usr/src/yourls - -COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY docker-entrypoint.sh /usr/local/bin/ - -ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["php-fpm"] diff --git a/fpm-alpine/config-docker.php b/fpm-alpine/config-docker.php deleted file mode 100644 index cf56824..0000000 --- a/fpm-alpine/config-docker.php +++ /dev/null @@ -1,107 +0,0 @@ - getenv_docker('YOURLS_PASS'), -]; - -/** Debug mode to output some internal information - ** Default is false for live site. Enable when coding or before submitting a new issue */ -define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); - -/* -** URL Shortening settings -*/ - -/** URL shortening method: 36 or 62 */ -define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); -/* - * 36: generates all lowercase keywords (ie: 13jkm) - * 62: generates mixed case keywords (ie: 13jKm or 13JKm) - * Stick to one setting. It's best not to change after you've started creating links. - */ - -/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ -define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); - -/** - * Reserved keywords (so that generated URLs won't match them) - * Define here negative, unwanted or potentially misleading keywords. - */ -$yourls_reserved_URL = [ - 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', -]; - -/* - ** Personal settings would go after here. - */ diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh deleted file mode 100755 index 75ad289..0000000 --- a/fpm-alpine/docker-entrypoint.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then - uid="$(id -u)" - gid="$(id -g)" - if [ "$uid" = '0' ]; then - case "$1" in - apache2*) - user="${APACHE_RUN_USER:-www-data}" - group="${APACHE_RUN_GROUP:-www-data}" - - # strip off any '#' symbol ('#1000' is valid syntax for Apache) - pound='#' - user="${user#$pound}" - group="${group#$pound}" - ;; - *) # php-fpm - user='www-data' - group='www-data' - ;; - esac - else - user="$uid" - group="$gid" - fi - - if [ ! -e yourls-loader.php ]; then - # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . - fi - - echo >&2 "YOURLS not found in $PWD - copying now..." - if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then - echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" - fi - sourceTarArgs=( - --create - --file - - --directory /usr/src/yourls - --owner "$user" --group "$group" - ) - targetTarArgs=( - --extract - --file - - ) - if [ "$uid" != '0' ]; then - # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" - targetTarArgs+=(--no-overwrite-dir) - fi - # loop over "pluggable" content in the source, and if it already exists in the destination, skip it - for contentPath in \ - /usr/src/yourls/.htaccess \ - /usr/src/yourls/user/*/*/ \ - ; do - contentPath="${contentPath%/}" - [ -e "$contentPath" ] || continue - contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. - if [ -e "$PWD/$contentPath" ]; then - echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" - sourceTarArgs+=(--exclude "./$contentPath") - fi - done - tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" - echo >&2 "Complete! YOURLS has been successfully copied to $PWD" - fi - - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" - - # We want to copy the initial config if the actual config file doesn't already - # exist OR if it is an empty file (e.g. it has been created for the volume mount). - if [ ! -s user/config.php ]; then - cp /usr/src/yourls/user/config-docker.php user/config.php - - : "${YOURLS_USER:=}" - : "${YOURLS_PASS:=}" - if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) - echo "$result" > user/config.php - fi - - if [ "$uid" = '0' ]; then - # attempt to ensure that user/config.php is owned by the run user - # could be on a filesystem that doesn't allow chown (like some NFS setups) - chown "$user:$group" user/config.php || true - fi - fi -fi - -exec "$@" diff --git a/fpm/Dockerfile b/fpm/Dockerfile deleted file mode 100644 index 00205be..0000000 --- a/fpm/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM php:8.0-fpm - -LABEL org.opencontainers.image.title="YOURLS" -LABEL org.opencontainers.image.description="Your Own URL Shortener" -LABEL org.opencontainers.image.url="https://yourls.org/" -LABEL org.opencontainers.image.documentation="https://yourls.org/" -LABEL org.opencontainers.image.vendor="YOURLS Org" -LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.version="1.8.2" - -# install the PHP extensions we need -RUN set -eux; \ - docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli - -# set recommended PHP.ini settings -# see https://secure.php.net/manual/en/opcache.installation.php -RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=2'; \ - echo 'opcache.fast_shutdown=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini - - -RUN set -eux; \ - version="1.8.2"; \ - sha256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae"; \ - curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${version}.tar.gz"; \ - echo "$sha256 *yourls.tar.gz" | sha256sum -c -; \ -# upstream tarballs include ./YOURLS-${version}/ so this gives us /usr/src/YOURLS-${version} - tar -xf yourls.tar.gz -C /usr/src/; \ -# move back to a common /usr/src/yourls - mv "/usr/src/YOURLS-${version}" /usr/src/yourls; \ - rm yourls.tar.gz; \ - chown -R www-data:www-data /usr/src/yourls - -COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY docker-entrypoint.sh /usr/local/bin/ - -ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["php-fpm"] diff --git a/fpm/config-docker.php b/fpm/config-docker.php deleted file mode 100644 index cf56824..0000000 --- a/fpm/config-docker.php +++ /dev/null @@ -1,107 +0,0 @@ - getenv_docker('YOURLS_PASS'), -]; - -/** Debug mode to output some internal information - ** Default is false for live site. Enable when coding or before submitting a new issue */ -define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); - -/* -** URL Shortening settings -*/ - -/** URL shortening method: 36 or 62 */ -define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); -/* - * 36: generates all lowercase keywords (ie: 13jkm) - * 62: generates mixed case keywords (ie: 13jKm or 13JKm) - * Stick to one setting. It's best not to change after you've started creating links. - */ - -/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ -define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); - -/** - * Reserved keywords (so that generated URLs won't match them) - * Define here negative, unwanted or potentially misleading keywords. - */ -$yourls_reserved_URL = [ - 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', -]; - -/* - ** Personal settings would go after here. - */ diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh deleted file mode 100755 index 75ad289..0000000 --- a/fpm/docker-entrypoint.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then - uid="$(id -u)" - gid="$(id -g)" - if [ "$uid" = '0' ]; then - case "$1" in - apache2*) - user="${APACHE_RUN_USER:-www-data}" - group="${APACHE_RUN_GROUP:-www-data}" - - # strip off any '#' symbol ('#1000' is valid syntax for Apache) - pound='#' - user="${user#$pound}" - group="${group#$pound}" - ;; - *) # php-fpm - user='www-data' - group='www-data' - ;; - esac - else - user="$uid" - group="$gid" - fi - - if [ ! -e yourls-loader.php ]; then - # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) - if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then - chown "$user:$group" . - fi - - echo >&2 "YOURLS not found in $PWD - copying now..." - if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then - echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" - fi - sourceTarArgs=( - --create - --file - - --directory /usr/src/yourls - --owner "$user" --group "$group" - ) - targetTarArgs=( - --extract - --file - - ) - if [ "$uid" != '0' ]; then - # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" - targetTarArgs+=(--no-overwrite-dir) - fi - # loop over "pluggable" content in the source, and if it already exists in the destination, skip it - for contentPath in \ - /usr/src/yourls/.htaccess \ - /usr/src/yourls/user/*/*/ \ - ; do - contentPath="${contentPath%/}" - [ -e "$contentPath" ] || continue - contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. - if [ -e "$PWD/$contentPath" ]; then - echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" - sourceTarArgs+=(--exclude "./$contentPath") - fi - done - tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" - echo >&2 "Complete! YOURLS has been successfully copied to $PWD" - fi - - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" - - # We want to copy the initial config if the actual config file doesn't already - # exist OR if it is an empty file (e.g. it has been created for the volume mount). - if [ ! -s user/config.php ]; then - cp /usr/src/yourls/user/config-docker.php user/config.php - - : "${YOURLS_USER:=}" - : "${YOURLS_PASS:=}" - if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) - echo "$result" > user/config.php - fi - - if [ "$uid" = '0' ]; then - # attempt to ensure that user/config.php is owned by the run user - # could be on a filesystem that doesn't allow chown (like some NFS setups) - chown "$user:$group" user/config.php || true - fi - fi -fi - -exec "$@" diff --git a/yourls_version b/yourls_version deleted file mode 100644 index 53adb84..0000000 --- a/yourls_version +++ /dev/null @@ -1 +0,0 @@ -1.8.2 From 274a62bff436d6cd3dd2d5544e8dceec84cd4477 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 20 Feb 2022 23:29:11 +0000 Subject: [PATCH 20/75] deploy: e97e1a0c084011a91dcd4a9cbbebec35981b9c94 --- apache/.htaccess | 9 +++ apache/Dockerfile | 49 ++++++++++++++ apache/config-docker.php | 107 ++++++++++++++++++++++++++++++ apache/docker-entrypoint.sh | 92 +++++++++++++++++++++++++ bin/functions.sh | 46 +++++++++++++ bin/generate-aliases.sh | 31 +++++++++ bin/generate-stackbrew-library.sh | 36 ++++++++++ fpm-alpine/Dockerfile | 49 ++++++++++++++ fpm-alpine/config-docker.php | 107 ++++++++++++++++++++++++++++++ fpm-alpine/docker-entrypoint.sh | 92 +++++++++++++++++++++++++ fpm/Dockerfile | 49 ++++++++++++++ fpm/config-docker.php | 107 ++++++++++++++++++++++++++++++ fpm/docker-entrypoint.sh | 92 +++++++++++++++++++++++++ 13 files changed, 866 insertions(+) create mode 100644 apache/.htaccess create mode 100644 apache/Dockerfile create mode 100644 apache/config-docker.php create mode 100644 apache/docker-entrypoint.sh create mode 100755 bin/functions.sh create mode 100755 bin/generate-aliases.sh create mode 100755 bin/generate-stackbrew-library.sh create mode 100644 fpm-alpine/Dockerfile create mode 100644 fpm-alpine/config-docker.php create mode 100644 fpm-alpine/docker-entrypoint.sh create mode 100644 fpm/Dockerfile create mode 100644 fpm/config-docker.php create mode 100644 fpm/docker-entrypoint.sh diff --git a/apache/.htaccess b/apache/.htaccess new file mode 100644 index 0000000..60bf53e --- /dev/null +++ b/apache/.htaccess @@ -0,0 +1,9 @@ +# BEGIN YOURLS + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.*$ /yourls-loader.php [L] + +# END YOURLS diff --git a/apache/Dockerfile b/apache/Dockerfile new file mode 100644 index 0000000..8e52fa0 --- /dev/null +++ b/apache/Dockerfile @@ -0,0 +1,49 @@ +ARG PHP_VERSION="8.0" +ARG PHP_VARIANT="apache" + +FROM php:${PHP_VERSION}-${PHP_VARIANT} + +ARG YOURLS_VERSION="1.8.2" +ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" + +LABEL org.opencontainers.image.title="YOURLS" +LABEL org.opencontainers.image.description="Your Own URL Shortener" +LABEL org.opencontainers.image.url="https://yourls.org/" +LABEL org.opencontainers.image.documentation="https://yourls.org/" +LABEL org.opencontainers.image.vendor="YOURLS Org" +LABEL org.opencontainers.image.authors="YOURLS" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.version="$YOURLS_VERSION" +LABEL org.opencontainers.image.base.name="docker.io/library/php:${PHP_VERSION}-${PHP_VARIANT}" + +# install the PHP extensions we need +RUN set -eux; \ + docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + +# set recommended PHP.ini settings +# see https://www.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=2'; \ + echo 'opcache.fast_shutdown=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + +RUN a2enmod rewrite expires + +RUN set -eux; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ + echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + tar -xf yourls.tar.gz -C /usr/src/; \ +# move back to a common /usr/src/yourls + mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + rm yourls.tar.gz; \ + chown -R www-data:www-data /usr/src/yourls + +COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ +COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/ +COPY .htaccess /usr/src/yourls/ +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/apache/config-docker.php b/apache/config-docker.php new file mode 100644 index 0000000..cf56824 --- /dev/null +++ b/apache/config-docker.php @@ -0,0 +1,107 @@ + getenv_docker('YOURLS_PASS'), +]; + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); + +/* +** URL Shortening settings +*/ + +/** URL shortening method: 36 or 62 */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); +/* + * 36: generates all lowercase keywords (ie: 13jkm) + * 62: generates mixed case keywords (ie: 13jKm or 13JKm) + * Stick to one setting. It's best not to change after you've started creating links. + */ + +/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ +define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); + +/** + * Reserved keywords (so that generated URLs won't match them) + * Define here negative, unwanted or potentially misleading keywords. + */ +$yourls_reserved_URL = [ + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', +]; + +/* + ** Personal settings would go after here. + */ diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh new file mode 100644 index 0000000..75ad289 --- /dev/null +++ b/apache/docker-entrypoint.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then + uid="$(id -u)" + gid="$(id -g)" + if [ "$uid" = '0' ]; then + case "$1" in + apache2*) + user="${APACHE_RUN_USER:-www-data}" + group="${APACHE_RUN_GROUP:-www-data}" + + # strip off any '#' symbol ('#1000' is valid syntax for Apache) + pound='#' + user="${user#$pound}" + group="${group#$pound}" + ;; + *) # php-fpm + user='www-data' + group='www-data' + ;; + esac + else + user="$uid" + group="$gid" + fi + + if [ ! -e yourls-loader.php ]; then + # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then + chown "$user:$group" . + fi + + echo >&2 "YOURLS not found in $PWD - copying now..." + if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then + echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" + fi + sourceTarArgs=( + --create + --file - + --directory /usr/src/yourls + --owner "$user" --group "$group" + ) + targetTarArgs=( + --extract + --file - + ) + if [ "$uid" != '0' ]; then + # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" + targetTarArgs+=(--no-overwrite-dir) + fi + # loop over "pluggable" content in the source, and if it already exists in the destination, skip it + for contentPath in \ + /usr/src/yourls/.htaccess \ + /usr/src/yourls/user/*/*/ \ + ; do + contentPath="${contentPath%/}" + [ -e "$contentPath" ] || continue + contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. + if [ -e "$PWD/$contentPath" ]; then + echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" + sourceTarArgs+=(--exclude "./$contentPath") + fi + done + tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" + echo >&2 "Complete! YOURLS has been successfully copied to $PWD" + fi + + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -s user/config.php ]; then + cp /usr/src/yourls/user/config-docker.php user/config.php + + : "${YOURLS_USER:=}" + : "${YOURLS_PASS:=}" + if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + echo "$result" > user/config.php + fi + + if [ "$uid" = '0' ]; then + # attempt to ensure that user/config.php is owned by the run user + # could be on a filesystem that doesn't allow chown (like some NFS setups) + chown "$user:$group" user/config.php || true + fi + fi +fi + +exec "$@" diff --git a/bin/functions.sh b/bin/functions.sh new file mode 100755 index 0000000..17ee895 --- /dev/null +++ b/bin/functions.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e + +# get the most recent commit which modified any of "$@" +fileCommit() { + git log -1 --format='format:%H' HEAD -- "$@" +} + +# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile" +dirCommit() { + local dir="$1"; shift + ( + cd "$dir" + fileCommit \ + Dockerfile \ + "$(git show HEAD:./Dockerfile | awk ' + toupper($1) == "COPY" { + for (i = 2; i < NF; i++) { + print $i + } + } + ')" + ) +} + +getArches() { + local repo="$1"; shift + local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' + + eval "declare -g -A parentRepoToArches=( $( + find . -name 'Dockerfile' -exec awk ' + toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { + print "'"$officialImagesUrl"'" $2 + } + ' '{}' + \ + | sort -u \ + | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' + ) )" +} + +# prints "$2$1$3$1...$N" +join() { + local sep="$1"; shift + local out; printf -v out "${sep//%/%%}%s" "$@" + echo "${out#$sep}" +} diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh new file mode 100755 index 0000000..c9860f2 --- /dev/null +++ b/bin/generate-aliases.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -e + +# shellcheck source=functions.sh +source "${BASH_SOURCE[0]%/*}/functions.sh" + +version="$1" +variant="$2" + +versionAliases=() +while [ "${version%[.-]*}" != "$version" ]; do + versionAliases+=( "$version" ) + version="${version%[.-]*}" +done +versionAliases+=( + "$version" + latest +) + +variantAliases=( "${versionAliases[@]/%/-$variant}" ) +variantAliases=( "${variantAliases[@]//latest-/}" ) + +if [ "$variant" = 'apache' ]; then + variantAliases+=( "${versionAliases[@]}" ) +fi + +if [ -n "$2" ]; then + variantAliases=( "${variantAliases[@]/#/$3:}" ) +fi + +echo "$(join ', ' "${variantAliases[@]}")" diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh new file mode 100755 index 0000000..4d4ae10 --- /dev/null +++ b/bin/generate-stackbrew-library.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -eu + +# shellcheck source=functions.sh +source "${BASH_SOURCE[0]%/*}/functions.sh" + +self="bin/$(basename "${BASH_SOURCE[0]}")" +cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" + +getArches 'yourls' + +cat <<-EOH +# this file is generated via https://github.com/YOURLS/docker/blob/$(fileCommit "$self")/$self + +Maintainers: YOURLS (@YOURLS), + Léo Colombaro (@LeoColomb) +GitRepo: https://github.com/YOURLS/docker.git +GitFetch: refs/heads/dist +EOH + +for variant in apache fpm fpm-alpine; do + commit="$(dirCommit "$variant")" + variantAliases=$(./bin/generate-aliases.sh "$variant") + + variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")" + # shellcheck disable=SC2154 + variantArches="${parentRepoToArches[$variantParent]}" + + echo + cat <<-EOE + Tags: $variantAliases + Architectures: $(join ', ' $variantArches) + GitCommit: $commit + Directory: $variant + EOE +done diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile new file mode 100644 index 0000000..57397dc --- /dev/null +++ b/fpm-alpine/Dockerfile @@ -0,0 +1,49 @@ +ARG PHP_VERSION="8.0" +ARG PHP_VARIANT="fpm-alpine" + +FROM php:${PHP_VERSION}-${PHP_VARIANT} + +ARG YOURLS_VERSION="1.8.2" +ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" + +LABEL org.opencontainers.image.title="YOURLS" +LABEL org.opencontainers.image.description="Your Own URL Shortener" +LABEL org.opencontainers.image.url="https://yourls.org/" +LABEL org.opencontainers.image.documentation="https://yourls.org/" +LABEL org.opencontainers.image.vendor="YOURLS Org" +LABEL org.opencontainers.image.authors="YOURLS" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.version="$YOURLS_VERSION" +LABEL org.opencontainers.image.base.name="docker.io/library/php:${PHP_VERSION}-${PHP_VARIANT}" + +# install the PHP extensions we need +RUN set -eux; \ + docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + +# set recommended PHP.ini settings +# see https://www.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=2'; \ + echo 'opcache.fast_shutdown=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + +RUN apk add --no-cache bash + +RUN set -eux; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ + echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + tar -xf yourls.tar.gz -C /usr/src/; \ +# move back to a common /usr/src/yourls + mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + rm yourls.tar.gz; \ + chown -R www-data:www-data /usr/src/yourls + +COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ +COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["php-fpm"] diff --git a/fpm-alpine/config-docker.php b/fpm-alpine/config-docker.php new file mode 100644 index 0000000..cf56824 --- /dev/null +++ b/fpm-alpine/config-docker.php @@ -0,0 +1,107 @@ + getenv_docker('YOURLS_PASS'), +]; + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); + +/* +** URL Shortening settings +*/ + +/** URL shortening method: 36 or 62 */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); +/* + * 36: generates all lowercase keywords (ie: 13jkm) + * 62: generates mixed case keywords (ie: 13jKm or 13JKm) + * Stick to one setting. It's best not to change after you've started creating links. + */ + +/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ +define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); + +/** + * Reserved keywords (so that generated URLs won't match them) + * Define here negative, unwanted or potentially misleading keywords. + */ +$yourls_reserved_URL = [ + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', +]; + +/* + ** Personal settings would go after here. + */ diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh new file mode 100644 index 0000000..75ad289 --- /dev/null +++ b/fpm-alpine/docker-entrypoint.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then + uid="$(id -u)" + gid="$(id -g)" + if [ "$uid" = '0' ]; then + case "$1" in + apache2*) + user="${APACHE_RUN_USER:-www-data}" + group="${APACHE_RUN_GROUP:-www-data}" + + # strip off any '#' symbol ('#1000' is valid syntax for Apache) + pound='#' + user="${user#$pound}" + group="${group#$pound}" + ;; + *) # php-fpm + user='www-data' + group='www-data' + ;; + esac + else + user="$uid" + group="$gid" + fi + + if [ ! -e yourls-loader.php ]; then + # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then + chown "$user:$group" . + fi + + echo >&2 "YOURLS not found in $PWD - copying now..." + if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then + echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" + fi + sourceTarArgs=( + --create + --file - + --directory /usr/src/yourls + --owner "$user" --group "$group" + ) + targetTarArgs=( + --extract + --file - + ) + if [ "$uid" != '0' ]; then + # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" + targetTarArgs+=(--no-overwrite-dir) + fi + # loop over "pluggable" content in the source, and if it already exists in the destination, skip it + for contentPath in \ + /usr/src/yourls/.htaccess \ + /usr/src/yourls/user/*/*/ \ + ; do + contentPath="${contentPath%/}" + [ -e "$contentPath" ] || continue + contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. + if [ -e "$PWD/$contentPath" ]; then + echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" + sourceTarArgs+=(--exclude "./$contentPath") + fi + done + tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" + echo >&2 "Complete! YOURLS has been successfully copied to $PWD" + fi + + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -s user/config.php ]; then + cp /usr/src/yourls/user/config-docker.php user/config.php + + : "${YOURLS_USER:=}" + : "${YOURLS_PASS:=}" + if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + echo "$result" > user/config.php + fi + + if [ "$uid" = '0' ]; then + # attempt to ensure that user/config.php is owned by the run user + # could be on a filesystem that doesn't allow chown (like some NFS setups) + chown "$user:$group" user/config.php || true + fi + fi +fi + +exec "$@" diff --git a/fpm/Dockerfile b/fpm/Dockerfile new file mode 100644 index 0000000..710c5f7 --- /dev/null +++ b/fpm/Dockerfile @@ -0,0 +1,49 @@ +ARG PHP_VERSION="8.0" +ARG PHP_VARIANT="fpm" + +FROM php:${PHP_VERSION}-${PHP_VARIANT} + +ARG YOURLS_VERSION="1.8.2" +ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" + +LABEL org.opencontainers.image.title="YOURLS" +LABEL org.opencontainers.image.description="Your Own URL Shortener" +LABEL org.opencontainers.image.url="https://yourls.org/" +LABEL org.opencontainers.image.documentation="https://yourls.org/" +LABEL org.opencontainers.image.vendor="YOURLS Org" +LABEL org.opencontainers.image.authors="YOURLS" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.version="$YOURLS_VERSION" +LABEL org.opencontainers.image.base.name="docker.io/library/php:${PHP_VERSION}-${PHP_VARIANT}" + +# install the PHP extensions we need +RUN set -eux; \ + docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + +# set recommended PHP.ini settings +# see https://www.php.net/manual/en/opcache.installation.php +RUN { \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=2'; \ + echo 'opcache.fast_shutdown=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini + + + +RUN set -eux; \ + curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ + echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ +# upstream tarballs include ./YOURLS-${YOURLS_VERSION}/ so this gives us /usr/src/YOURLS-${YOURLS_VERSION} + tar -xf yourls.tar.gz -C /usr/src/; \ +# move back to a common /usr/src/yourls + mv "/usr/src/YOURLS-${YOURLS_VERSION}" /usr/src/yourls; \ + rm yourls.tar.gz; \ + chown -R www-data:www-data /usr/src/yourls + +COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ +COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["php-fpm"] diff --git a/fpm/config-docker.php b/fpm/config-docker.php new file mode 100644 index 0000000..cf56824 --- /dev/null +++ b/fpm/config-docker.php @@ -0,0 +1,107 @@ + getenv_docker('YOURLS_PASS'), +]; + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); + +/* +** URL Shortening settings +*/ + +/** URL shortening method: 36 or 62 */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); +/* + * 36: generates all lowercase keywords (ie: 13jkm) + * 62: generates mixed case keywords (ie: 13jKm or 13JKm) + * Stick to one setting. It's best not to change after you've started creating links. + */ + +/** if set to true, disable stat logging (no use for it, too busy servers, ...) */ +define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); + +/** + * Reserved keywords (so that generated URLs won't match them) + * Define here negative, unwanted or potentially misleading keywords. + */ +$yourls_reserved_URL = [ + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', +]; + +/* + ** Personal settings would go after here. + */ diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh new file mode 100644 index 0000000..75ad289 --- /dev/null +++ b/fpm/docker-entrypoint.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then + uid="$(id -u)" + gid="$(id -g)" + if [ "$uid" = '0' ]; then + case "$1" in + apache2*) + user="${APACHE_RUN_USER:-www-data}" + group="${APACHE_RUN_GROUP:-www-data}" + + # strip off any '#' symbol ('#1000' is valid syntax for Apache) + pound='#' + user="${user#$pound}" + group="${group#$pound}" + ;; + *) # php-fpm + user='www-data' + group='www-data' + ;; + esac + else + user="$uid" + group="$gid" + fi + + if [ ! -e yourls-loader.php ]; then + # if the directory exists and YOURLS doesn't appear to be installed AND the permissions of it are root:root, let's chown it (likely a Docker-created directory) + if [ "$uid" = '0' ] && [ "$(stat -c '%u:%g' .)" = '0:0' ]; then + chown "$user:$group" . + fi + + echo >&2 "YOURLS not found in $PWD - copying now..." + if [ -n "$(find . -mindepth 1 -maxdepth 1 -not -name user)" ]; then + echo >&2 "WARNING: $PWD is not empty! (copying anyhow)" + fi + sourceTarArgs=( + --create + --file - + --directory /usr/src/yourls + --owner "$user" --group "$group" + ) + targetTarArgs=( + --extract + --file - + ) + if [ "$uid" != '0' ]; then + # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted" + targetTarArgs+=(--no-overwrite-dir) + fi + # loop over "pluggable" content in the source, and if it already exists in the destination, skip it + for contentPath in \ + /usr/src/yourls/.htaccess \ + /usr/src/yourls/user/*/*/ \ + ; do + contentPath="${contentPath%/}" + [ -e "$contentPath" ] || continue + contentPath="${contentPath#/usr/src/yourls/}" # "user/plugins/plugin-name", etc. + if [ -e "$PWD/$contentPath" ]; then + echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the YOURLS version)" + sourceTarArgs+=(--exclude "./$contentPath") + fi + done + tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" + echo >&2 "Complete! YOURLS has been successfully copied to $PWD" + fi + + # if not specified, let's generate a random value + : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" + + # We want to copy the initial config if the actual config file doesn't already + # exist OR if it is an empty file (e.g. it has been created for the volume mount). + if [ ! -s user/config.php ]; then + cp /usr/src/yourls/user/config-docker.php user/config.php + + : "${YOURLS_USER:=}" + : "${YOURLS_PASS:=}" + if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + echo "$result" > user/config.php + fi + + if [ "$uid" = '0' ]; then + # attempt to ensure that user/config.php is owned by the run user + # could be on a filesystem that doesn't allow chown (like some NFS setups) + chown "$user:$group" user/config.php || true + fi + fi +fi + +exec "$@" From b44eb621877cd12ef8656ab720eaff8d95e8047e Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 21 Feb 2022 11:10:18 +0000 Subject: [PATCH 21/75] deploy: ca4b201fde30fc8d6f32df9e7b1100a50440f1e1 --- apache/Dockerfile | 8 +++++--- bin/generate-aliases.sh | 2 +- bin/generate-stackbrew-library.sh | 4 +++- fpm-alpine/Dockerfile | 8 +++++--- fpm/Dockerfile | 8 +++++--- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 8e52fa0..404b8e4 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,8 +1,8 @@ -ARG PHP_VERSION="8.0" ARG PHP_VARIANT="apache" -FROM php:${PHP_VERSION}-${PHP_VARIANT} +FROM php:8.0-${PHP_VARIANT} +# renovate: depName=YOURLS/YOURLS:@gitlab-org/nk-js ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" @@ -14,7 +14,6 @@ LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.version="$YOURLS_VERSION" -LABEL org.opencontainers.image.base.name="docker.io/library/php:${PHP_VERSION}-${PHP_VARIANT}" # install the PHP extensions we need RUN set -eux; \ @@ -32,6 +31,9 @@ RUN { \ RUN a2enmod rewrite expires +ENV YOURLS_VERSION=$YOURLS_VERSION +ENV YOURLS_SHA256=$YOURLS_SHA256 + RUN set -eux; \ curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ diff --git a/bin/generate-aliases.sh b/bin/generate-aliases.sh index c9860f2..8107988 100755 --- a/bin/generate-aliases.sh +++ b/bin/generate-aliases.sh @@ -24,7 +24,7 @@ if [ "$variant" = 'apache' ]; then variantAliases+=( "${versionAliases[@]}" ) fi -if [ -n "$2" ]; then +if [ -n "$3" ]; then variantAliases=( "${variantAliases[@]/#/$3:}" ) fi diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 4d4ae10..8112c4e 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -9,6 +9,8 @@ cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" getArches 'yourls' +version=$(head -n 1 yourls_version) + cat <<-EOH # this file is generated via https://github.com/YOURLS/docker/blob/$(fileCommit "$self")/$self @@ -20,7 +22,7 @@ EOH for variant in apache fpm fpm-alpine; do commit="$(dirCommit "$variant")" - variantAliases=$(./bin/generate-aliases.sh "$variant") + variantAliases=$(./bin/generate-aliases.sh "$version" "$variant") variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")" # shellcheck disable=SC2154 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 57397dc..367258c 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,8 +1,8 @@ -ARG PHP_VERSION="8.0" ARG PHP_VARIANT="fpm-alpine" -FROM php:${PHP_VERSION}-${PHP_VARIANT} +FROM php:8.0-${PHP_VARIANT} +# renovate: depName=YOURLS/YOURLS:@gitlab-org/nk-js ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" @@ -14,7 +14,6 @@ LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.version="$YOURLS_VERSION" -LABEL org.opencontainers.image.base.name="docker.io/library/php:${PHP_VERSION}-${PHP_VARIANT}" # install the PHP extensions we need RUN set -eux; \ @@ -32,6 +31,9 @@ RUN { \ RUN apk add --no-cache bash +ENV YOURLS_VERSION=$YOURLS_VERSION +ENV YOURLS_SHA256=$YOURLS_SHA256 + RUN set -eux; \ curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 710c5f7..97404d5 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,8 +1,8 @@ -ARG PHP_VERSION="8.0" ARG PHP_VARIANT="fpm" -FROM php:${PHP_VERSION}-${PHP_VARIANT} +FROM php:8.0-${PHP_VARIANT} +# renovate: depName=YOURLS/YOURLS:@gitlab-org/nk-js ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" @@ -14,7 +14,6 @@ LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.version="$YOURLS_VERSION" -LABEL org.opencontainers.image.base.name="docker.io/library/php:${PHP_VERSION}-${PHP_VARIANT}" # install the PHP extensions we need RUN set -eux; \ @@ -32,6 +31,9 @@ RUN { \ +ENV YOURLS_VERSION=$YOURLS_VERSION +ENV YOURLS_SHA256=$YOURLS_SHA256 + RUN set -eux; \ curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \ echo "$YOURLS_SHA256 *yourls.tar.gz" | sha256sum -c -; \ From 1329c0493748560bf4c71aa5e96cc77c77f13a49 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 21 Feb 2022 11:17:48 +0000 Subject: [PATCH 22/75] deploy: 420adb0f51cbe75236b1c7a263b72dae0d62e6f9 --- apache/Dockerfile | 1 - fpm-alpine/Dockerfile | 1 - fpm/Dockerfile | 1 - yourls_version | 1 + 4 files changed, 1 insertion(+), 3 deletions(-) create mode 100644 yourls_version diff --git a/apache/Dockerfile b/apache/Dockerfile index 404b8e4..d8d2c6d 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -2,7 +2,6 @@ ARG PHP_VARIANT="apache" FROM php:8.0-${PHP_VARIANT} -# renovate: depName=YOURLS/YOURLS:@gitlab-org/nk-js ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 367258c..8238554 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -2,7 +2,6 @@ ARG PHP_VARIANT="fpm-alpine" FROM php:8.0-${PHP_VARIANT} -# renovate: depName=YOURLS/YOURLS:@gitlab-org/nk-js ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 97404d5..b898e39 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -2,7 +2,6 @@ ARG PHP_VARIANT="fpm" FROM php:8.0-${PHP_VARIANT} -# renovate: depName=YOURLS/YOURLS:@gitlab-org/nk-js ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" diff --git a/yourls_version b/yourls_version new file mode 100644 index 0000000..53adb84 --- /dev/null +++ b/yourls_version @@ -0,0 +1 @@ +1.8.2 From 6c8397428f2fc25b60af6b68bf5b1f94a068de17 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 21 Feb 2022 12:15:41 +0000 Subject: [PATCH 23/75] deploy: f21706436bcf5bf8248f5fc8448f1a9d41e7615f --- apache/Dockerfile | 5 ++--- fpm-alpine/Dockerfile | 5 ++--- fpm/Dockerfile | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index d8d2c6d..10588fe 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,7 +1,6 @@ -ARG PHP_VARIANT="apache" - -FROM php:8.0-${PHP_VARIANT} +FROM php:8.0-apache +# renovate: datasource=github-releases depName=YOURLS/YOURLS ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 8238554..4797f3b 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,7 +1,6 @@ -ARG PHP_VARIANT="fpm-alpine" - -FROM php:8.0-${PHP_VARIANT} +FROM php:8.0-fpm-alpine +# renovate: datasource=github-releases depName=YOURLS/YOURLS ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index b898e39..6d90a3f 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,7 +1,6 @@ -ARG PHP_VARIANT="fpm" - -FROM php:8.0-${PHP_VARIANT} +FROM php:8.0-fpm +# renovate: datasource=github-releases depName=YOURLS/YOURLS ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" From 89274ae7b43ce75993944b96d27740f68ada59b7 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 20 Apr 2022 17:11:55 +0000 Subject: [PATCH 24/75] deploy: 58436f28e7a41e029389ca259a2e2731e7888ed6 --- apache/docker-entrypoint.sh | 6 +++--- fpm-alpine/docker-entrypoint.sh | 6 +++--- fpm/docker-entrypoint.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index 75ad289..8b65b17 100644 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -12,8 +12,8 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # strip off any '#' symbol ('#1000' is valid syntax for Apache) pound='#' - user="${user#$pound}" - group="${group#$pound}" + user="${user#"$pound"}" + group="${group#"$pound"}" ;; *) # php-fpm user='www-data' @@ -77,7 +77,7 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) echo "$result" > user/config.php fi diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh index 75ad289..8b65b17 100644 --- a/fpm-alpine/docker-entrypoint.sh +++ b/fpm-alpine/docker-entrypoint.sh @@ -12,8 +12,8 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # strip off any '#' symbol ('#1000' is valid syntax for Apache) pound='#' - user="${user#$pound}" - group="${group#$pound}" + user="${user#"$pound"}" + group="${group#"$pound"}" ;; *) # php-fpm user='www-data' @@ -77,7 +77,7 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) echo "$result" > user/config.php fi diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh index 75ad289..8b65b17 100644 --- a/fpm/docker-entrypoint.sh +++ b/fpm/docker-entrypoint.sh @@ -12,8 +12,8 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # strip off any '#' symbol ('#1000' is valid syntax for Apache) pound='#' - user="${user#$pound}" - group="${group#$pound}" + user="${user#"$pound"}" + group="${group#"$pound"}" ;; *) # php-fpm user='www-data' @@ -77,7 +77,7 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS}\',/g" user/config.php) + result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) echo "$result" > user/config.php fi From e4a2cc3c036cba76aecfc4a47e467ba190176fa3 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 24 Apr 2022 21:38:39 +0000 Subject: [PATCH 25/75] deploy: 089a7cab443b579540b1352109a13f8148176196 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 10588fe..4e8452d 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,6 +1,6 @@ FROM php:8.0-apache -# renovate: datasource=github-releases depName=YOURLS/YOURLS +# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 4797f3b..b87e18c 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,6 +1,6 @@ FROM php:8.0-fpm-alpine -# renovate: datasource=github-releases depName=YOURLS/YOURLS +# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 6d90a3f..3b0520c 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,6 +1,6 @@ FROM php:8.0-fpm -# renovate: datasource=github-releases depName=YOURLS/YOURLS +# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer ARG YOURLS_VERSION="1.8.2" ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" From 46fdbea103fcca1cc149099413174f7357b7eb67 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 24 Apr 2022 23:33:04 +0000 Subject: [PATCH 26/75] deploy: cac43ab4f71591ecf99ebce4b37a828ec059d8e6 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 4e8452d..e0f2537 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,8 +1,8 @@ FROM php:8.0-apache # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.8.2" -ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" +ARG YOURLS_VERSION="1.9" +ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index b87e18c..596c475 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,8 +1,8 @@ FROM php:8.0-fpm-alpine # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.8.2" -ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" +ARG YOURLS_VERSION="1.9" +ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 3b0520c..9858d33 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,8 +1,8 @@ FROM php:8.0-fpm # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.8.2" -ARG YOURLS_SHA256="6d818622e3ba1d5785c2dbcc088be6890f5675fd4f24a2e3111eda4523bbd7ae" +ARG YOURLS_VERSION="1.9" +ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" diff --git a/yourls_version b/yourls_version index 53adb84..2e0e38c 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.8.2 +1.9 From faf60b3aee526c836be4e5e8a2463137258d7ee3 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 24 Apr 2022 23:35:57 +0000 Subject: [PATCH 27/75] deploy: 47d0b9ef14e3150c282ff90e16bccb6c500eb12e --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index e0f2537..4530381 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0-apache +FROM php:8.1-apache # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer ARG YOURLS_VERSION="1.9" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 596c475..2c85e73 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0-fpm-alpine +FROM php:8.1-fpm-alpine # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer ARG YOURLS_VERSION="1.9" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 9858d33..fd670f4 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0-fpm +FROM php:8.1-fpm # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer ARG YOURLS_VERSION="1.9" From 88a3b25c3cb3e7bc45ae7cfa1b115c21de330edd Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 25 Apr 2022 20:11:51 +0000 Subject: [PATCH 28/75] deploy: 03da9f70d03c6f7ba7f852671b27c867ac368252 --- apache/Dockerfile | 2 +- apache/docker-entrypoint.sh | 0 fpm-alpine/Dockerfile | 2 +- fpm-alpine/docker-entrypoint.sh | 0 fpm/Dockerfile | 2 +- fpm/docker-entrypoint.sh | 0 6 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 apache/docker-entrypoint.sh mode change 100644 => 100755 fpm-alpine/docker-entrypoint.sh mode change 100644 => 100755 fpm/docker-entrypoint.sh diff --git a/apache/Dockerfile b/apache/Dockerfile index 4530381..bfda6bb 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -43,7 +43,7 @@ RUN set -eux; \ chown -R www-data:www-data /usr/src/yourls COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/ +COPY docker-entrypoint.sh /usr/local/bin/ COPY .htaccess /usr/src/yourls/ ENTRYPOINT ["docker-entrypoint.sh"] CMD ["apache2-foreground"] diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh old mode 100644 new mode 100755 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 2c85e73..513b220 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -43,7 +43,7 @@ RUN set -eux; \ chown -R www-data:www-data /usr/src/yourls COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/ +COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] CMD ["php-fpm"] diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh old mode 100644 new mode 100755 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index fd670f4..99cd8dc 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -43,7 +43,7 @@ RUN set -eux; \ chown -R www-data:www-data /usr/src/yourls COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/ +COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] CMD ["php-fpm"] diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh old mode 100644 new mode 100755 From b4a6fa40eb3292e03df95776a8acaf6436ed5a5d Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 27 Apr 2022 10:50:35 +0000 Subject: [PATCH 29/75] deploy: 2f94aecf26a218437cf717d6a706746f8e8239ea --- apache/Dockerfile | 11 ++++++----- fpm-alpine/Dockerfile | 11 ++++++----- fpm/Dockerfile | 11 ++++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index bfda6bb..e0a955c 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,9 +1,5 @@ FROM php:8.1-apache -# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9" -ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" - LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" LABEL org.opencontainers.image.url="https://yourls.org/" @@ -11,7 +7,6 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" -LABEL org.opencontainers.image.version="$YOURLS_VERSION" # install the PHP extensions we need RUN set -eux; \ @@ -29,6 +24,12 @@ RUN { \ RUN a2enmod rewrite expires +# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer +ARG YOURLS_VERSION="1.9" +ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" + +LABEL org.opencontainers.image.version="$YOURLS_VERSION" + ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 513b220..756f26d 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,9 +1,5 @@ FROM php:8.1-fpm-alpine -# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9" -ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" - LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" LABEL org.opencontainers.image.url="https://yourls.org/" @@ -11,7 +7,6 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" -LABEL org.opencontainers.image.version="$YOURLS_VERSION" # install the PHP extensions we need RUN set -eux; \ @@ -29,6 +24,12 @@ RUN { \ RUN apk add --no-cache bash +# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer +ARG YOURLS_VERSION="1.9" +ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" + +LABEL org.opencontainers.image.version="$YOURLS_VERSION" + ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 99cd8dc..e702d29 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,9 +1,5 @@ FROM php:8.1-fpm -# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9" -ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" - LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" LABEL org.opencontainers.image.url="https://yourls.org/" @@ -11,7 +7,6 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" -LABEL org.opencontainers.image.version="$YOURLS_VERSION" # install the PHP extensions we need RUN set -eux; \ @@ -29,6 +24,12 @@ RUN { \ +# renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer +ARG YOURLS_VERSION="1.9" +ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" + +LABEL org.opencontainers.image.version="$YOURLS_VERSION" + ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 From 2a55c4a8e08b03beec5dbcbe37e7d0bb40b4d402 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 22 May 2022 12:46:07 +0000 Subject: [PATCH 30/75] deploy: 06ec89e3e4d371e2f340e52d60feda1b98c1a773 --- apache/Dockerfile | 1 + fpm-alpine/Dockerfile | 1 + fpm/Dockerfile | 1 + 3 files changed, 3 insertions(+) diff --git a/apache/Dockerfile b/apache/Dockerfile index e0a955c..53cf900 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -7,6 +7,7 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" +LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/YOURLS/master/README.md" # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 756f26d..e98a8b2 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -7,6 +7,7 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" +LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/YOURLS/master/README.md" # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index e702d29..c2c5d59 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -7,6 +7,7 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" +LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/YOURLS/master/README.md" # install the PHP extensions we need RUN set -eux; \ From 38f550a34a4eb96419d9d3ebabe802c439103218 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 29 May 2022 17:48:11 +0000 Subject: [PATCH 31/75] deploy: 237df6d82438f6315009e5af76c6861e96aaa691 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 53cf900..54da270 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -26,8 +26,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9" -ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" +ARG YOURLS_VERSION="1.9.1" +ARG YOURLS_SHA256="0bf53290e8f86ea2e0121aac70f7c64d70d3dfb54823acb9dcc343dd7c5f455a" LABEL org.opencontainers.image.version="$YOURLS_VERSION" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index e98a8b2..90e4232 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -26,8 +26,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9" -ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" +ARG YOURLS_VERSION="1.9.1" +ARG YOURLS_SHA256="0bf53290e8f86ea2e0121aac70f7c64d70d3dfb54823acb9dcc343dd7c5f455a" LABEL org.opencontainers.image.version="$YOURLS_VERSION" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index c2c5d59..756f292 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -26,8 +26,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9" -ARG YOURLS_SHA256="212c4cd283f0b2b44e07da66a882cca4886e064f642bf4de8ecb8dbfb867e542" +ARG YOURLS_VERSION="1.9.1" +ARG YOURLS_SHA256="0bf53290e8f86ea2e0121aac70f7c64d70d3dfb54823acb9dcc343dd7c5f455a" LABEL org.opencontainers.image.version="$YOURLS_VERSION" diff --git a/yourls_version b/yourls_version index 2e0e38c..9ab8337 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.9 +1.9.1 From 863732ad61b03a6ffd3111bb5667a179682a0393 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 2 Mar 2023 02:27:26 +0000 Subject: [PATCH 32/75] deploy: 78bad49ad50b5dcf6611be6c33f38cb70e6b5e5a --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 54da270..da7141c 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-apache +FROM php:8.2-apache LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 90e4232..9ae82fa 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm-alpine +FROM php:8.2-fpm-alpine LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 756f292..0f1c135 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm +FROM php:8.2-fpm LABEL org.opencontainers.image.title="YOURLS" LABEL org.opencontainers.image.description="Your Own URL Shortener" From 2ef3b5fe2539efd8dd876727376ddee2c22079b5 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 5 Mar 2023 15:06:07 +0000 Subject: [PATCH 33/75] deploy: 4661cbb78c7d680c55965334cbb650f70e653be8 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index da7141c..ba4fafc 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -26,8 +26,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9.1" -ARG YOURLS_SHA256="0bf53290e8f86ea2e0121aac70f7c64d70d3dfb54823acb9dcc343dd7c5f455a" +ARG YOURLS_VERSION="1.9.2" +ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" LABEL org.opencontainers.image.version="$YOURLS_VERSION" diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 9ae82fa..dc0e788 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -26,8 +26,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9.1" -ARG YOURLS_SHA256="0bf53290e8f86ea2e0121aac70f7c64d70d3dfb54823acb9dcc343dd7c5f455a" +ARG YOURLS_VERSION="1.9.2" +ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" LABEL org.opencontainers.image.version="$YOURLS_VERSION" diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 0f1c135..f12d542 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -26,8 +26,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9.1" -ARG YOURLS_SHA256="0bf53290e8f86ea2e0121aac70f7c64d70d3dfb54823acb9dcc343dd7c5f455a" +ARG YOURLS_VERSION="1.9.2" +ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" LABEL org.opencontainers.image.version="$YOURLS_VERSION" diff --git a/yourls_version b/yourls_version index 9ab8337..8fdcf38 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.9.1 +1.9.2 From ee135fbe9da2369ae26c8da06e3de2943beafcbe Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 22 Mar 2023 22:24:07 +0000 Subject: [PATCH 34/75] deploy: 846bb7ecfd4929568c512af3cd49bafec07064c0 --- apache/Dockerfile | 8 ++++---- ...{config-docker.php => config-container.php} | 18 +++++++++--------- .../container-entrypoint.sh | 4 ++-- bin/generate-stackbrew-library.sh | 4 ++-- fpm-alpine/Dockerfile | 8 ++++---- .../config-container.php | 18 +++++++++--------- .../container-entrypoint.sh | 4 ++-- fpm/Dockerfile | 8 ++++---- .../config-container.php | 18 +++++++++--------- .../container-entrypoint.sh | 4 ++-- 10 files changed, 47 insertions(+), 47 deletions(-) rename apache/{config-docker.php => config-container.php} (85%) rename fpm/docker-entrypoint.sh => apache/container-entrypoint.sh (92%) rename fpm/config-docker.php => fpm-alpine/config-container.php (85%) rename apache/docker-entrypoint.sh => fpm-alpine/container-entrypoint.sh (92%) rename fpm-alpine/config-docker.php => fpm/config-container.php (85%) rename fpm-alpine/docker-entrypoint.sh => fpm/container-entrypoint.sh (92%) diff --git a/apache/Dockerfile b/apache/Dockerfile index ba4fafc..a5a5d31 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" -LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/YOURLS/master/README.md" +LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/images/main/images/yourls/README.md" # install the PHP extensions we need RUN set -eux; \ @@ -44,8 +44,8 @@ RUN set -eux; \ rm yourls.tar.gz; \ chown -R www-data:www-data /usr/src/yourls -COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY docker-entrypoint.sh /usr/local/bin/ +COPY --chown=www-data:www-data config-container.php /usr/src/yourls/user/ +COPY container-entrypoint.sh /usr/local/bin/ COPY .htaccess /usr/src/yourls/ -ENTRYPOINT ["docker-entrypoint.sh"] +ENTRYPOINT ["container-entrypoint.sh"] CMD ["apache2-foreground"] diff --git a/apache/config-docker.php b/apache/config-container.php similarity index 85% rename from apache/config-docker.php rename to apache/config-container.php index cf56824..43d4302 100644 --- a/apache/config-docker.php +++ b/apache/config-container.php @@ -4,8 +4,8 @@ */ // a helper function to lookup "env_FILE", "env", then fallback -if (!function_exists('getenv_docker')) { - function getenv_docker(string $name, ?string $default = null): ?string +if (!function_exists('getenv_container')) { + function getenv_container(string $name, ?string $default = null): ?string { if ($fileEnv = getenv($name . '_FILE')) { return trim(file_get_contents($fileEnv)); @@ -23,20 +23,20 @@ function getenv_docker(string $name, ?string $default = null): ?string */ /** MySQL database username */ -define( 'YOURLS_DB_USER', getenv_docker('YOURLS_DB_USER', 'root') ); +define( 'YOURLS_DB_USER', getenv_container('YOURLS_DB_USER', 'root') ); /** MySQL database password */ -define( 'YOURLS_DB_PASS', getenv_docker('YOURLS_DB_PASS') ); +define( 'YOURLS_DB_PASS', getenv_container('YOURLS_DB_PASS') ); /** The name of the database for YOURLS */ -define( 'YOURLS_DB_NAME', getenv_docker('YOURLS_DB_NAME', 'yourls') ); +define( 'YOURLS_DB_NAME', getenv_container('YOURLS_DB_NAME', 'yourls') ); /** MySQL hostname. ** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */ -define( 'YOURLS_DB_HOST', getenv_docker('YOURLS_DB_HOST', 'mysql') ); +define( 'YOURLS_DB_HOST', getenv_container('YOURLS_DB_HOST', 'mysql') ); /** MySQL tables prefix */ -define( 'YOURLS_DB_PREFIX', getenv_docker('YOURLS_DB_PREFIX', 'yourls_') ); +define( 'YOURLS_DB_PREFIX', getenv_container('YOURLS_DB_PREFIX', 'yourls_') ); /* ** Site options @@ -44,7 +44,7 @@ function getenv_docker(string $name, ?string $default = null): ?string /** YOURLS installation URL -- all lowercase, no trailing slash at the end. ** If you define it to "http://sho.rt", don't use "http://www.sho.rt" in your browser (and vice-versa) */ -define( 'YOURLS_SITE', getenv_docker('YOURLS_SITE', 'http://your-own-domain-here.com') ); +define( 'YOURLS_SITE', getenv_container('YOURLS_SITE', 'http://your-own-domain-here.com') ); /** Server timezone GMT offset */ define( 'YOURLS_HOURS_OFFSET', filter_var(getenv('YOURLS_HOURS_OFFSET'), FILTER_VALIDATE_INT) ?: 0 ); @@ -72,7 +72,7 @@ function getenv_docker(string $name, ?string $default = null): ?string ** YOURLS will auto encrypt plain text passwords in this file ** Read http://yourls.org/userpassword for more information */ $yourls_user_passwords = [ - getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'), + getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'), ]; /** Debug mode to output some internal information diff --git a/fpm/docker-entrypoint.sh b/apache/container-entrypoint.sh similarity index 92% rename from fpm/docker-entrypoint.sh rename to apache/container-entrypoint.sh index 8b65b17..298e3a9 100755 --- a/fpm/docker-entrypoint.sh +++ b/apache/container-entrypoint.sh @@ -72,12 +72,12 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # We want to copy the initial config if the actual config file doesn't already # exist OR if it is an empty file (e.g. it has been created for the volume mount). if [ ! -s user/config.php ]; then - cp /usr/src/yourls/user/config-docker.php user/config.php + cp /usr/src/yourls/user/config-container.php user/config.php : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) + result=$(sed "s/ getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) echo "$result" > user/config.php fi diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 8112c4e..0b07b72 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -12,11 +12,11 @@ getArches 'yourls' version=$(head -n 1 yourls_version) cat <<-EOH -# this file is generated via https://github.com/YOURLS/docker/blob/$(fileCommit "$self")/$self +# this file is generated via https://github.com/YOURLS/images/blob/$(fileCommit "$self")/$self Maintainers: YOURLS (@YOURLS), Léo Colombaro (@LeoColomb) -GitRepo: https://github.com/YOURLS/docker.git +GitRepo: https://github.com/YOURLS/images.git GitFetch: refs/heads/dist EOH diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index dc0e788..395ff06 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" -LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/YOURLS/master/README.md" +LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/images/main/images/yourls/README.md" # install the PHP extensions we need RUN set -eux; \ @@ -44,8 +44,8 @@ RUN set -eux; \ rm yourls.tar.gz; \ chown -R www-data:www-data /usr/src/yourls -COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY docker-entrypoint.sh /usr/local/bin/ +COPY --chown=www-data:www-data config-container.php /usr/src/yourls/user/ +COPY container-entrypoint.sh /usr/local/bin/ -ENTRYPOINT ["docker-entrypoint.sh"] +ENTRYPOINT ["container-entrypoint.sh"] CMD ["php-fpm"] diff --git a/fpm/config-docker.php b/fpm-alpine/config-container.php similarity index 85% rename from fpm/config-docker.php rename to fpm-alpine/config-container.php index cf56824..43d4302 100644 --- a/fpm/config-docker.php +++ b/fpm-alpine/config-container.php @@ -4,8 +4,8 @@ */ // a helper function to lookup "env_FILE", "env", then fallback -if (!function_exists('getenv_docker')) { - function getenv_docker(string $name, ?string $default = null): ?string +if (!function_exists('getenv_container')) { + function getenv_container(string $name, ?string $default = null): ?string { if ($fileEnv = getenv($name . '_FILE')) { return trim(file_get_contents($fileEnv)); @@ -23,20 +23,20 @@ function getenv_docker(string $name, ?string $default = null): ?string */ /** MySQL database username */ -define( 'YOURLS_DB_USER', getenv_docker('YOURLS_DB_USER', 'root') ); +define( 'YOURLS_DB_USER', getenv_container('YOURLS_DB_USER', 'root') ); /** MySQL database password */ -define( 'YOURLS_DB_PASS', getenv_docker('YOURLS_DB_PASS') ); +define( 'YOURLS_DB_PASS', getenv_container('YOURLS_DB_PASS') ); /** The name of the database for YOURLS */ -define( 'YOURLS_DB_NAME', getenv_docker('YOURLS_DB_NAME', 'yourls') ); +define( 'YOURLS_DB_NAME', getenv_container('YOURLS_DB_NAME', 'yourls') ); /** MySQL hostname. ** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */ -define( 'YOURLS_DB_HOST', getenv_docker('YOURLS_DB_HOST', 'mysql') ); +define( 'YOURLS_DB_HOST', getenv_container('YOURLS_DB_HOST', 'mysql') ); /** MySQL tables prefix */ -define( 'YOURLS_DB_PREFIX', getenv_docker('YOURLS_DB_PREFIX', 'yourls_') ); +define( 'YOURLS_DB_PREFIX', getenv_container('YOURLS_DB_PREFIX', 'yourls_') ); /* ** Site options @@ -44,7 +44,7 @@ function getenv_docker(string $name, ?string $default = null): ?string /** YOURLS installation URL -- all lowercase, no trailing slash at the end. ** If you define it to "http://sho.rt", don't use "http://www.sho.rt" in your browser (and vice-versa) */ -define( 'YOURLS_SITE', getenv_docker('YOURLS_SITE', 'http://your-own-domain-here.com') ); +define( 'YOURLS_SITE', getenv_container('YOURLS_SITE', 'http://your-own-domain-here.com') ); /** Server timezone GMT offset */ define( 'YOURLS_HOURS_OFFSET', filter_var(getenv('YOURLS_HOURS_OFFSET'), FILTER_VALIDATE_INT) ?: 0 ); @@ -72,7 +72,7 @@ function getenv_docker(string $name, ?string $default = null): ?string ** YOURLS will auto encrypt plain text passwords in this file ** Read http://yourls.org/userpassword for more information */ $yourls_user_passwords = [ - getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'), + getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'), ]; /** Debug mode to output some internal information diff --git a/apache/docker-entrypoint.sh b/fpm-alpine/container-entrypoint.sh similarity index 92% rename from apache/docker-entrypoint.sh rename to fpm-alpine/container-entrypoint.sh index 8b65b17..298e3a9 100755 --- a/apache/docker-entrypoint.sh +++ b/fpm-alpine/container-entrypoint.sh @@ -72,12 +72,12 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # We want to copy the initial config if the actual config file doesn't already # exist OR if it is an empty file (e.g. it has been created for the volume mount). if [ ! -s user/config.php ]; then - cp /usr/src/yourls/user/config-docker.php user/config.php + cp /usr/src/yourls/user/config-container.php user/config.php : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) + result=$(sed "s/ getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) echo "$result" > user/config.php fi diff --git a/fpm/Dockerfile b/fpm/Dockerfile index f12d542..0fca892 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.documentation="https://yourls.org/" LABEL org.opencontainers.image.vendor="YOURLS Org" LABEL org.opencontainers.image.authors="YOURLS" LABEL org.opencontainers.image.licenses="MIT" -LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/YOURLS/master/README.md" +LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/images/main/images/yourls/README.md" # install the PHP extensions we need RUN set -eux; \ @@ -44,8 +44,8 @@ RUN set -eux; \ rm yourls.tar.gz; \ chown -R www-data:www-data /usr/src/yourls -COPY --chown=www-data:www-data config-docker.php /usr/src/yourls/user/ -COPY docker-entrypoint.sh /usr/local/bin/ +COPY --chown=www-data:www-data config-container.php /usr/src/yourls/user/ +COPY container-entrypoint.sh /usr/local/bin/ -ENTRYPOINT ["docker-entrypoint.sh"] +ENTRYPOINT ["container-entrypoint.sh"] CMD ["php-fpm"] diff --git a/fpm-alpine/config-docker.php b/fpm/config-container.php similarity index 85% rename from fpm-alpine/config-docker.php rename to fpm/config-container.php index cf56824..43d4302 100644 --- a/fpm-alpine/config-docker.php +++ b/fpm/config-container.php @@ -4,8 +4,8 @@ */ // a helper function to lookup "env_FILE", "env", then fallback -if (!function_exists('getenv_docker')) { - function getenv_docker(string $name, ?string $default = null): ?string +if (!function_exists('getenv_container')) { + function getenv_container(string $name, ?string $default = null): ?string { if ($fileEnv = getenv($name . '_FILE')) { return trim(file_get_contents($fileEnv)); @@ -23,20 +23,20 @@ function getenv_docker(string $name, ?string $default = null): ?string */ /** MySQL database username */ -define( 'YOURLS_DB_USER', getenv_docker('YOURLS_DB_USER', 'root') ); +define( 'YOURLS_DB_USER', getenv_container('YOURLS_DB_USER', 'root') ); /** MySQL database password */ -define( 'YOURLS_DB_PASS', getenv_docker('YOURLS_DB_PASS') ); +define( 'YOURLS_DB_PASS', getenv_container('YOURLS_DB_PASS') ); /** The name of the database for YOURLS */ -define( 'YOURLS_DB_NAME', getenv_docker('YOURLS_DB_NAME', 'yourls') ); +define( 'YOURLS_DB_NAME', getenv_container('YOURLS_DB_NAME', 'yourls') ); /** MySQL hostname. ** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */ -define( 'YOURLS_DB_HOST', getenv_docker('YOURLS_DB_HOST', 'mysql') ); +define( 'YOURLS_DB_HOST', getenv_container('YOURLS_DB_HOST', 'mysql') ); /** MySQL tables prefix */ -define( 'YOURLS_DB_PREFIX', getenv_docker('YOURLS_DB_PREFIX', 'yourls_') ); +define( 'YOURLS_DB_PREFIX', getenv_container('YOURLS_DB_PREFIX', 'yourls_') ); /* ** Site options @@ -44,7 +44,7 @@ function getenv_docker(string $name, ?string $default = null): ?string /** YOURLS installation URL -- all lowercase, no trailing slash at the end. ** If you define it to "http://sho.rt", don't use "http://www.sho.rt" in your browser (and vice-versa) */ -define( 'YOURLS_SITE', getenv_docker('YOURLS_SITE', 'http://your-own-domain-here.com') ); +define( 'YOURLS_SITE', getenv_container('YOURLS_SITE', 'http://your-own-domain-here.com') ); /** Server timezone GMT offset */ define( 'YOURLS_HOURS_OFFSET', filter_var(getenv('YOURLS_HOURS_OFFSET'), FILTER_VALIDATE_INT) ?: 0 ); @@ -72,7 +72,7 @@ function getenv_docker(string $name, ?string $default = null): ?string ** YOURLS will auto encrypt plain text passwords in this file ** Read http://yourls.org/userpassword for more information */ $yourls_user_passwords = [ - getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'), + getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'), ]; /** Debug mode to output some internal information diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm/container-entrypoint.sh similarity index 92% rename from fpm-alpine/docker-entrypoint.sh rename to fpm/container-entrypoint.sh index 8b65b17..298e3a9 100755 --- a/fpm-alpine/docker-entrypoint.sh +++ b/fpm/container-entrypoint.sh @@ -72,12 +72,12 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # We want to copy the initial config if the actual config file doesn't already # exist OR if it is an empty file (e.g. it has been created for the volume mount). if [ ! -s user/config.php ]; then - cp /usr/src/yourls/user/config-docker.php user/config.php + cp /usr/src/yourls/user/config-container.php user/config.php : "${YOURLS_USER:=}" : "${YOURLS_PASS:=}" if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) + result=$(sed "s/ getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) echo "$result" > user/config.php fi From 5454584fcd7ea37b5aafd6be8e8356a18dc00ae4 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 22 Mar 2023 23:04:06 +0000 Subject: [PATCH 35/75] deploy: c4c47d085ef9d794da8fa1ffa270685a842de1a7 --- apache/Dockerfile | 13 +------------ fpm-alpine/Dockerfile | 13 +------------ fpm/Dockerfile | 13 +------------ 3 files changed, 3 insertions(+), 36 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index a5a5d31..587f044 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,13 +1,4 @@ -FROM php:8.2-apache - -LABEL org.opencontainers.image.title="YOURLS" -LABEL org.opencontainers.image.description="Your Own URL Shortener" -LABEL org.opencontainers.image.url="https://yourls.org/" -LABEL org.opencontainers.image.documentation="https://yourls.org/" -LABEL org.opencontainers.image.vendor="YOURLS Org" -LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.licenses="MIT" -LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/images/main/images/yourls/README.md" +FROM php:8.2.4-apache # install the PHP extensions we need RUN set -eux; \ @@ -29,8 +20,6 @@ RUN a2enmod rewrite expires ARG YOURLS_VERSION="1.9.2" ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" -LABEL org.opencontainers.image.version="$YOURLS_VERSION" - ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 395ff06..ed34be9 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,13 +1,4 @@ -FROM php:8.2-fpm-alpine - -LABEL org.opencontainers.image.title="YOURLS" -LABEL org.opencontainers.image.description="Your Own URL Shortener" -LABEL org.opencontainers.image.url="https://yourls.org/" -LABEL org.opencontainers.image.documentation="https://yourls.org/" -LABEL org.opencontainers.image.vendor="YOURLS Org" -LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.licenses="MIT" -LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/images/main/images/yourls/README.md" +FROM php:8.2.4-fpm-alpine # install the PHP extensions we need RUN set -eux; \ @@ -29,8 +20,6 @@ RUN apk add --no-cache bash ARG YOURLS_VERSION="1.9.2" ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" -LABEL org.opencontainers.image.version="$YOURLS_VERSION" - ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 0fca892..b6ee9d8 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,13 +1,4 @@ -FROM php:8.2-fpm - -LABEL org.opencontainers.image.title="YOURLS" -LABEL org.opencontainers.image.description="Your Own URL Shortener" -LABEL org.opencontainers.image.url="https://yourls.org/" -LABEL org.opencontainers.image.documentation="https://yourls.org/" -LABEL org.opencontainers.image.vendor="YOURLS Org" -LABEL org.opencontainers.image.authors="YOURLS" -LABEL org.opencontainers.image.licenses="MIT" -LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/YOURLS/images/main/images/yourls/README.md" +FROM php:8.2.4-fpm # install the PHP extensions we need RUN set -eux; \ @@ -29,8 +20,6 @@ RUN { \ ARG YOURLS_VERSION="1.9.2" ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" -LABEL org.opencontainers.image.version="$YOURLS_VERSION" - ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 From 0393a4a755ac9f06e4f4fd54898945db9cee4d19 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 2 Jun 2023 14:07:35 +0000 Subject: [PATCH 36/75] deploy: 59b389226e9c7e6df4bf80cd31b04b055b62ee29 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 587f044..abf4b6e 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.4-apache +FROM php:8.2.6-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index ed34be9..0502c05 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.4-fpm-alpine +FROM php:8.2.6-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index b6ee9d8..a236fca 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.4-fpm +FROM php:8.2.6-fpm # install the PHP extensions we need RUN set -eux; \ From 49b86b0fb1b97bb782a796c82ccccd832711e0e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 9 Jun 2023 18:06:20 +0000 Subject: [PATCH 37/75] deploy: e784b283df9ac815c5a7bfdd481a54d6c0d3d155 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index abf4b6e..dc1ba0f 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.6-apache +FROM php:8.2.7-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 0502c05..9be856c 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.6-fpm-alpine +FROM php:8.2.7-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index a236fca..f297c60 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.6-fpm +FROM php:8.2.7-fpm # install the PHP extensions we need RUN set -eux; \ From ff657e7e9041083d2c5357b2645b2b485435392f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 11 Jul 2023 11:01:43 +0000 Subject: [PATCH 38/75] deploy: a772faae75f544995904a59fc50664141233e69b --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index dc1ba0f..377a9c4 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.7-apache +FROM php:8.2.8-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 9be856c..a9f6183 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.7-fpm-alpine +FROM php:8.2.8-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index f297c60..fd77812 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.7-fpm +FROM php:8.2.8-fpm # install the PHP extensions we need RUN set -eux; \ From e4ff51e8b85437fe1c504269b8baee9544145a1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 18 Aug 2023 00:33:54 +0000 Subject: [PATCH 39/75] deploy: e4eee0f627621e21a731e8e157389fe51e5614ee --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 377a9c4..128f306 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.8-apache +FROM php:8.2.9-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index a9f6183..c4d7905 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.8-fpm-alpine +FROM php:8.2.9-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index fd77812..4abdc30 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.8-fpm +FROM php:8.2.9-fpm # install the PHP extensions we need RUN set -eux; \ From a268121f88f64b5703224960af257c55932382a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 3 Sep 2023 09:27:18 +0000 Subject: [PATCH 40/75] deploy: e3239c0b0819c79862fb3c813d6ef503f62aeb85 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 128f306..7c4c29c 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.9-apache +FROM php:8.2.10-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index c4d7905..4e91586 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.9-fpm-alpine +FROM php:8.2.10-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 4abdc30..5458e7f 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.9-fpm +FROM php:8.2.10-fpm # install the PHP extensions we need RUN set -eux; \ From 1471dab628b7747a022af76c8e7d829aa66de39b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 30 Sep 2023 23:53:57 +0000 Subject: [PATCH 41/75] deploy: 666ca7f2bb549f50cfbdd7294c21d8460b66e220 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 7c4c29c..6096708 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.10-apache +FROM php:8.2.11-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 4e91586..5155983 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.10-fpm-alpine +FROM php:8.2.11-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 5458e7f..9dcf33b 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.10-fpm +FROM php:8.2.11-fpm # install the PHP extensions we need RUN set -eux; \ From cddb3a886cd1f556ebd88a61b1d574838f68108c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 29 Oct 2023 17:21:14 +0000 Subject: [PATCH 42/75] deploy: b6d622bfbf70711a0483fcf77ee2017f1eeb1fbc --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 6096708..ecf87ee 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.11-apache +FROM php:8.2.12-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 5155983..5d7fbe4 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.11-fpm-alpine +FROM php:8.2.12-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 9dcf33b..dcd85be 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.11-fpm +FROM php:8.2.12-fpm # install the PHP extensions we need RUN set -eux; \ From dc3193a5b7c206c155fdc1b88ad46b12266974be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 28 Nov 2023 14:41:43 +0000 Subject: [PATCH 43/75] deploy: 9b6a8be0931070069caca5886cb6e34e0c5ecc1c --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index ecf87ee..c9cd396 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.12-apache +FROM php:8.3.0-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 5d7fbe4..5d0ea0b 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.12-fpm-alpine +FROM php:8.3.0-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index dcd85be..0fb960a 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.12-fpm +FROM php:8.3.0-fpm # install the PHP extensions we need RUN set -eux; \ From d1df97085ed227cf459f651fbd97f5ccb0956740 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 28 Dec 2023 04:25:18 +0000 Subject: [PATCH 44/75] deploy: 2f2a30eb725bb166f8da0859b3599a8968adc5a3 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index c9cd396..d6e9259 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.0-apache +FROM php:8.3.1-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 5d0ea0b..1a8c6a0 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.0-fpm-alpine +FROM php:8.3.1-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 0fb960a..ce3efcc 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.0-fpm +FROM php:8.3.1-fpm # install the PHP extensions we need RUN set -eux; \ From cc0436815532ea0e6f82c06a702df4c0a663bdf0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 20 Jan 2024 09:17:21 +0000 Subject: [PATCH 45/75] deploy: 46771f99a6fbeb5543c7bc9fd1be21612bf78d3e --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index d6e9259..aaa63ad 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.1-apache +FROM php:8.3.2-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 1a8c6a0..6ea4bfe 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.1-fpm-alpine +FROM php:8.3.2-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index ce3efcc..ae67c8e 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.1-fpm +FROM php:8.3.2-fpm # install the PHP extensions we need RUN set -eux; \ From 7206ee61cb16df1e9cf00ee9aa918b5127f86663 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 14 Feb 2024 10:55:56 +0000 Subject: [PATCH 46/75] deploy: 02d5234ba5ad871399c220b35492873b9033f1dc --- apache/container-entrypoint.sh | 10 ++++++++++ fpm-alpine/container-entrypoint.sh | 10 ++++++++++ fpm/container-entrypoint.sh | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/apache/container-entrypoint.sh b/apache/container-entrypoint.sh index 298e3a9..e9474b4 100755 --- a/apache/container-entrypoint.sh +++ b/apache/container-entrypoint.sh @@ -86,6 +86,16 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # could be on a filesystem that doesn't allow chown (like some NFS setups) chown "$user:$group" user/config.php || true fi + + # ability to use custom script with helm chart + if [[ -d "/docker-entrypoint-init.d" ]]; then + read -r -a init_scripts <<< "$(find "/docker-entrypoint-init.d" -type f -print0 | sort -z | xargs -0)" + if [[ "${#init_scripts[@]}" -gt 0 ]]; then + for init_script in "${init_scripts[@]}"; do + "$init_script" + done + fi + fi fi fi diff --git a/fpm-alpine/container-entrypoint.sh b/fpm-alpine/container-entrypoint.sh index 298e3a9..e9474b4 100755 --- a/fpm-alpine/container-entrypoint.sh +++ b/fpm-alpine/container-entrypoint.sh @@ -86,6 +86,16 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # could be on a filesystem that doesn't allow chown (like some NFS setups) chown "$user:$group" user/config.php || true fi + + # ability to use custom script with helm chart + if [[ -d "/docker-entrypoint-init.d" ]]; then + read -r -a init_scripts <<< "$(find "/docker-entrypoint-init.d" -type f -print0 | sort -z | xargs -0)" + if [[ "${#init_scripts[@]}" -gt 0 ]]; then + for init_script in "${init_scripts[@]}"; do + "$init_script" + done + fi + fi fi fi diff --git a/fpm/container-entrypoint.sh b/fpm/container-entrypoint.sh index 298e3a9..e9474b4 100755 --- a/fpm/container-entrypoint.sh +++ b/fpm/container-entrypoint.sh @@ -86,6 +86,16 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # could be on a filesystem that doesn't allow chown (like some NFS setups) chown "$user:$group" user/config.php || true fi + + # ability to use custom script with helm chart + if [[ -d "/docker-entrypoint-init.d" ]]; then + read -r -a init_scripts <<< "$(find "/docker-entrypoint-init.d" -type f -print0 | sort -z | xargs -0)" + if [[ "${#init_scripts[@]}" -gt 0 ]]; then + for init_script in "${init_scripts[@]}"; do + "$init_script" + done + fi + fi fi fi From 5004fa5c7ded6c88988ea6ed32659e5389370b21 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 17 Feb 2024 02:09:14 +0000 Subject: [PATCH 47/75] deploy: b2f36aa82fac2badc0e4d046be23a96cd8f82880 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index aaa63ad..25f079d 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.2-apache +FROM php:8.3.3-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 6ea4bfe..3045cc8 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.2-fpm-alpine +FROM php:8.3.3-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index ae67c8e..c54fa56 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.2-fpm +FROM php:8.3.3-fpm # install the PHP extensions we need RUN set -eux; \ From e574501e972f58d9883c4c641adce2b2c44c7ab7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 16 Mar 2024 04:03:13 +0000 Subject: [PATCH 48/75] deploy: a4af2a6af7a96e2eb781660adb4874d96366c35f --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 25f079d..b42da3d 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.3-apache +FROM php:8.3.4-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 3045cc8..2ea65db 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.3-fpm-alpine +FROM php:8.3.4-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index c54fa56..60e1d42 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.3-fpm +FROM php:8.3.4-fpm # install the PHP extensions we need RUN set -eux; \ From a4bd7d760ba4190aaee7aab031b3f64449ebcc61 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 11 Apr 2024 21:36:20 +0000 Subject: [PATCH 49/75] deploy: 6e3cb05a32f8f9130d0d114b6c576cc48a12eb9e --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index b42da3d..7152b6f 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.4-apache +FROM php:8.3.6-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 2ea65db..4413c7c 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.4-fpm-alpine +FROM php:8.3.6-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 60e1d42..5e6fb44 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.4-fpm +FROM php:8.3.6-fpm # install the PHP extensions we need RUN set -eux; \ From 4d1c788caab792549921a0ad416fa1037cdb6499 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Thu, 18 Apr 2024 21:14:58 +0000 Subject: [PATCH 50/75] deploy: a388ad049aee4adc1bda37cba305ce45a96c650e --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 7152b6f..ef27f6e 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.6-apache +FROM php:8.3-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 4413c7c..954f733 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.6-fpm-alpine +FROM php:8.3-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 5e6fb44..7176d4e 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.6-fpm +FROM php:8.3-fpm # install the PHP extensions we need RUN set -eux; \ From 082820033f591498dbc30d4ffc0cc927197ebf26 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Thu, 18 Apr 2024 21:17:33 +0000 Subject: [PATCH 51/75] deploy: c4bc7e3ce13cdef4629726c5931f580b5ec83173 --- apache/container-entrypoint.sh | 28 +++++++++++++++++++--------- fpm-alpine/container-entrypoint.sh | 28 +++++++++++++++++++--------- fpm/container-entrypoint.sh | 28 +++++++++++++++++++--------- 3 files changed, 57 insertions(+), 27 deletions(-) diff --git a/apache/container-entrypoint.sh b/apache/container-entrypoint.sh index e9474b4..b137360 100755 --- a/apache/container-entrypoint.sh +++ b/apache/container-entrypoint.sh @@ -87,15 +87,25 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then chown "$user:$group" user/config.php || true fi - # ability to use custom script with helm chart - if [[ -d "/docker-entrypoint-init.d" ]]; then - read -r -a init_scripts <<< "$(find "/docker-entrypoint-init.d" -type f -print0 | sort -z | xargs -0)" - if [[ "${#init_scripts[@]}" -gt 0 ]]; then - for init_script in "${init_scripts[@]}"; do - "$init_script" - done - fi - fi + # ability to use custom script + for file in /docker-entrypoint-init.d/*; do + echo >&2 "Running custom script $file" + case "$file" in + *.sh) + if [ -x "$file" ]; then + "$file" || exit 1 + else + echo >&2 "... ignoring non-executable $file" + fi + ;; + *.php) + php -f "$file" + ;; + *) + echo >&2 "... ignoring $file" + ;; + esac + done fi fi diff --git a/fpm-alpine/container-entrypoint.sh b/fpm-alpine/container-entrypoint.sh index e9474b4..b137360 100755 --- a/fpm-alpine/container-entrypoint.sh +++ b/fpm-alpine/container-entrypoint.sh @@ -87,15 +87,25 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then chown "$user:$group" user/config.php || true fi - # ability to use custom script with helm chart - if [[ -d "/docker-entrypoint-init.d" ]]; then - read -r -a init_scripts <<< "$(find "/docker-entrypoint-init.d" -type f -print0 | sort -z | xargs -0)" - if [[ "${#init_scripts[@]}" -gt 0 ]]; then - for init_script in "${init_scripts[@]}"; do - "$init_script" - done - fi - fi + # ability to use custom script + for file in /docker-entrypoint-init.d/*; do + echo >&2 "Running custom script $file" + case "$file" in + *.sh) + if [ -x "$file" ]; then + "$file" || exit 1 + else + echo >&2 "... ignoring non-executable $file" + fi + ;; + *.php) + php -f "$file" + ;; + *) + echo >&2 "... ignoring $file" + ;; + esac + done fi fi diff --git a/fpm/container-entrypoint.sh b/fpm/container-entrypoint.sh index e9474b4..b137360 100755 --- a/fpm/container-entrypoint.sh +++ b/fpm/container-entrypoint.sh @@ -87,15 +87,25 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then chown "$user:$group" user/config.php || true fi - # ability to use custom script with helm chart - if [[ -d "/docker-entrypoint-init.d" ]]; then - read -r -a init_scripts <<< "$(find "/docker-entrypoint-init.d" -type f -print0 | sort -z | xargs -0)" - if [[ "${#init_scripts[@]}" -gt 0 ]]; then - for init_script in "${init_scripts[@]}"; do - "$init_script" - done - fi - fi + # ability to use custom script + for file in /docker-entrypoint-init.d/*; do + echo >&2 "Running custom script $file" + case "$file" in + *.sh) + if [ -x "$file" ]; then + "$file" || exit 1 + else + echo >&2 "... ignoring non-executable $file" + fi + ;; + *.php) + php -f "$file" + ;; + *) + echo >&2 "... ignoring $file" + ;; + esac + done fi fi From 2637609069cbbd692df81adee0fd87700e8d8cfd Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Thu, 16 May 2024 13:41:13 +0000 Subject: [PATCH 52/75] deploy: e3791387663272ebff1d0ef8f1441ecb6cdea92c --- apache/config-container.php | 3 +++ fpm-alpine/config-container.php | 3 +++ fpm/config-container.php | 3 +++ 3 files changed, 9 insertions(+) diff --git a/apache/config-container.php b/apache/config-container.php index 43d4302..4584e8c 100644 --- a/apache/config-container.php +++ b/apache/config-container.php @@ -79,6 +79,9 @@ function getenv_container(string $name, ?string $default = null): ?string ** Default is false for live site. Enable when coding or before submitting a new issue */ define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); +/** Skip version check. */ +define( 'YOURLS_NO_VERSION_CHECK', getenv('YOURLS_NO_VERSION_CHECK') === false ?: filter_var(getenv('YOURLS_NO_VERSION_CHECK'), FILTER_VALIDATE_BOOLEAN) ); + /* ** URL Shortening settings */ diff --git a/fpm-alpine/config-container.php b/fpm-alpine/config-container.php index 43d4302..4584e8c 100644 --- a/fpm-alpine/config-container.php +++ b/fpm-alpine/config-container.php @@ -79,6 +79,9 @@ function getenv_container(string $name, ?string $default = null): ?string ** Default is false for live site. Enable when coding or before submitting a new issue */ define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); +/** Skip version check. */ +define( 'YOURLS_NO_VERSION_CHECK', getenv('YOURLS_NO_VERSION_CHECK') === false ?: filter_var(getenv('YOURLS_NO_VERSION_CHECK'), FILTER_VALIDATE_BOOLEAN) ); + /* ** URL Shortening settings */ diff --git a/fpm/config-container.php b/fpm/config-container.php index 43d4302..4584e8c 100644 --- a/fpm/config-container.php +++ b/fpm/config-container.php @@ -79,6 +79,9 @@ function getenv_container(string $name, ?string $default = null): ?string ** Default is false for live site. Enable when coding or before submitting a new issue */ define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); +/** Skip version check. */ +define( 'YOURLS_NO_VERSION_CHECK', getenv('YOURLS_NO_VERSION_CHECK') === false ?: filter_var(getenv('YOURLS_NO_VERSION_CHECK'), FILTER_VALIDATE_BOOLEAN) ); + /* ** URL Shortening settings */ From 104d9bae1c27bb5d11c37dd3d14bf65e47a81702 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 9 Sep 2024 19:41:36 +0000 Subject: [PATCH 53/75] deploy: 9aaeb78b66d6ac5c2dc34d88ec37ccacfc107041 --- apache/Dockerfile | 2 +- apache/{.htaccess => yourls.vhost} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename apache/{.htaccess => yourls.vhost} (100%) diff --git a/apache/Dockerfile b/apache/Dockerfile index ef27f6e..4ae6727 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -35,6 +35,6 @@ RUN set -eux; \ COPY --chown=www-data:www-data config-container.php /usr/src/yourls/user/ COPY container-entrypoint.sh /usr/local/bin/ -COPY .htaccess /usr/src/yourls/ +COPY yourls.vhost /usr/src/yourls/.htaccess ENTRYPOINT ["container-entrypoint.sh"] CMD ["apache2-foreground"] diff --git a/apache/.htaccess b/apache/yourls.vhost similarity index 100% rename from apache/.htaccess rename to apache/yourls.vhost From fa1ab3281e768c3de0b5a49446777dfcf459b5e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 21 Nov 2024 23:46:43 +0000 Subject: [PATCH 54/75] deploy: ab7542595bdc7866e6e9941f8548993134fc6832 --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 4ae6727..32eb9fa 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-apache +FROM php:8.4-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 954f733..b30b224 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-fpm-alpine +FROM php:8.4-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 7176d4e..079d3a8 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-fpm +FROM php:8.4-fpm # install the PHP extensions we need RUN set -eux; \ From da18a842bde4e60b956405e2e95a3056e3d211f2 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Tue, 26 Nov 2024 15:53:12 +0000 Subject: [PATCH 55/75] deploy: bc0c5916e2f3b1d12932885308ee866c308ae2fe --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 32eb9fa..4ae6727 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.4-apache +FROM php:8.3-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index b30b224..954f733 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.4-fpm-alpine +FROM php:8.3-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 079d3a8..7176d4e 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.4-fpm +FROM php:8.3-fpm # install the PHP extensions we need RUN set -eux; \ From 424951694f36e8ee8413723e0b7fd57c51d387a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 3 Apr 2025 16:14:23 +0000 Subject: [PATCH 56/75] deploy: b930c5412e869b012bc0fc0810533d8ccea7a444 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 4ae6727..0bbcd27 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9.2" -ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" +ARG YOURLS_VERSION="1.10.0" +ARG YOURLS_SHA256="2756e534ef8a92fc183af5000583b354c9f147beca4a35f68dbe1b0ed0e40bc5" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 954f733..b91b3b3 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9.2" -ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" +ARG YOURLS_VERSION="1.10.0" +ARG YOURLS_SHA256="2756e534ef8a92fc183af5000583b354c9f147beca4a35f68dbe1b0ed0e40bc5" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 7176d4e..47071ef 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -17,8 +17,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.9.2" -ARG YOURLS_SHA256="62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f" +ARG YOURLS_VERSION="1.10.0" +ARG YOURLS_SHA256="2756e534ef8a92fc183af5000583b354c9f147beca4a35f68dbe1b0ed0e40bc5" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/yourls_version b/yourls_version index 8fdcf38..81c871d 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.9.2 +1.10.0 From 0901e6c9dd655f24bdfe42680508309114b71aa8 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Thu, 3 Apr 2025 16:33:43 +0000 Subject: [PATCH 57/75] deploy: 53b983034b2274216183c8bdc13991f3ac50ab5f --- apache/Dockerfile | 2 +- fpm-alpine/Dockerfile | 2 +- fpm/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 0bbcd27..438b6d4 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-apache +FROM php:8.4-apache # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index b91b3b3..2ba7387 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-fpm-alpine +FROM php:8.4-fpm-alpine # install the PHP extensions we need RUN set -eux; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 47071ef..6b88eee 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-fpm +FROM php:8.4-fpm # install the PHP extensions we need RUN set -eux; \ From d306b06d6b3e94f1441c65385395f7a384a46101 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 25 Apr 2025 02:48:28 +0000 Subject: [PATCH 58/75] deploy: 51e45024ce43ae54c6efb59a14df64ffbe7ea8b7 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 438b6d4..2b9c64f 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.0" -ARG YOURLS_SHA256="2756e534ef8a92fc183af5000583b354c9f147beca4a35f68dbe1b0ed0e40bc5" +ARG YOURLS_VERSION="1.10.1" +ARG YOURLS_SHA256="ec21841af21194c8ef06a8eaaea5bf26d329741f9d09e04b32685a2d8ac4027e" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 2ba7387..b049a0e 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.0" -ARG YOURLS_SHA256="2756e534ef8a92fc183af5000583b354c9f147beca4a35f68dbe1b0ed0e40bc5" +ARG YOURLS_VERSION="1.10.1" +ARG YOURLS_SHA256="ec21841af21194c8ef06a8eaaea5bf26d329741f9d09e04b32685a2d8ac4027e" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 6b88eee..a99b738 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -17,8 +17,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.0" -ARG YOURLS_SHA256="2756e534ef8a92fc183af5000583b354c9f147beca4a35f68dbe1b0ed0e40bc5" +ARG YOURLS_VERSION="1.10.1" +ARG YOURLS_SHA256="ec21841af21194c8ef06a8eaaea5bf26d329741f9d09e04b32685a2d8ac4027e" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/yourls_version b/yourls_version index 81c871d..4dae298 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.10.0 +1.10.1 From e608c19f5f1705db23a613195db61bebef32750b Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 26 May 2025 10:00:06 +0000 Subject: [PATCH 59/75] deploy: 5975414b076c14d66475dc79b642e5b0d2fa1ad4 --- apache/Dockerfile | 7 ++++++- apache/files/ports.conf | 13 +++++++++++++ apache/files/vhost.conf | 22 ++++++++++++++++++++++ apache/yourls.vhost | 9 --------- 4 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 apache/files/ports.conf create mode 100644 apache/files/vhost.conf delete mode 100644 apache/yourls.vhost diff --git a/apache/Dockerfile b/apache/Dockerfile index 2b9c64f..3f0c84b 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -35,6 +35,11 @@ RUN set -eux; \ COPY --chown=www-data:www-data config-container.php /usr/src/yourls/user/ COPY container-entrypoint.sh /usr/local/bin/ -COPY yourls.vhost /usr/src/yourls/.htaccess +COPY files/vhost.conf $APACHE_CONFDIR/sites-available/000-default.conf +COPY files/ports.conf $APACHE_CONFDIR/ports.conf + +EXPOSE 8080/tcp +EXPOSE 8443/tcp + ENTRYPOINT ["container-entrypoint.sh"] CMD ["apache2-foreground"] diff --git a/apache/files/ports.conf b/apache/files/ports.conf new file mode 100644 index 0000000..b5f41cc --- /dev/null +++ b/apache/files/ports.conf @@ -0,0 +1,13 @@ +# If you just change the port or add more ports here, you will likely also +# have to change the VirtualHost statement in +# /etc/apache2/sites-enabled/000-default.conf + +Listen 8080 + + + Listen 8443 + + + + Listen 8443 + diff --git a/apache/files/vhost.conf b/apache/files/vhost.conf new file mode 100644 index 0000000..0fb3141 --- /dev/null +++ b/apache/files/vhost.conf @@ -0,0 +1,22 @@ + + + ServerName www.example.com + ServerAlias * + + DocumentRoot /var/www/html + + + Options -Indexes +FollowSymLinks -MultiViews + AllowOverride None + Require all granted + + + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.*$ /yourls-loader.php [L] + + + diff --git a/apache/yourls.vhost b/apache/yourls.vhost deleted file mode 100644 index 60bf53e..0000000 --- a/apache/yourls.vhost +++ /dev/null @@ -1,9 +0,0 @@ -# BEGIN YOURLS - - RewriteEngine On - RewriteBase / - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^.*$ /yourls-loader.php [L] - -# END YOURLS From 8d2f29cc5cf66e5c5d28e9952a7fdf65ee56e6aa Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 26 May 2025 10:18:42 +0000 Subject: [PATCH 60/75] deploy: bc49309a1a750ceb06f024431cde7a9bf0136aff --- apache/Dockerfile | 2 +- apache/files/vhost-https.conf | 26 ++++++++++++++++++++++++++ apache/files/vhost.conf | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 apache/files/vhost-https.conf diff --git a/apache/Dockerfile b/apache/Dockerfile index 3f0c84b..80e7e9b 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -35,7 +35,7 @@ RUN set -eux; \ COPY --chown=www-data:www-data config-container.php /usr/src/yourls/user/ COPY container-entrypoint.sh /usr/local/bin/ -COPY files/vhost.conf $APACHE_CONFDIR/sites-available/000-default.conf +COPY files/vhost-https.conf $APACHE_CONFDIR/sites-available/default-ssl.conf COPY files/ports.conf $APACHE_CONFDIR/ports.conf EXPOSE 8080/tcp diff --git a/apache/files/vhost-https.conf b/apache/files/vhost-https.conf new file mode 100644 index 0000000..c57ff38 --- /dev/null +++ b/apache/files/vhost-https.conf @@ -0,0 +1,26 @@ + + + ServerName www.example.com + ServerAlias * + + SSLEngine on + SSLCertificateFile /etc/ssl/private/server.pem + SSLCertificateKeyFile /etc/ssl/private/server.key + + DocumentRoot /var/www/html + + + Options -Indexes +FollowSymLinks -MultiViews + AllowOverride None + Require all granted + + + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.*$ /yourls-loader.php [L] + + + diff --git a/apache/files/vhost.conf b/apache/files/vhost.conf index 0fb3141..95e8195 100644 --- a/apache/files/vhost.conf +++ b/apache/files/vhost.conf @@ -1,4 +1,4 @@ - + ServerName www.example.com ServerAlias * From 0fb10e711e23c63c34c3613b82cd915b07782d80 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 31 Jul 2025 13:57:04 +0000 Subject: [PATCH 61/75] deploy: d1080e5c390e757c61012106079ca9837c253608 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 80e7e9b..fbd64b5 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.1" -ARG YOURLS_SHA256="ec21841af21194c8ef06a8eaaea5bf26d329741f9d09e04b32685a2d8ac4027e" +ARG YOURLS_VERSION="1.10.2" +ARG YOURLS_SHA256="c1a5c35d4f47c322d29adffb1a89642544e609808561cf340dc046af58a900e8" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index b049a0e..cd6ccfa 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.1" -ARG YOURLS_SHA256="ec21841af21194c8ef06a8eaaea5bf26d329741f9d09e04b32685a2d8ac4027e" +ARG YOURLS_VERSION="1.10.2" +ARG YOURLS_SHA256="c1a5c35d4f47c322d29adffb1a89642544e609808561cf340dc046af58a900e8" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index a99b738..1c089d4 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -17,8 +17,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.1" -ARG YOURLS_SHA256="ec21841af21194c8ef06a8eaaea5bf26d329741f9d09e04b32685a2d8ac4027e" +ARG YOURLS_VERSION="1.10.2" +ARG YOURLS_SHA256="c1a5c35d4f47c322d29adffb1a89642544e609808561cf340dc046af58a900e8" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/yourls_version b/yourls_version index 4dae298..5ad2491 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.10.1 +1.10.2 From 89dfcf9b332685465708b98d3151d39f4f6340a0 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Thu, 31 Jul 2025 16:30:53 +0000 Subject: [PATCH 62/75] deploy: c11efb81edc023de1b7b854e53fd52c48c0e1fc0 --- bin/generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 0b07b72..6cd8dde 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -16,7 +16,7 @@ cat <<-EOH Maintainers: YOURLS (@YOURLS), Léo Colombaro (@LeoColomb) -GitRepo: https://github.com/YOURLS/images.git +GitRepo: https://github.com/YOURLS/containers.git GitFetch: refs/heads/dist EOH From 089016b423fd13380adc1db9b334146ece063cf2 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Thu, 31 Jul 2025 16:37:35 +0000 Subject: [PATCH 63/75] deploy: 2a1bfbac240541dca03058eee51a254a9f2d8116 --- bin/generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/generate-stackbrew-library.sh b/bin/generate-stackbrew-library.sh index 6cd8dde..73a946b 100755 --- a/bin/generate-stackbrew-library.sh +++ b/bin/generate-stackbrew-library.sh @@ -12,7 +12,7 @@ getArches 'yourls' version=$(head -n 1 yourls_version) cat <<-EOH -# this file is generated via https://github.com/YOURLS/images/blob/$(fileCommit "$self")/$self +# this file is generated via https://github.com/YOURLS/containers/blob/$(fileCommit "$self")/$self Maintainers: YOURLS (@YOURLS), Léo Colombaro (@LeoColomb) From b322b7c1cb96d7f139000a090f0529042f6c123c Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Mon, 4 Aug 2025 09:15:43 +0000 Subject: [PATCH 64/75] deploy: 3942862e192c7ec9abaf7a3f33a6de3dfd825eee --- apache/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/apache/Dockerfile b/apache/Dockerfile index fbd64b5..8ac3813 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -35,6 +35,7 @@ RUN set -eux; \ COPY --chown=www-data:www-data config-container.php /usr/src/yourls/user/ COPY container-entrypoint.sh /usr/local/bin/ +COPY files/vhost.conf $APACHE_CONFDIR/sites-available/000-default.conf COPY files/vhost-https.conf $APACHE_CONFDIR/sites-available/default-ssl.conf COPY files/ports.conf $APACHE_CONFDIR/ports.conf From 75242585dab16fd510424ed4dadea08781919df2 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Tue, 5 Aug 2025 09:06:25 +0000 Subject: [PATCH 65/75] deploy: 45fa453f973bc388626711f943f8efd8d6bcce89 --- apache/files/vhost-https.conf | 17 +++++++++-------- apache/files/vhost.conf | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/apache/files/vhost-https.conf b/apache/files/vhost-https.conf index c57ff38..a819738 100644 --- a/apache/files/vhost-https.conf +++ b/apache/files/vhost-https.conf @@ -13,14 +13,15 @@ Options -Indexes +FollowSymLinks -MultiViews AllowOverride None Require all granted - - - RewriteEngine On - RewriteBase / - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^.*$ /yourls-loader.php [L] - + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.*$ /yourls-loader.php [L] + + + diff --git a/apache/files/vhost.conf b/apache/files/vhost.conf index 95e8195..df7344f 100644 --- a/apache/files/vhost.conf +++ b/apache/files/vhost.conf @@ -9,14 +9,15 @@ Options -Indexes +FollowSymLinks -MultiViews AllowOverride None Require all granted - - - RewriteEngine On - RewriteBase / - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^.*$ /yourls-loader.php [L] - + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.*$ /yourls-loader.php [L] + + + From b3463cd1fe9b9de202a2a220d1ffa502e791ede8 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Tue, 19 Aug 2025 10:14:17 +0000 Subject: [PATCH 66/75] deploy: 33bd4c803aaf0a5cbdc269b15cb12deb68be45d8 --- apache/Dockerfile | 3 +++ fpm-alpine/Dockerfile | 3 +++ fpm/Dockerfile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/apache/Dockerfile b/apache/Dockerfile index 8ac3813..05cd3a0 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -44,3 +44,6 @@ EXPOSE 8443/tcp ENTRYPOINT ["container-entrypoint.sh"] CMD ["apache2-foreground"] + +#checkov:skip=CKV_DOCKER_2:Not implemented +#checkov:skip=CKV_DOCKER_3:Defined upstream diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index cd6ccfa..0ef5f88 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -38,3 +38,6 @@ COPY container-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["container-entrypoint.sh"] CMD ["php-fpm"] + +#checkov:skip=CKV_DOCKER_2:Not implemented +#checkov:skip=CKV_DOCKER_3:Defined upstream diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 1c089d4..b50e9fe 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -38,3 +38,6 @@ COPY container-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["container-entrypoint.sh"] CMD ["php-fpm"] + +#checkov:skip=CKV_DOCKER_2:Not implemented +#checkov:skip=CKV_DOCKER_3:Defined upstream From ceaf09af9f84ab8d7a07462a9bd63fc0b3eda5d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 11 Jan 2026 05:16:55 +0000 Subject: [PATCH 67/75] deploy: 5128927b57a86393f3495d1a9204bdce829731b6 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 05cd3a0..6873697 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.2" -ARG YOURLS_SHA256="c1a5c35d4f47c322d29adffb1a89642544e609808561cf340dc046af58a900e8" +ARG YOURLS_VERSION="1.10.3" +ARG YOURLS_SHA256="71749ae9b3950d6a7c043b1240aba8645e912c3c22eac5abfb6ae3cc576ff740" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 0ef5f88..3ae5652 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -17,8 +17,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.2" -ARG YOURLS_SHA256="c1a5c35d4f47c322d29adffb1a89642544e609808561cf340dc046af58a900e8" +ARG YOURLS_VERSION="1.10.3" +ARG YOURLS_SHA256="71749ae9b3950d6a7c043b1240aba8645e912c3c22eac5abfb6ae3cc576ff740" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index b50e9fe..f8d26b4 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -17,8 +17,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.2" -ARG YOURLS_SHA256="c1a5c35d4f47c322d29adffb1a89642544e609808561cf340dc046af58a900e8" +ARG YOURLS_VERSION="1.10.3" +ARG YOURLS_SHA256="71749ae9b3950d6a7c043b1240aba8645e912c3c22eac5abfb6ae3cc576ff740" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/yourls_version b/yourls_version index 5ad2491..587c5f0 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.10.2 +1.10.3 From 1839562c06c847bc7931bd8b9387881b3d52841b Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 11 Jan 2026 19:47:52 +0000 Subject: [PATCH 68/75] deploy: 6688c64c003ce3b8f44a9015c88dd8c863b5b5f5 --- apache/Dockerfile | 9 ++++++--- fpm-alpine/Dockerfile | 9 ++++++--- fpm/Dockerfile | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 6873697..92d4107 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -1,8 +1,11 @@ -FROM php:8.4-apache +FROM php:8.5-apache # install the PHP extensions we need RUN set -eux; \ - docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + docker-php-ext-install -j "$(nproc)" \ + bcmath \ + pdo_mysql \ + mysqli # set recommended PHP.ini settings # see https://www.php.net/manual/en/opcache.installation.php @@ -12,7 +15,7 @@ RUN { \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=2'; \ echo 'opcache.fast_shutdown=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini + } > "$PHP_INI_DIR/conf.d/opcache-recommended.ini" RUN a2enmod rewrite expires diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 3ae5652..b0a897b 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -1,8 +1,11 @@ -FROM php:8.4-fpm-alpine +FROM php:8.5-fpm-alpine # install the PHP extensions we need RUN set -eux; \ - docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + docker-php-ext-install -j "$(nproc)" \ + bcmath \ + pdo_mysql \ + mysqli # set recommended PHP.ini settings # see https://www.php.net/manual/en/opcache.installation.php @@ -12,7 +15,7 @@ RUN { \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=2'; \ echo 'opcache.fast_shutdown=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini + } > "$PHP_INI_DIR/conf.d/opcache-recommended.ini" RUN apk add --no-cache bash diff --git a/fpm/Dockerfile b/fpm/Dockerfile index f8d26b4..d1e0bd7 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -1,8 +1,11 @@ -FROM php:8.4-fpm +FROM php:8.5-fpm # install the PHP extensions we need RUN set -eux; \ - docker-php-ext-install -j "$(nproc)" bcmath opcache pdo_mysql mysqli + docker-php-ext-install -j "$(nproc)" \ + bcmath \ + pdo_mysql \ + mysqli # set recommended PHP.ini settings # see https://www.php.net/manual/en/opcache.installation.php @@ -12,7 +15,7 @@ RUN { \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=2'; \ echo 'opcache.fast_shutdown=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini + } > "$PHP_INI_DIR/conf.d/opcache-recommended.ini" From 094f7f5ab9e8c66312bd84cf0d9355d309b10654 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sat, 7 Mar 2026 22:22:26 +0000 Subject: [PATCH 69/75] deploy: 049e3bb1853a6c42a09e67e2b2234e64951cd790 --- apache/container-entrypoint.sh | 7 ------- fpm-alpine/container-entrypoint.sh | 7 ------- fpm/container-entrypoint.sh | 7 ------- 3 files changed, 21 deletions(-) diff --git a/apache/container-entrypoint.sh b/apache/container-entrypoint.sh index b137360..6d0a0b6 100755 --- a/apache/container-entrypoint.sh +++ b/apache/container-entrypoint.sh @@ -74,13 +74,6 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then if [ ! -s user/config.php ]; then cp /usr/src/yourls/user/config-container.php user/config.php - : "${YOURLS_USER:=}" - : "${YOURLS_PASS:=}" - if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) - echo "$result" > user/config.php - fi - if [ "$uid" = '0' ]; then # attempt to ensure that user/config.php is owned by the run user # could be on a filesystem that doesn't allow chown (like some NFS setups) diff --git a/fpm-alpine/container-entrypoint.sh b/fpm-alpine/container-entrypoint.sh index b137360..6d0a0b6 100755 --- a/fpm-alpine/container-entrypoint.sh +++ b/fpm-alpine/container-entrypoint.sh @@ -74,13 +74,6 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then if [ ! -s user/config.php ]; then cp /usr/src/yourls/user/config-container.php user/config.php - : "${YOURLS_USER:=}" - : "${YOURLS_PASS:=}" - if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) - echo "$result" > user/config.php - fi - if [ "$uid" = '0' ]; then # attempt to ensure that user/config.php is owned by the run user # could be on a filesystem that doesn't allow chown (like some NFS setups) diff --git a/fpm/container-entrypoint.sh b/fpm/container-entrypoint.sh index b137360..6d0a0b6 100755 --- a/fpm/container-entrypoint.sh +++ b/fpm/container-entrypoint.sh @@ -74,13 +74,6 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then if [ ! -s user/config.php ]; then cp /usr/src/yourls/user/config-container.php user/config.php - : "${YOURLS_USER:=}" - : "${YOURLS_PASS:=}" - if [ -n "${YOURLS_USER}" ] && [ -n "${YOURLS_PASS}" ]; then - result=$(sed "s/ getenv_container('YOURLS_USER') => getenv_container('YOURLS_PASS'),/ \'${YOURLS_USER}\' => \'${YOURLS_PASS//&/\\&}\',/g" user/config.php) - echo "$result" > user/config.php - fi - if [ "$uid" = '0' ]; then # attempt to ensure that user/config.php is owned by the run user # could be on a filesystem that doesn't allow chown (like some NFS setups) From da811947acac487e9eae4f4ccc73509b5eea5eeb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sat, 23 May 2026 17:05:46 +0000 Subject: [PATCH 70/75] deploy: 5060bcb7af00d407a11fd7bdce5a40293fd50de3 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 92d4107..d99a018 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -20,8 +20,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.3" -ARG YOURLS_SHA256="71749ae9b3950d6a7c043b1240aba8645e912c3c22eac5abfb6ae3cc576ff740" +ARG YOURLS_VERSION="1.10.4" +ARG YOURLS_SHA256="1a41606138615c9869e232077b9da7b2a084e8751459f72b6c073bf0f092b808" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index b0a897b..8594240 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -20,8 +20,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.3" -ARG YOURLS_SHA256="71749ae9b3950d6a7c043b1240aba8645e912c3c22eac5abfb6ae3cc576ff740" +ARG YOURLS_VERSION="1.10.4" +ARG YOURLS_SHA256="1a41606138615c9869e232077b9da7b2a084e8751459f72b6c073bf0f092b808" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index d1e0bd7..b92d475 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -20,8 +20,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.3" -ARG YOURLS_SHA256="71749ae9b3950d6a7c043b1240aba8645e912c3c22eac5abfb6ae3cc576ff740" +ARG YOURLS_VERSION="1.10.4" +ARG YOURLS_SHA256="1a41606138615c9869e232077b9da7b2a084e8751459f72b6c073bf0f092b808" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/yourls_version b/yourls_version index 587c5f0..18b3114 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.10.3 +1.10.4 From 69546000f47369f2f6527fb422924371ffb822aa Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 19 Aug 2026 10:43:29 +0000 Subject: [PATCH 71/75] deploy: 5b7c281fba04387bc1c23a5b6b26808e5eab0007 --- apache/config-container.php | 61 +++++++++++++++++++-------------- fpm-alpine/config-container.php | 61 +++++++++++++++++++-------------- fpm/config-container.php | 61 +++++++++++++++++++-------------- 3 files changed, 105 insertions(+), 78 deletions(-) diff --git a/apache/config-container.php b/apache/config-container.php index 4584e8c..a5a52ba 100644 --- a/apache/config-container.php +++ b/apache/config-container.php @@ -1,6 +1,9 @@ getenv_container('YOURLS_PASS'), ]; +/** URL shortening method: either 36 or 62 + ** 36: generates all lowercase keywords (ie: 13jkm) + ** 62: generates mixed case keywords (ie: 13jKm or 13JKm) + ** For more information, see https://yourls.org/urlconvert */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); + /** Debug mode to output some internal information ** Default is false for live site. Enable when coding or before submitting a new issue */ define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); @@ -82,27 +97,21 @@ function getenv_container(string $name, ?string $default = null): ?string /** Skip version check. */ define( 'YOURLS_NO_VERSION_CHECK', getenv('YOURLS_NO_VERSION_CHECK') === false ?: filter_var(getenv('YOURLS_NO_VERSION_CHECK'), FILTER_VALIDATE_BOOLEAN) ); -/* -** URL Shortening settings -*/ - -/** URL shortening method: 36 or 62 */ -define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); -/* - * 36: generates all lowercase keywords (ie: 13jkm) - * 62: generates mixed case keywords (ie: 13jKm or 13JKm) - * Stick to one setting. It's best not to change after you've started creating links. - */ - /** if set to true, disable stat logging (no use for it, too busy servers, ...) */ define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); /** - * Reserved keywords (so that generated URLs won't match them) - * Define here negative, unwanted or potentially misleading keywords. - */ +* Reserved keywords (so that generated URLs won't match them) +* Define here negative, unwanted or potentially misleading keywords. +*/ $yourls_reserved_URL = [ - 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', + 'porn', + 'faggot', + 'sex', + 'nigger', + 'fuck', + 'cunt', + 'dick', ]; /* diff --git a/fpm-alpine/config-container.php b/fpm-alpine/config-container.php index 4584e8c..a5a52ba 100644 --- a/fpm-alpine/config-container.php +++ b/fpm-alpine/config-container.php @@ -1,6 +1,9 @@ getenv_container('YOURLS_PASS'), ]; +/** URL shortening method: either 36 or 62 + ** 36: generates all lowercase keywords (ie: 13jkm) + ** 62: generates mixed case keywords (ie: 13jKm or 13JKm) + ** For more information, see https://yourls.org/urlconvert */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); + /** Debug mode to output some internal information ** Default is false for live site. Enable when coding or before submitting a new issue */ define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); @@ -82,27 +97,21 @@ function getenv_container(string $name, ?string $default = null): ?string /** Skip version check. */ define( 'YOURLS_NO_VERSION_CHECK', getenv('YOURLS_NO_VERSION_CHECK') === false ?: filter_var(getenv('YOURLS_NO_VERSION_CHECK'), FILTER_VALIDATE_BOOLEAN) ); -/* -** URL Shortening settings -*/ - -/** URL shortening method: 36 or 62 */ -define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); -/* - * 36: generates all lowercase keywords (ie: 13jkm) - * 62: generates mixed case keywords (ie: 13jKm or 13JKm) - * Stick to one setting. It's best not to change after you've started creating links. - */ - /** if set to true, disable stat logging (no use for it, too busy servers, ...) */ define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); /** - * Reserved keywords (so that generated URLs won't match them) - * Define here negative, unwanted or potentially misleading keywords. - */ +* Reserved keywords (so that generated URLs won't match them) +* Define here negative, unwanted or potentially misleading keywords. +*/ $yourls_reserved_URL = [ - 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', + 'porn', + 'faggot', + 'sex', + 'nigger', + 'fuck', + 'cunt', + 'dick', ]; /* diff --git a/fpm/config-container.php b/fpm/config-container.php index 4584e8c..a5a52ba 100644 --- a/fpm/config-container.php +++ b/fpm/config-container.php @@ -1,6 +1,9 @@ getenv_container('YOURLS_PASS'), ]; +/** URL shortening method: either 36 or 62 + ** 36: generates all lowercase keywords (ie: 13jkm) + ** 62: generates mixed case keywords (ie: 13jKm or 13JKm) + ** For more information, see https://yourls.org/urlconvert */ +define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); + /** Debug mode to output some internal information ** Default is false for live site. Enable when coding or before submitting a new issue */ define( 'YOURLS_DEBUG', filter_var(getenv('YOURLS_DEBUG'), FILTER_VALIDATE_BOOLEAN) ); @@ -82,27 +97,21 @@ function getenv_container(string $name, ?string $default = null): ?string /** Skip version check. */ define( 'YOURLS_NO_VERSION_CHECK', getenv('YOURLS_NO_VERSION_CHECK') === false ?: filter_var(getenv('YOURLS_NO_VERSION_CHECK'), FILTER_VALIDATE_BOOLEAN) ); -/* -** URL Shortening settings -*/ - -/** URL shortening method: 36 or 62 */ -define( 'YOURLS_URL_CONVERT', filter_var(getenv('YOURLS_URL_CONVERT'), FILTER_VALIDATE_INT) ?: 36 ); -/* - * 36: generates all lowercase keywords (ie: 13jkm) - * 62: generates mixed case keywords (ie: 13jKm or 13JKm) - * Stick to one setting. It's best not to change after you've started creating links. - */ - /** if set to true, disable stat logging (no use for it, too busy servers, ...) */ define( 'YOURLS_NOSTATS', filter_var(getenv('YOURLS_NOSTATS'), FILTER_VALIDATE_BOOLEAN) ); /** - * Reserved keywords (so that generated URLs won't match them) - * Define here negative, unwanted or potentially misleading keywords. - */ +* Reserved keywords (so that generated URLs won't match them) +* Define here negative, unwanted or potentially misleading keywords. +*/ $yourls_reserved_URL = [ - 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', + 'porn', + 'faggot', + 'sex', + 'nigger', + 'fuck', + 'cunt', + 'dick', ]; /* From decafc1d99dabbf82d3d47a17bae6f8ce3d71007 Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Wed, 19 Aug 2026 12:27:20 +0000 Subject: [PATCH 72/75] deploy: 487fe48e00dcbdfdeeee9bc7b8d74dad9bc07b63 --- apache/container-entrypoint.sh | 46 +++++++++++++++--------------- fpm-alpine/container-entrypoint.sh | 46 +++++++++++++++--------------- fpm/container-entrypoint.sh | 46 +++++++++++++++--------------- 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/apache/container-entrypoint.sh b/apache/container-entrypoint.sh index 6d0a0b6..5bbc404 100755 --- a/apache/container-entrypoint.sh +++ b/apache/container-entrypoint.sh @@ -66,9 +66,6 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then echo >&2 "Complete! YOURLS has been successfully copied to $PWD" fi - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" - # We want to copy the initial config if the actual config file doesn't already # exist OR if it is an empty file (e.g. it has been created for the volume mount). if [ ! -s user/config.php ]; then @@ -79,27 +76,30 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # could be on a filesystem that doesn't allow chown (like some NFS setups) chown "$user:$group" user/config.php || true fi - - # ability to use custom script - for file in /docker-entrypoint-init.d/*; do - echo >&2 "Running custom script $file" - case "$file" in - *.sh) - if [ -x "$file" ]; then - "$file" || exit 1 - else - echo >&2 "... ignoring non-executable $file" - fi - ;; - *.php) - php -f "$file" - ;; - *) - echo >&2 "... ignoring $file" - ;; - esac - done fi + + # let's generate a random value to have safe defaults if they aren't specified with environment variables + sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php + + # ability to use custom script + for file in /docker-entrypoint-init.d/*; do + echo >&2 "Running custom script $file" + case "$file" in + *.sh) + if [ -x "$file" ]; then + "$file" || exit 1 + else + echo >&2 "... ignoring non-executable $file" + fi + ;; + *.php) + php -f "$file" + ;; + *) + echo >&2 "... ignoring $file" + ;; + esac + done fi exec "$@" diff --git a/fpm-alpine/container-entrypoint.sh b/fpm-alpine/container-entrypoint.sh index 6d0a0b6..5bbc404 100755 --- a/fpm-alpine/container-entrypoint.sh +++ b/fpm-alpine/container-entrypoint.sh @@ -66,9 +66,6 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then echo >&2 "Complete! YOURLS has been successfully copied to $PWD" fi - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" - # We want to copy the initial config if the actual config file doesn't already # exist OR if it is an empty file (e.g. it has been created for the volume mount). if [ ! -s user/config.php ]; then @@ -79,27 +76,30 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # could be on a filesystem that doesn't allow chown (like some NFS setups) chown "$user:$group" user/config.php || true fi - - # ability to use custom script - for file in /docker-entrypoint-init.d/*; do - echo >&2 "Running custom script $file" - case "$file" in - *.sh) - if [ -x "$file" ]; then - "$file" || exit 1 - else - echo >&2 "... ignoring non-executable $file" - fi - ;; - *.php) - php -f "$file" - ;; - *) - echo >&2 "... ignoring $file" - ;; - esac - done fi + + # let's generate a random value to have safe defaults if they aren't specified with environment variables + sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php + + # ability to use custom script + for file in /docker-entrypoint-init.d/*; do + echo >&2 "Running custom script $file" + case "$file" in + *.sh) + if [ -x "$file" ]; then + "$file" || exit 1 + else + echo >&2 "... ignoring non-executable $file" + fi + ;; + *.php) + php -f "$file" + ;; + *) + echo >&2 "... ignoring $file" + ;; + esac + done fi exec "$@" diff --git a/fpm/container-entrypoint.sh b/fpm/container-entrypoint.sh index 6d0a0b6..5bbc404 100755 --- a/fpm/container-entrypoint.sh +++ b/fpm/container-entrypoint.sh @@ -66,9 +66,6 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then echo >&2 "Complete! YOURLS has been successfully copied to $PWD" fi - # if not specified, let's generate a random value - : "${YOURLS_COOKIEKEY:=$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)}" - # We want to copy the initial config if the actual config file doesn't already # exist OR if it is an empty file (e.g. it has been created for the volume mount). if [ ! -s user/config.php ]; then @@ -79,27 +76,30 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then # could be on a filesystem that doesn't allow chown (like some NFS setups) chown "$user:$group" user/config.php || true fi - - # ability to use custom script - for file in /docker-entrypoint-init.d/*; do - echo >&2 "Running custom script $file" - case "$file" in - *.sh) - if [ -x "$file" ]; then - "$file" || exit 1 - else - echo >&2 "... ignoring non-executable $file" - fi - ;; - *.php) - php -f "$file" - ;; - *) - echo >&2 "... ignoring $file" - ;; - esac - done fi + + # let's generate a random value to have safe defaults if they aren't specified with environment variables + sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php + + # ability to use custom script + for file in /docker-entrypoint-init.d/*; do + echo >&2 "Running custom script $file" + case "$file" in + *.sh) + if [ -x "$file" ]; then + "$file" || exit 1 + else + echo >&2 "... ignoring non-executable $file" + fi + ;; + *.php) + php -f "$file" + ;; + *) + echo >&2 "... ignoring $file" + ;; + esac + done fi exec "$@" From 0e20dada42a19a11f0980d9a307f5e9662e3c89a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 28 Aug 2026 14:10:10 +0000 Subject: [PATCH 73/75] deploy: b872858c1bfa5e400c4f5656d65d85b60b44fdc0 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index d99a018..6401788 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -20,8 +20,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.4" -ARG YOURLS_SHA256="1a41606138615c9869e232077b9da7b2a084e8751459f72b6c073bf0f092b808" +ARG YOURLS_VERSION="1.10.5" +ARG YOURLS_SHA256="4c1ff34798762599eeb446884c6a436e43a89e74923aa92fdf55825b0cbb9e6e" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 8594240..b7e1823 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -20,8 +20,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.4" -ARG YOURLS_SHA256="1a41606138615c9869e232077b9da7b2a084e8751459f72b6c073bf0f092b808" +ARG YOURLS_VERSION="1.10.5" +ARG YOURLS_SHA256="4c1ff34798762599eeb446884c6a436e43a89e74923aa92fdf55825b0cbb9e6e" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index b92d475..1896124 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -20,8 +20,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.4" -ARG YOURLS_SHA256="1a41606138615c9869e232077b9da7b2a084e8751459f72b6c073bf0f092b808" +ARG YOURLS_VERSION="1.10.5" +ARG YOURLS_SHA256="4c1ff34798762599eeb446884c6a436e43a89e74923aa92fdf55825b0cbb9e6e" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/yourls_version b/yourls_version index 18b3114..db77e0e 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.10.4 +1.10.5 From ec6a3112e60524364132d6d504454e02ef49f6f5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Sun, 30 Aug 2026 10:33:47 +0000 Subject: [PATCH 74/75] deploy: af8663d1b0c0b7c750c485afe2a1ccec11bac9b2 --- apache/Dockerfile | 4 ++-- fpm-alpine/Dockerfile | 4 ++-- fpm/Dockerfile | 4 ++-- yourls_version | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apache/Dockerfile b/apache/Dockerfile index 6401788..9a549ca 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -20,8 +20,8 @@ RUN { \ RUN a2enmod rewrite expires # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.5" -ARG YOURLS_SHA256="4c1ff34798762599eeb446884c6a436e43a89e74923aa92fdf55825b0cbb9e6e" +ARG YOURLS_VERSION="1.10.6" +ARG YOURLS_SHA256="95549b8463c67a88eaa93f5dd8079599bc895f5ca047001ce385d1afdda26563" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index b7e1823..16d0a7c 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -20,8 +20,8 @@ RUN { \ RUN apk add --no-cache bash # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.5" -ARG YOURLS_SHA256="4c1ff34798762599eeb446884c6a436e43a89e74923aa92fdf55825b0cbb9e6e" +ARG YOURLS_VERSION="1.10.6" +ARG YOURLS_SHA256="95549b8463c67a88eaa93f5dd8079599bc895f5ca047001ce385d1afdda26563" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 1896124..6ba0054 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -20,8 +20,8 @@ RUN { \ # renovate: datasource=github-releases depName=YOURLS/YOURLS versioning=composer -ARG YOURLS_VERSION="1.10.5" -ARG YOURLS_SHA256="4c1ff34798762599eeb446884c6a436e43a89e74923aa92fdf55825b0cbb9e6e" +ARG YOURLS_VERSION="1.10.6" +ARG YOURLS_SHA256="95549b8463c67a88eaa93f5dd8079599bc895f5ca047001ce385d1afdda26563" ENV YOURLS_VERSION=$YOURLS_VERSION ENV YOURLS_SHA256=$YOURLS_SHA256 diff --git a/yourls_version b/yourls_version index db77e0e..7b4d9a4 100644 --- a/yourls_version +++ b/yourls_version @@ -1 +1 @@ -1.10.5 +1.10.6 From a2895c8b7080d785ae59761d489aafebaf50cebe Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sun, 30 Aug 2026 21:15:44 +0000 Subject: [PATCH 75/75] deploy: 835a708476c1c550eb97418a507aa2898edf66c2 --- apache/container-entrypoint.sh | 2 +- fpm-alpine/container-entrypoint.sh | 2 +- fpm/container-entrypoint.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apache/container-entrypoint.sh b/apache/container-entrypoint.sh index 5bbc404..43fa0fa 100755 --- a/apache/container-entrypoint.sh +++ b/apache/container-entrypoint.sh @@ -79,7 +79,7 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then fi # let's generate a random value to have safe defaults if they aren't specified with environment variables - sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php + sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php || true # ability to use custom script for file in /docker-entrypoint-init.d/*; do diff --git a/fpm-alpine/container-entrypoint.sh b/fpm-alpine/container-entrypoint.sh index 5bbc404..43fa0fa 100755 --- a/fpm-alpine/container-entrypoint.sh +++ b/fpm-alpine/container-entrypoint.sh @@ -79,7 +79,7 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then fi # let's generate a random value to have safe defaults if they aren't specified with environment variables - sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php + sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php || true # ability to use custom script for file in /docker-entrypoint-init.d/*; do diff --git a/fpm/container-entrypoint.sh b/fpm/container-entrypoint.sh index 5bbc404..43fa0fa 100755 --- a/fpm/container-entrypoint.sh +++ b/fpm/container-entrypoint.sh @@ -79,7 +79,7 @@ if [[ "$1" == apache2* ]] || [ "$1" = 'php-fpm' ]; then fi # let's generate a random value to have safe defaults if they aren't specified with environment variables - sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php + sed -i "s#modify this text with something random#$(head -c1m /dev/urandom | sha1sum | cut -d' ' -f1)#g" user/config.php || true # ability to use custom script for file in /docker-entrypoint-init.d/*; do