diff --git a/CHANGELOG.md b/CHANGELOG.md index 5395a394..cadc1546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ 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] + +#### Added + +* *Nothing* + +#### Changed + +* *Nothing* + +#### Deprecated + +* [#428](https://github.com/shlinkio/shlink/issues/428) Deprecated preview-generation feature. It will keep working but it will be removed in Shlink v2.0.0 + +#### Removed + +* *Nothing* + +#### Fixed + +* *Nothing* + + ## 1.18.0 - 2019-08-08 #### Added @@ -55,7 +78,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#305](https://github.com/shlinkio/shlink/issues/305) Implemented changes which will allow Shlink to be truly clusterizable. * [#262](https://github.com/shlinkio/shlink/issues/262) Increased mutation score to 75%. -### Deprecated +#### Deprecated * *Nothing* @@ -86,7 +109,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#56](https://github.com/shlinkio/shlink/issues/56) Simplified supported cache, requiring APCu always. -### Deprecated +#### Deprecated * [#406](https://github.com/shlinkio/shlink/issues/406) Deprecated `PUT /short-urls/{shortCode}` REST endpoint in favor of `PATCH /short-urls/{shortCode}`. diff --git a/README.md b/README.md index 861988cb..4ee6759b 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,8 @@ Those tasks can be performed using shlink's CLI, so it should be easy to schedul Running this will improve the performance of the `doma.in/abc123/preview` URLs, which return a preview of the site. + > **Important!** Generating previews is considered deprecated and the feature will be removed in Shlink v2. + * **For shlink older than v1.17.0**: Update IP geolocation database: `/path/to/shlink/bin/cli visit:update-db` When shlink is installed it downloads a fresh [GeoLite2](https://dev.maxmind.com/geoip/geoip2/geolite2/) db file. Running this command will update this file. @@ -276,7 +278,7 @@ Available commands: short-url:generate [shortcode:generate|short-code:generate] Generates a short URL for provided long URL and returns it short-url:list [shortcode:list|short-code:list] List all short URLs short-url:parse [shortcode:parse|short-code:parse] Returns the long URL behind a short code - short-url:process-previews [shortcode:process-previews|short-code:process-previews] Processes and generates the previews for every URL, improving performance for later web requests. + short-url:process-previews [shortcode:process-previews|short-code:process-previews] [DEPRECATED] Processes and generates the previews for every URL, improving performance for later web requests. short-url:visits [shortcode:visits|short-code:visits] Returns the detailed visits information for provided short code tag tag:create Creates one or more tags. diff --git a/config/autoload/preview-generation.global.php b/config/autoload/preview-generation.global.php index 4a4fa9d1..40c1a11f 100644 --- a/config/autoload/preview-generation.global.php +++ b/config/autoload/preview-generation.global.php @@ -1,6 +1,7 @@ [ diff --git a/docs/swagger/paths/{shortCode}_preview.json b/docs/swagger/paths/{shortCode}_preview.json index a35dcf62..f6168b4d 100644 --- a/docs/swagger/paths/{shortCode}_preview.json +++ b/docs/swagger/paths/{shortCode}_preview.json @@ -1,5 +1,6 @@ { "get": { + "deprecated": true, "operationId": "shortUrlPreview", "tags": [ "URL Shortener" diff --git a/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php index fd7c0340..9cabe664 100644 --- a/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php +++ b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php @@ -14,6 +14,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; use function sprintf; +/** @deprecated */ class GeneratePreviewCommand extends Command { public const NAME = 'short-url:process-previews'; @@ -37,7 +38,8 @@ class GeneratePreviewCommand extends Command ->setName(self::NAME) ->setAliases(self::ALIASES) ->setDescription( - 'Processes and generates the previews for every URL, improving performance for later web requests.' + '[DEPRECATED] Processes and generates the previews for every URL, improving performance for later web ' + . 'requests.' ); } diff --git a/module/Common/src/Exception/PreviewGenerationException.php b/module/Common/src/Exception/PreviewGenerationException.php index b7534de5..726e60fa 100644 --- a/module/Common/src/Exception/PreviewGenerationException.php +++ b/module/Common/src/Exception/PreviewGenerationException.php @@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Common\Exception; use function sprintf; +/** @deprecated */ class PreviewGenerationException extends RuntimeException { public static function fromImageError(string $error): self diff --git a/module/Common/src/Service/PreviewGenerator.php b/module/Common/src/Service/PreviewGenerator.php index 6e1c5ede..8c44b2eb 100644 --- a/module/Common/src/Service/PreviewGenerator.php +++ b/module/Common/src/Service/PreviewGenerator.php @@ -11,6 +11,7 @@ use Symfony\Component\Filesystem\Filesystem; use function sprintf; use function urlencode; +/** @deprecated */ class PreviewGenerator implements PreviewGeneratorInterface { /** @var string */ diff --git a/module/Common/src/Service/PreviewGeneratorInterface.php b/module/Common/src/Service/PreviewGeneratorInterface.php index 3fff0158..2c9c0c72 100644 --- a/module/Common/src/Service/PreviewGeneratorInterface.php +++ b/module/Common/src/Service/PreviewGeneratorInterface.php @@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Common\Service; use Shlinkio\Shlink\Common\Exception\PreviewGenerationException; +/** @deprecated */ interface PreviewGeneratorInterface { /** diff --git a/module/Core/config/routes.config.php b/module/Core/config/routes.config.php index 1d2359a5..72c04080 100644 --- a/module/Core/config/routes.config.php +++ b/module/Core/config/routes.config.php @@ -36,14 +36,14 @@ return [ ], 'allowed_methods' => [RequestMethod::METHOD_GET], ], + + // Deprecated routes [ 'name' => 'short-url-preview', 'path' => '/{shortCode}/preview', 'middleware' => Action\PreviewAction::class, 'allowed_methods' => [RequestMethod::METHOD_GET], ], - - // Old QR code route. Deprecated [ 'name' => 'short-url-qr-code-old', 'path' => '/qr/{shortCode}[/{size:[0-9]+}]', diff --git a/module/Core/src/Action/PreviewAction.php b/module/Core/src/Action/PreviewAction.php index 3a8b05bc..2f46313f 100644 --- a/module/Core/src/Action/PreviewAction.php +++ b/module/Core/src/Action/PreviewAction.php @@ -17,6 +17,7 @@ use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException; use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; +/** @deprecated */ class PreviewAction implements MiddlewareInterface { use ResponseUtilsTrait;