Update yourls#9068
Conversation
|
Wouldn't it be slightly more secure to implement |
|
See docker-library/wordpress#557 for where I'm finally trying to do exactly that for WordPress (but you've got the benefit of not worrying about backwards compatibility here). |
Changes: - YOURLS/containers@cb25497: Use PHP 8.0 - YOURLS/containers@3b766d4: Move ENV_FILE usage to config file - YOURLS/containers@4d53a3e: Update to 1.8 - YOURLS/containers@bdcc470: Update README.md - YOURLS/containers@5997d36: Support more platform with QEMU - YOURLS/containers@d2e5a89: Prefer BCMath over GMP - YOURLS/containers@d1abb37: Add GMP extension to the PHP env - YOURLS/containers@0490beb: Fix related repository - YOURLS/containers@ca44fa1: Build variants - YOURLS/containers@a5f0614: Add initial GitHub Actions for Container Registry - YOURLS/containers@06cd297: Bump actions/checkout from v2.3.3 to v2.3.4 - YOURLS/containers@faa119e: Bump actions/checkout from v2.3.2 to v2.3.3 - YOURLS/containers@22ee2ef: Bump actions/checkout from v2.3.1 to v2.3.2 - YOURLS/containers@45b26ce: Update to 1.7.9 - YOURLS/containers@e0b94b1: Allow using docker secrets for env variables (YOURLS/containers#57) - YOURLS/containers@a8e13b5: Bump actions/checkout from v2.3.0 to v2.3.1 - YOURLS/containers@1ab4077: Bump actions/checkout from v2.2.0 to v2.3.0 - YOURLS/containers@de05e1f: Update dependabot.yml - YOURLS/containers@06cf288: Bump actions/checkout from v1 to v2.2.0 - YOURLS/containers@e002ec4: Create Dependabot config file - YOURLS/containers@fe07662: update PHP version and ran update.sh
|
@tianon Sorry for my very (very very) late answer. Could we just wait for YOURLS v1.8.1 before merging? Got a little issue on 1.8, already fixed but we need to release a new version. I'll ping you when done. |
Diff for 0444aef:diff --git a/_bashbrew-cat b/_bashbrew-cat
index ebad9ef..f15d364 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,17 +1,17 @@
Maintainers: YOURLS <yourls@yourls.org> (@YOURLS), Léo Colombaro <git@colombaro.fr> (@LeoColomb)
GitRepo: https://github.com/YOURLS/docker-yourls.git
-Tags: 1.7.9-apache, 1.7-apache, 1-apache, apache, 1.7.9, 1.7, 1, latest
+Tags: 1.8-apache, 1-apache, apache, 1.8, 1, latest
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: fe07662938efe12d7c8c82bea32d1d34874d0665
+GitCommit: cb2549780e6f062993c136d4da74b8463f269534
Directory: apache
-Tags: 1.7.9-fpm, 1.7-fpm, 1-fpm, fpm
+Tags: 1.8-fpm, 1-fpm, fpm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: fe07662938efe12d7c8c82bea32d1d34874d0665
+GitCommit: cb2549780e6f062993c136d4da74b8463f269534
Directory: fpm
-Tags: 1.7.9-fpm-alpine, 1.7-fpm-alpine, 1-fpm-alpine, fpm-alpine
+Tags: 1.8-fpm-alpine, 1-fpm-alpine, fpm-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: fe07662938efe12d7c8c82bea32d1d34874d0665
+GitCommit: cb2549780e6f062993c136d4da74b8463f269534
Directory: fpm-alpine
diff --git a/_bashbrew-list b/_bashbrew-list
index d42c18e..01ef425 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -2,14 +2,10 @@ yourls:1
yourls:1-apache
yourls:1-fpm
yourls:1-fpm-alpine
-yourls:1.7
-yourls:1.7-apache
-yourls:1.7-fpm
-yourls:1.7-fpm-alpine
-yourls:1.7.9
-yourls:1.7.9-apache
-yourls:1.7.9-fpm
-yourls:1.7.9-fpm-alpine
+yourls:1.8
+yourls:1.8-apache
+yourls:1.8-fpm
+yourls:1.8-fpm-alpine
yourls:apache
yourls:fpm
yourls:fpm-alpine
diff --git a/yourls_fpm-alpine/Dockerfile b/yourls_fpm-alpine/Dockerfile
index c2aafb8..d0e3ad3 100644
--- a/yourls_fpm-alpine/Dockerfile
+++ b/yourls_fpm-alpine/Dockerfile
@@ -1,8 +1,8 @@
-FROM php:7.4-fpm-alpine
+FROM php:8.0-fpm-alpine
# install the PHP extensions we need
RUN set -eux; \
- docker-php-ext-install -j "$(nproc)" opcache pdo_mysql mysqli
+ 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
@@ -16,8 +16,8 @@ RUN { \
RUN apk add --no-cache bash
-ENV YOURLS_VERSION 1.7.9
-ENV YOURLS_SHA256 0d9106b2936289d2fe5d4d6c017a77f96c79f4b2cacf1b59a0837d0032ca96d7
+ENV YOURLS_VERSION 1.8
+ENV YOURLS_SHA256 76c6db3b37a9c9f2570d280dce03b0fc34cd690767af77a2aed2cb2fbbaf546f
RUN set -eux; \
curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \
diff --git a/yourls_fpm-alpine/config-docker.php b/yourls_fpm-alpine/config-docker.php
index f17c64c..802c410 100644
--- a/yourls_fpm-alpine/config-docker.php
+++ b/yourls_fpm-alpine/config-docker.php
@@ -3,25 +3,36 @@
* Edit this file with your own settings and save it as "config.php"
*/
+// a helper function to lookup "env_FILE", "env", then fallback
+function getenv_docker(string $name, ?string $default = null): ?string {
+ if ($fileEnv = getenv($name . '_FILE')) {
+ return trim(file_get_contents($fileEnv));
+ }
+ if ($value = getenv($name)) {
+ return $value;
+ }
+ return $default;
+}
+
/*
** MySQL settings - You can get this info from your web host
*/
/** MySQL database username */
-define( 'YOURLS_DB_USER', getenv('YOURLS_DB_USER') ?: 'root' );
+define( 'YOURLS_DB_USER', getenv_docker('YOURLS_DB_USER', 'root') );
/** MySQL database password */
-define( 'YOURLS_DB_PASS', getenv('YOURLS_DB_PASS') );
+define( 'YOURLS_DB_PASS', getenv_docker('YOURLS_DB_PASS') );
/** The name of the database for YOURLS */
-define( 'YOURLS_DB_NAME', getenv('YOURLS_DB_NAME') ?: 'yourls' );
+define( 'YOURLS_DB_NAME', getenv_docker('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('YOURLS_DB_HOST') ?: 'mysql' );
+define( 'YOURLS_DB_HOST', getenv_docker('YOURLS_DB_HOST', 'mysql') );
/** MySQL tables prefix */
-define( 'YOURLS_DB_PREFIX', getenv('YOURLS_DB_PREFIX') ?: 'yourls_' );
+define( 'YOURLS_DB_PREFIX', getenv_docker('YOURLS_DB_PREFIX', 'yourls_') );
/*
** Site options
@@ -29,7 +40,7 @@ define( 'YOURLS_DB_PREFIX', getenv('YOURLS_DB_PREFIX') ?: 'yourls_' );
/** 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('YOURLS_SITE') ?: 'http://your-own-domain-here.com' );
+define( 'YOURLS_SITE', getenv_docker('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 );
@@ -57,7 +68,7 @@ define( 'YOURLS_COOKIEKEY', getenv('YOURLS_COOKIEKEY') ?: 'modify this text with
** YOURLS will auto encrypt plain text passwords in this file
** Read http://yourls.org/userpassword for more information */
$yourls_user_passwords = [
- getenv('YOURLS_USER') => getenv('YOURLS_PASS'),
+ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),
];
/** Debug mode to output some internal information
diff --git a/yourls_fpm/Dockerfile b/yourls_fpm/Dockerfile
index a52b659..edeb88f 100644
--- a/yourls_fpm/Dockerfile
+++ b/yourls_fpm/Dockerfile
@@ -1,8 +1,8 @@
-FROM php:7.4-fpm
+FROM php:8.0-fpm
# install the PHP extensions we need
RUN set -eux; \
- docker-php-ext-install -j "$(nproc)" opcache pdo_mysql mysqli
+ 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
@@ -15,8 +15,8 @@ RUN { \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
-ENV YOURLS_VERSION 1.7.9
-ENV YOURLS_SHA256 0d9106b2936289d2fe5d4d6c017a77f96c79f4b2cacf1b59a0837d0032ca96d7
+ENV YOURLS_VERSION 1.8
+ENV YOURLS_SHA256 76c6db3b37a9c9f2570d280dce03b0fc34cd690767af77a2aed2cb2fbbaf546f
RUN set -eux; \
curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \
diff --git a/yourls_fpm/config-docker.php b/yourls_fpm/config-docker.php
index f17c64c..802c410 100644
--- a/yourls_fpm/config-docker.php
+++ b/yourls_fpm/config-docker.php
@@ -3,25 +3,36 @@
* Edit this file with your own settings and save it as "config.php"
*/
+// a helper function to lookup "env_FILE", "env", then fallback
+function getenv_docker(string $name, ?string $default = null): ?string {
+ if ($fileEnv = getenv($name . '_FILE')) {
+ return trim(file_get_contents($fileEnv));
+ }
+ if ($value = getenv($name)) {
+ return $value;
+ }
+ return $default;
+}
+
/*
** MySQL settings - You can get this info from your web host
*/
/** MySQL database username */
-define( 'YOURLS_DB_USER', getenv('YOURLS_DB_USER') ?: 'root' );
+define( 'YOURLS_DB_USER', getenv_docker('YOURLS_DB_USER', 'root') );
/** MySQL database password */
-define( 'YOURLS_DB_PASS', getenv('YOURLS_DB_PASS') );
+define( 'YOURLS_DB_PASS', getenv_docker('YOURLS_DB_PASS') );
/** The name of the database for YOURLS */
-define( 'YOURLS_DB_NAME', getenv('YOURLS_DB_NAME') ?: 'yourls' );
+define( 'YOURLS_DB_NAME', getenv_docker('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('YOURLS_DB_HOST') ?: 'mysql' );
+define( 'YOURLS_DB_HOST', getenv_docker('YOURLS_DB_HOST', 'mysql') );
/** MySQL tables prefix */
-define( 'YOURLS_DB_PREFIX', getenv('YOURLS_DB_PREFIX') ?: 'yourls_' );
+define( 'YOURLS_DB_PREFIX', getenv_docker('YOURLS_DB_PREFIX', 'yourls_') );
/*
** Site options
@@ -29,7 +40,7 @@ define( 'YOURLS_DB_PREFIX', getenv('YOURLS_DB_PREFIX') ?: 'yourls_' );
/** 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('YOURLS_SITE') ?: 'http://your-own-domain-here.com' );
+define( 'YOURLS_SITE', getenv_docker('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 );
@@ -57,7 +68,7 @@ define( 'YOURLS_COOKIEKEY', getenv('YOURLS_COOKIEKEY') ?: 'modify this text with
** YOURLS will auto encrypt plain text passwords in this file
** Read http://yourls.org/userpassword for more information */
$yourls_user_passwords = [
- getenv('YOURLS_USER') => getenv('YOURLS_PASS'),
+ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),
];
/** Debug mode to output some internal information
diff --git a/yourls_latest/Dockerfile b/yourls_latest/Dockerfile
index 1f28dc8..870af47 100644
--- a/yourls_latest/Dockerfile
+++ b/yourls_latest/Dockerfile
@@ -1,8 +1,8 @@
-FROM php:7.4-apache
+FROM php:8.0-apache
# install the PHP extensions we need
RUN set -eux; \
- docker-php-ext-install -j "$(nproc)" opcache pdo_mysql mysqli
+ 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
@@ -16,8 +16,8 @@ RUN { \
RUN a2enmod rewrite expires
-ENV YOURLS_VERSION 1.7.9
-ENV YOURLS_SHA256 0d9106b2936289d2fe5d4d6c017a77f96c79f4b2cacf1b59a0837d0032ca96d7
+ENV YOURLS_VERSION 1.8
+ENV YOURLS_SHA256 76c6db3b37a9c9f2570d280dce03b0fc34cd690767af77a2aed2cb2fbbaf546f
RUN set -eux; \
curl -o yourls.tar.gz -fsSL "https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz"; \
diff --git a/yourls_latest/config-docker.php b/yourls_latest/config-docker.php
index f17c64c..802c410 100644
--- a/yourls_latest/config-docker.php
+++ b/yourls_latest/config-docker.php
@@ -3,25 +3,36 @@
* Edit this file with your own settings and save it as "config.php"
*/
+// a helper function to lookup "env_FILE", "env", then fallback
+function getenv_docker(string $name, ?string $default = null): ?string {
+ if ($fileEnv = getenv($name . '_FILE')) {
+ return trim(file_get_contents($fileEnv));
+ }
+ if ($value = getenv($name)) {
+ return $value;
+ }
+ return $default;
+}
+
/*
** MySQL settings - You can get this info from your web host
*/
/** MySQL database username */
-define( 'YOURLS_DB_USER', getenv('YOURLS_DB_USER') ?: 'root' );
+define( 'YOURLS_DB_USER', getenv_docker('YOURLS_DB_USER', 'root') );
/** MySQL database password */
-define( 'YOURLS_DB_PASS', getenv('YOURLS_DB_PASS') );
+define( 'YOURLS_DB_PASS', getenv_docker('YOURLS_DB_PASS') );
/** The name of the database for YOURLS */
-define( 'YOURLS_DB_NAME', getenv('YOURLS_DB_NAME') ?: 'yourls' );
+define( 'YOURLS_DB_NAME', getenv_docker('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('YOURLS_DB_HOST') ?: 'mysql' );
+define( 'YOURLS_DB_HOST', getenv_docker('YOURLS_DB_HOST', 'mysql') );
/** MySQL tables prefix */
-define( 'YOURLS_DB_PREFIX', getenv('YOURLS_DB_PREFIX') ?: 'yourls_' );
+define( 'YOURLS_DB_PREFIX', getenv_docker('YOURLS_DB_PREFIX', 'yourls_') );
/*
** Site options
@@ -29,7 +40,7 @@ define( 'YOURLS_DB_PREFIX', getenv('YOURLS_DB_PREFIX') ?: 'yourls_' );
/** 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('YOURLS_SITE') ?: 'http://your-own-domain-here.com' );
+define( 'YOURLS_SITE', getenv_docker('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 );
@@ -57,7 +68,7 @@ define( 'YOURLS_COOKIEKEY', getenv('YOURLS_COOKIEKEY') ?: 'modify this text with
** YOURLS will auto encrypt plain text passwords in this file
** Read http://yourls.org/userpassword for more information */
$yourls_user_passwords = [
- getenv('YOURLS_USER') => getenv('YOURLS_PASS'),
+ getenv_docker('YOURLS_USER') => getenv_docker('YOURLS_PASS'),
];
/** Debug mode to output some internal information
|
|
@yosifkit Thanks, but I would have appreciated a follow-up to my previous comment... |
|
Oops, looks like he got carried away while reviewing the set of pending today, sorry! 😩 Would you like to revert for now, or let it ride? (Next time I'd suggest marking the PR as a draft or temporarily closing it if you don't want it merged yet 👍) |
Naa, let it ride 🙂
Ah, good one indeed, forgot about this. |
|
Sorry, 🙇 I saw the new commit & diff comment and just assumed it was the update 😞 🤦 |
Changes: