Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow redis credentials be URL-decoded before passing them to connection #1928

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
This is important if you are running multiple Shlink instance on the same server, or they share the same Redis instance (even more so if they are on different versions).

* [#1905](https://github.com/shlinkio/shlink/issues/1905) Add support for PHP 8.3.
* [#1927](https://github.com/shlinkio/shlink/issues/1927) Allow redis credentials be URL-decoded before passing them to connection.

### Changed
* [#1799](https://github.com/shlinkio/shlink/issues/1799) RoadRunner/openswoole jobs are not run anymore for tasks that are actually disabled.
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
"mezzio/mezzio-problem-details": "^1.13",
"mezzio/mezzio-swoole": "^4.7",
"mlocati/ip-lib": "^1.18",
"mobiledetect/mobiledetectlib": "^3.74",
"mobiledetect/mobiledetectlib": "^4.8",
"pagerfanta/core": "^3.8",
"php-middleware/request-id": "^4.1",
"pugx/shortid-php": "^1.1",
"ramsey/uuid": "^4.7",
"shlinkio/shlink-common": "dev-main#7d46772 as 5.7",
"shlinkio/shlink-common": "dev-main#e24ea7b as 5.7",
"shlinkio/shlink-config": "dev-main#cde5d3b as 2.5",
"shlinkio/shlink-event-dispatcher": "dev-main#35ccc0b as 3.1",
"shlinkio/shlink-importer": "dev-main#d621b20 as 5.2",
"shlinkio/shlink-installer": "dev-develop#c505a19 as 8.6",
"shlinkio/shlink-installer": "dev-develop#0fde6fd as 8.6",
"shlinkio/shlink-ip-geolocation": "dev-main#4a1cef8 as 3.3",
"shlinkio/shlink-json": "dev-main#e5a111c as 1.1",
"spiral/roadrunner": "^2023.2",
Expand Down
1 change: 1 addition & 0 deletions config/autoload/cache.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'redis' => [
'servers' => $redisServers,
'sentinel_service' => EnvVars::REDIS_SENTINEL_SERVICE->loadFromEnv(),
'decode_credentials' => (bool) EnvVars::REDIS_DECODE_CREDENTIALS->loadFromEnv(false),
],
];

Expand Down
1 change: 1 addition & 0 deletions config/autoload/installer.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
Option\Worker\TaskWorkerNumConfigOption::class,
Option\Worker\WebWorkerNumConfigOption::class,
Option\Redis\RedisServersConfigOption::class,
Option\Redis\RedisDecodeCredentialsConfigOption::class,
Option\Redis\RedisSentinelServiceConfigOption::class,
Option\Redis\RedisPubSubConfigOption::class,
Option\UrlShortener\ShortCodeLengthOption::class,
Expand Down
1 change: 1 addition & 0 deletions module/Core/src/Config/EnvVars.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum EnvVars: string
case CACHE_NAMESPACE = 'CACHE_NAMESPACE';
case REDIS_SERVERS = 'REDIS_SERVERS';
case REDIS_SENTINEL_SERVICE = 'REDIS_SENTINEL_SERVICE';
case REDIS_DECODE_CREDENTIALS = 'REDIS_DECODE_CREDENTIALS';
case REDIS_PUB_SUB_ENABLED = 'REDIS_PUB_SUB_ENABLED';
case MERCURE_PUBLIC_HUB_URL = 'MERCURE_PUBLIC_HUB_URL';
case MERCURE_INTERNAL_HUB_URL = 'MERCURE_INTERNAL_HUB_URL';
Expand Down
3 changes: 2 additions & 1 deletion module/Core/src/Model/DeviceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ enum DeviceType: string

public static function matchFromUserAgent(string $userAgent): ?self
{
$detect = new MobileDetect(userAgent: $userAgent);
$detect = new MobileDetect();
$detect->setUserAgent($userAgent);

return match (true) {
// $detect->is('iOS') && $detect->isTablet() => self::IOS, // TODO To detect iPad only
Expand Down
Loading