diff --git a/CHANGELOG.md b/CHANGELOG.md index bb9f5f0c..683bcf7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## [3.6.4] - 2023-09-22 ### Added * *Nothing* ### Changed -* *Nothing* +* [#1866](https://github.com/shlinkio/shlink/issues/1866) The `INITIAL_API_KEY` env var is now only relevant for the official docker image. + + Going forward, new non-docker Shlink installations provisioned with env vars that also wish to provide an initial API key, should do it by using the `vendor/bin/shlink-installer init --initial-api-key=%SOME_KEY%` command, instead of using `INITIAL_API_KEY`. ### Deprecated * *Nothing* @@ -20,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this ### Fixed * [#1819](https://github.com/shlinkio/shlink/issues/1819) Fix incorrect timeout when running DB commands during Shlink start-up. * [#1870](https://github.com/shlinkio/shlink/issues/1870) Make sure shared locks include the cache prefix when using Redis. +* [#1866](https://github.com/shlinkio/shlink/issues/1866) Fix error when starting docker image with `INITIAL_API_KEY` env var. ## [3.6.3] - 2023-06-14 diff --git a/composer.json b/composer.json index 4361797e..9c784a06 100644 --- a/composer.json +++ b/composer.json @@ -45,11 +45,11 @@ "php-middleware/request-id": "^4.1", "pugx/shortid-php": "^1.1", "ramsey/uuid": "^4.7", - "shlinkio/shlink-common": "dev-main#5a8bd5a as 5.6", + "shlinkio/shlink-common": "^5.6", "shlinkio/shlink-config": "^2.4", "shlinkio/shlink-event-dispatcher": "^3.0", "shlinkio/shlink-importer": "^5.1", - "shlinkio/shlink-installer": "^8.4.2", + "shlinkio/shlink-installer": "^8.5", "shlinkio/shlink-ip-geolocation": "^3.2", "shlinkio/shlink-json": "^1.0", "spiral/roadrunner": "^2023.1", diff --git a/config/autoload/installer.global.php b/config/autoload/installer.global.php index 029a50d6..966e36ee 100644 --- a/config/autoload/installer.global.php +++ b/config/autoload/installer.global.php @@ -86,6 +86,9 @@ return [ InstallationCommand::API_KEY_GENERATE->value => [ 'command' => 'bin/cli ' . Command\Api\GenerateKeyCommand::NAME, ], + InstallationCommand::API_KEY_CREATE->value => [ + 'command' => 'bin/cli ' . Command\Api\InitialApiKeyCommand::NAME, + ], ], ], diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 1a9e44e3..06cb8ec4 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -10,18 +10,13 @@ if [ -z "${GEOLITE_LICENSE_KEY}" ] || [ "${SKIP_INITIAL_GEOLITE_DOWNLOAD}" == "t flags="${flags} --skip-download-geolite" fi -# TODO If INITIAL_API_KEY was provided, create an initial API key -#if [ -n "${INITIAL_API_KEY}" ]; then -# flags="${flags} --initial-api-key=${INITIAL_API_KEY}" -#fi - -php vendor/bin/shlink-installer init ${flags} - # If INITIAL_API_KEY was provided, create an initial API key if [ -n "${INITIAL_API_KEY}" ]; then - php bin/cli api-key:initial "${INITIAL_API_KEY}" + flags="${flags} --initial-api-key=${INITIAL_API_KEY}" fi +php vendor/bin/shlink-installer init ${flags} + # Periodically run visit:locate every hour, if ENABLE_PERIODIC_VISIT_LOCATE=true was provided and running as root # FIXME: ENABLE_PERIODIC_VISIT_LOCATE is deprecated. Remove cron support in Shlink 4.0.0 if [ "${ENABLE_PERIODIC_VISIT_LOCATE}" = "true" ] && [ "${SHLINK_USER_ID}" = "root" ]; then