From 7c1e40be88970d88fc3cca26c5c322dc09851805 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 17 Nov 2019 10:38:05 +0100 Subject: [PATCH 1/2] Updated docker docs regarding image versioning --- docker/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/README.md b/docker/README.md index 8bb4a56d..32451338 100644 --- a/docker/README.md +++ b/docker/README.md @@ -215,10 +215,10 @@ These are some considerations to take into account when running multiple instanc ## Versions -Versions of this image match the shlink version it contains. +Versioning on this docker image works as follows: -For example, installing `shlinkio/shlink:1.15.0`, you will get an image containing shlink v1.15.0. +* `X.X.X`: when providing a specific version number, the image version will match the shlink version it contains. For example, installing `shlinkio/shlink:1.15.0`, you will get an image containing shlink v1.15.0. +* `stable`: always holds the latest stable tag. For example, if latest shlink version is 1.20.0, installing `shlinkio/shlink:stable`, you will get an image containing shlink v1.20.0 +* `latest`: always holds the latest contents in master, and it's considered unstable and not suitable for production. -The `latest` docker tag always holds the latest contents in master, and it's considered unestable and not suitable for production. - -> There are no official shlink images previous to v1.15.0. +> **Important**: The docker image was introduced with shlink v1.15.0, so there are no official images previous to that versions. From d030fd1aa6edc26c45ed04eb65090041d67b9426 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 17 Nov 2019 11:09:37 +0100 Subject: [PATCH 2/2] Updated GeolocationDbUpdater to always use a local lock even if redis config is provided --- CHANGELOG.md | 1 + config/autoload/locks.global.php | 10 +++++++++- module/CLI/config/dependencies.config.php | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed6fde4..6fc86591 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#512](https://github.com/shlinkio/shlink/issues/512) Fixed query params not being properly forwarded from short URL to long one. * [#540](https://github.com/shlinkio/shlink/issues/540) Fixed errors thrown when creating short URLs if the original URL has an internationalized domain name and URL validation is enabled. * [#528](https://github.com/shlinkio/shlink/issues/528) Ensured `db:create` and `db:migrate` commands do not silently fail when run as part of `install` or `update`. +* [#518](https://github.com/shlinkio/shlink/issues/518) Fixed service which updates Geolite db file to use a local lock instead of a shared one, since every shlink instance holds its own db instance. ## 1.20.0 - 2019-11-02 diff --git a/config/autoload/locks.global.php b/config/autoload/locks.global.php index 6ae160a9..db64e187 100644 --- a/config/autoload/locks.global.php +++ b/config/autoload/locks.global.php @@ -8,6 +8,10 @@ use Shlinkio\Shlink\Common\Logger\LoggerAwareDelegatorFactory; use Symfony\Component\Lock; use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; +// This class alias tricks the ConfigAbstractFactory to return Lock\Factory instances even with a different service name +$localLockFactory = 'Shlinkio\Shlink\LocalLockFactory'; +class_alias(Lock\Factory::class, $localLockFactory); + return [ 'locks' => [ @@ -19,11 +23,14 @@ return [ Lock\Store\FlockStore::class => ConfigAbstractFactory::class, Lock\Store\RedisStore::class => ConfigAbstractFactory::class, Lock\Factory::class => ConfigAbstractFactory::class, + $localLockFactory => ConfigAbstractFactory::class, ], 'aliases' => [ // With this config, a user could alias 'lock_store' => 'redis_lock_store' to override the default - 'lock_store' => Lock\Store\FlockStore::class, + 'lock_store' => 'local_lock_store', + 'redis_lock_store' => Lock\Store\RedisStore::class, + 'local_lock_store' => Lock\Store\FlockStore::class, ], 'delegators' => [ Lock\Store\RedisStore::class => [ @@ -39,6 +46,7 @@ return [ Lock\Store\FlockStore::class => ['config.locks.locks_dir'], Lock\Store\RedisStore::class => [RedisFactory::SERVICE_NAME], Lock\Factory::class => ['lock_store'], + $localLockFactory => ['local_lock_store'], ], ]; diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index 118aa253..a7f7e90e 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -58,7 +58,7 @@ return [ ], ConfigAbstractFactory::class => [ - GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, Locker::class], + GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, 'Shlinkio\Shlink\LocalLockFactory'], Command\ShortUrl\GenerateShortUrlCommand::class => [Service\UrlShortener::class, 'config.url_shortener.domain'], Command\ShortUrl\ResolveUrlCommand::class => [Service\UrlShortener::class],