diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ac1fb53..584b8dc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#677](https://github.com/shlinkio/shlink/issues/677) Fixed `/health` endpoint returning `503` fail responses when the database connection has expired. +## 2.1.4 - 2020-04-30 + +#### Added + +* *Nothing* + +#### Changed + +* *Nothing* + +#### Deprecated + +* *Nothing* + +#### Removed + +* *Nothing* + +#### Fixed + +* [#742](https://github.com/shlinkio/shlink/issues/742) Allowed a custom GeoLite2 license key to be provided, in order to avoid download limits. + + ## 2.1.3 - 2020-04-09 #### Added diff --git a/composer.json b/composer.json index 1737f7a1..39c1e6db 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "shlinkio/shlink-common": "dev-master#e659cf9d9b5b3b131419e2f55f2e595f562baafc as 3.1.0", "shlinkio/shlink-config": "^1.0", "shlinkio/shlink-event-dispatcher": "^1.4", - "shlinkio/shlink-installer": "dev-master#f51a2186cf474fb5773b0ef74b8533878de9dd1e as 5.0.0", + "shlinkio/shlink-installer": "dev-master#dae6644587d0c1c59ca773722531551b9f436786 as 5.0.0", "shlinkio/shlink-ip-geolocation": "^1.4", "symfony/console": "^5.0", "symfony/filesystem": "^5.0", diff --git a/config/autoload/installer.global.php b/config/autoload/installer.global.php index 6c1bea01..d46aa8d7 100644 --- a/config/autoload/installer.global.php +++ b/config/autoload/installer.global.php @@ -35,6 +35,7 @@ return [ Option\Mercure\MercurePublicUrlConfigOption::class, Option\Mercure\MercureInternalUrlConfigOption::class, Option\Mercure\MercureJwtSecretConfigOption::class, + Option\UrlShortener\GeoLiteLicenseKeyConfigOption::class, ], 'installation_commands' => [ diff --git a/docker/README.md b/docker/README.md index bad7c010..aa9ae16b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -18,7 +18,7 @@ It also expects these two env vars to be provided, in order to properly generate So based on this, to run shlink on a local docker service, you should run a command like this: ```bash -docker run --name shlink -p 8080:8080 -e SHORT_DOMAIN_HOST=doma.in -e SHORT_DOMAIN_SCHEMA=https shlinkio/shlink:stable +docker run --name shlink -p 8080:8080 -e SHORT_DOMAIN_HOST=doma.in -e SHORT_DOMAIN_SCHEMA=https -e GEOLITE_LICENSE_KEY=kjh23ljkbndskj345 shlinkio/shlink:stable ``` ### Interact with shlink's CLI on a running container. @@ -173,6 +173,8 @@ This is the complete list of supported env vars: * `MERCURE_INTERNAL_HUB_URL`: An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public. If this is not provided but `MERCURE_PUBLIC_HUB_URL` was, the former one will be used to publish updates. * `MERCURE_JWT_SECRET`: The secret key that was provided to the mercure hub server, in order to be able to generate valid JWTs for publishing/subscribing to that server. +* `GEOLITE_LICENSE_KEY`: The license key used to download new GeoLite2 database files. This is not mandatory, as a default license key is provided, but it is **strongly recommended** that you provide your own. Go to [https://shlink.io/documentation/geolite-license-key](https://shlink.io/documentation/geolite-license-key) to know how to generate it. + An example using all env vars could look like this: ```bash @@ -199,6 +201,7 @@ docker run \ -e TASK_WORKER_NUM=32 \ -e "VISITS_WEBHOOKS=http://my-api.com/api/v2.3/notify,https://third-party.io/foo" \ -e DEFAULT_SHORT_CODES_LENGTH=6 \ + -e GEOLITE_LICENSE_KEY=kjh23ljkbndskj345 \ -e "MERCURE_PUBLIC_HUB_URL=https://example.com" \ -e "MERCURE_INTERNAL_HUB_URL=http://my-mercure-hub.prod.svc.cluster.local" \ -e MERCURE_JWT_SECRET=super_secret_key \ @@ -243,6 +246,7 @@ The whole configuration should have this format, but it can be split into multip "host": "something.rds.amazonaws.com", "port": "3306" }, + "geolite_license_key": "kjh23ljkbndskj345", "mercure_public_hub_url": "https://example.com", "mercure_internal_hub_url": "http://my-mercure-hub.prod.svc.cluster.local", "mercure_jwt_secret": "super_secret_key" diff --git a/docker/config/shlink_in_docker.local.php b/docker/config/shlink_in_docker.local.php index 725a019b..5662aaee 100644 --- a/docker/config/shlink_in_docker.local.php +++ b/docker/config/shlink_in_docker.local.php @@ -160,6 +160,10 @@ return [ ], ], + 'geolite2' => [ + 'license_key' => env('GEOLITE_LICENSE_KEY', 'G4Lm0C60yJsnkdPi'), + ], + 'mercure' => $helper->getMercureConfig(), ]; diff --git a/module/Core/src/Config/SimplifiedConfigParser.php b/module/Core/src/Config/SimplifiedConfigParser.php index 439a931a..fe4a4192 100644 --- a/module/Core/src/Config/SimplifiedConfigParser.php +++ b/module/Core/src/Config/SimplifiedConfigParser.php @@ -33,6 +33,7 @@ class SimplifiedConfigParser 'task_worker_num' => ['mezzio-swoole', 'swoole-http-server', 'options', 'task_worker_num'], 'visits_webhooks' => ['url_shortener', 'visits_webhooks'], 'default_short_codes_length' => ['url_shortener', 'default_short_codes_length'], + 'geolite_license_key' => ['geolite2', 'license_key'], 'mercure_public_hub_url' => ['mercure', 'public_hub_url'], 'mercure_internal_hub_url' => ['mercure', 'internal_hub_url'], 'mercure_jwt_secret' => ['mercure', 'jwt_secret'], diff --git a/module/Core/test/Config/SimplifiedConfigParserTest.php b/module/Core/test/Config/SimplifiedConfigParserTest.php index 6eee6737..6bc6f1f7 100644 --- a/module/Core/test/Config/SimplifiedConfigParserTest.php +++ b/module/Core/test/Config/SimplifiedConfigParserTest.php @@ -60,6 +60,7 @@ class SimplifiedConfigParserTest extends TestCase 'https://third-party.io/foo', ], 'default_short_codes_length' => 8, + 'geolite_license_key' => 'kjh23ljkbndskj345', 'mercure_public_hub_url' => 'public_url', 'mercure_internal_hub_url' => 'internal_url', 'mercure_jwt_secret' => 'super_secret_value', @@ -131,6 +132,10 @@ class SimplifiedConfigParserTest extends TestCase ], ], + 'geolite2' => [ + 'license_key' => 'kjh23ljkbndskj345', + ], + 'mercure' => [ 'public_hub_url' => 'public_url', 'internal_hub_url' => 'internal_url',