From 60beb3d6c591ffcd261be01c009a8b0d407a6044 Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Sat, 2 Mar 2024 14:39:04 -0600 Subject: [PATCH 1/5] Disable protected mode for local Redis dev. --- util/docker/redis/redis/redis.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/docker/redis/redis/redis.conf b/util/docker/redis/redis/redis.conf index 3412f9f65..9eb347c5a 100644 --- a/util/docker/redis/redis/redis.conf +++ b/util/docker/redis/redis/redis.conf @@ -1,6 +1,8 @@ unixsocket /run/redis/redis.sock unixsocketperm 666 +protected-mode no + bind 0.0.0.0 port 6379 From b83d54bf5098a4c4d56536bb87d945d1d6efee6a Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Sat, 2 Mar 2024 14:56:41 -0600 Subject: [PATCH 2/5] Fixes #6936 -- Fix WebDJ URL. --- frontend/src/components/Public/WebDJ.vue | 8 ++------ frontend/src/components/Public/WebDJ/SettingsPanel.vue | 8 ++------ src/Controller/Frontend/PublicPages/WebDjAction.php | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/Public/WebDJ.vue b/frontend/src/components/Public/WebDJ.vue index fefcb36b9..ed26cb12a 100644 --- a/frontend/src/components/Public/WebDJ.vue +++ b/frontend/src/components/Public/WebDJ.vue @@ -7,7 +7,7 @@
- +
@@ -47,11 +47,7 @@ import {useProvideMixer} from "~/components/Public/WebDJ/useMixerValue"; import {useProvidePassthroughSync} from "~/components/Public/WebDJ/usePassthroughSync"; const props = defineProps({ - ...webcasterProps, - stationName: { - type: String, - required: true - }, + ...webcasterProps }); const webcaster = useProvideWebcaster(props); diff --git a/frontend/src/components/Public/WebDJ/SettingsPanel.vue b/frontend/src/components/Public/WebDJ/SettingsPanel.vue index 4b2c2d7ba..9297fed05 100644 --- a/frontend/src/components/Public/WebDJ/SettingsPanel.vue +++ b/frontend/src/components/Public/WebDJ/SettingsPanel.vue @@ -260,13 +260,9 @@ import {useTranslate} from "~/vendor/gettext"; import {useInjectWebDjNode} from "~/components/Public/WebDJ/useWebDjNode"; import {usePassthroughSync} from "~/components/Public/WebDJ/usePassthroughSync"; import {useInjectWebcaster} from "~/components/Public/WebDJ/useWebcaster"; +import {useAzuraCastStation} from "~/vendor/azuracast.ts"; -const props = defineProps({ - stationName: { - type: String, - required: true - } -}); +const {name: stationName} = useAzuraCastStation(); const djUsername = ref(null); const djPassword = ref(null); diff --git a/src/Controller/Frontend/PublicPages/WebDjAction.php b/src/Controller/Frontend/PublicPages/WebDjAction.php index 31cba5055..dbb9fa058 100644 --- a/src/Controller/Frontend/PublicPages/WebDjAction.php +++ b/src/Controller/Frontend/PublicPages/WebDjAction.php @@ -66,7 +66,7 @@ final class WebDjAction implements SingleActionInterface 'hide_footer' => true, ], props: [ - 'wss_url' => $wssUrl, + 'baseUri' => $wssUrl, ], ); } From 2e169b94997d687ada1ab7b77e95f1a398d2705d Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Sat, 2 Mar 2024 15:29:33 -0600 Subject: [PATCH 3/5] Fixes #6963 -- Escape cache keys for Now Playing so special characters don't cause problems. --- src/Cache/NowPlayingCache.php | 4 +++- src/Console/Command/Sync/SingleTaskCommand.php | 2 +- src/Controller/Api/Stations/OnDemand/ListAction.php | 6 +++++- src/Controller/Api/Stations/ScheduleAction.php | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Cache/NowPlayingCache.php b/src/Cache/NowPlayingCache.php index 2669d4d6d..17934d6e0 100644 --- a/src/Cache/NowPlayingCache.php +++ b/src/Cache/NowPlayingCache.php @@ -157,7 +157,9 @@ final class NowPlayingCache } return $this->cache->getItem( - 'now_playing.station_' . $identifier + urlencode( + 'now_playing.station_' . $identifier + ) ); } } diff --git a/src/Console/Command/Sync/SingleTaskCommand.php b/src/Console/Command/Sync/SingleTaskCommand.php index b9c76e079..d2b76588b 100644 --- a/src/Console/Command/Sync/SingleTaskCommand.php +++ b/src/Console/Command/Sync/SingleTaskCommand.php @@ -106,7 +106,7 @@ final class SingleTaskCommand extends AbstractSyncCommand */ public static function getCacheKey(string $taskClass): string { - return 'sync_last_run.' . self::getClassShortName($taskClass); + return urlencode('sync_last_run.' . self::getClassShortName($taskClass)); } /** diff --git a/src/Controller/Api/Stations/OnDemand/ListAction.php b/src/Controller/Api/Stations/OnDemand/ListAction.php index a4080be5c..7bd508b25 100644 --- a/src/Controller/Api/Stations/OnDemand/ListAction.php +++ b/src/Controller/Api/Stations/OnDemand/ListAction.php @@ -65,7 +65,11 @@ final class ListAction extends AbstractSearchableListAction private function getPlaylists( Station $station ): array { - $item = $this->psr6Cache->getItem('station_' . $station->getIdRequired() . '_on_demand_playlists'); + $item = $this->psr6Cache->getItem( + urlencode( + 'station_' . $station->getIdRequired() . '_on_demand_playlists' + ) + ); if (!$item->isHit()) { $playlistIds = $this->em->createQuery( diff --git a/src/Controller/Api/Stations/ScheduleAction.php b/src/Controller/Api/Stations/ScheduleAction.php index 74f585003..1865cd9ea 100644 --- a/src/Controller/Api/Stations/ScheduleAction.php +++ b/src/Controller/Api/Stations/ScheduleAction.php @@ -81,7 +81,7 @@ final class ScheduleAction implements SingleActionInterface . $dateRange->getStart()->format('Ymd') . '-' . $dateRange->getEnd()->format('Ymd'); - $cacheItem = $this->psr6Cache->getItem($cacheKey); + $cacheItem = $this->psr6Cache->getItem(urlencode($cacheKey)); if (!$cacheItem->isHit()) { $nowTz = CarbonImmutable::now($station->getTimezoneObject()); @@ -113,7 +113,7 @@ final class ScheduleAction implements SingleActionInterface $cacheKey = 'api_station_' . $station->getId() . '_schedule_upcoming'; } - $cacheItem = $this->psr6Cache->getItem($cacheKey); + $cacheItem = $this->psr6Cache->getItem(urlencode($cacheKey)); if (!$cacheItem->isHit()) { $cacheItem->set($this->scheduleRepo->getUpcomingSchedule($station, $now)); From 17bf52612b317046b6e74103b510d698c97294cd Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Sat, 2 Mar 2024 15:35:33 -0600 Subject: [PATCH 4/5] Fixes #6951 -- Fix type issue on InstallCommand. --- src/Installer/Command/InstallCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Installer/Command/InstallCommand.php b/src/Installer/Command/InstallCommand.php index 267bb082d..b3400f396 100644 --- a/src/Installer/Command/InstallCommand.php +++ b/src/Installer/Command/InstallCommand.php @@ -228,18 +228,18 @@ final class InstallCommand extends Command $envConfig[$port]['name'], $envConfig[$port]['description'] ?? '' ), - $env[$port] + Types::stringOrNull($env[$port]) ); } $azuracastEnv[Environment::AUTO_ASSIGN_PORT_MIN] = $io->ask( $azuracastEnvConfig[Environment::AUTO_ASSIGN_PORT_MIN]['name'], - $azuracastEnv[Environment::AUTO_ASSIGN_PORT_MIN] + Types::stringOrNull($azuracastEnv[Environment::AUTO_ASSIGN_PORT_MIN]) ); $azuracastEnv[Environment::AUTO_ASSIGN_PORT_MAX] = $io->ask( $azuracastEnvConfig[Environment::AUTO_ASSIGN_PORT_MAX]['name'], - $azuracastEnv[Environment::AUTO_ASSIGN_PORT_MAX] + Types::stringOrNull($azuracastEnv[Environment::AUTO_ASSIGN_PORT_MAX]) ); $stationPorts = Configuration::enumerateDefaultPorts( From cfb190ba1390bb3ce41ca989354ac3f906771a4e Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Sat, 2 Mar 2024 15:35:48 -0600 Subject: [PATCH 5/5] Remove Codeception from the standard "cleanup-and-test" suite, move to "cleanup-and-test-full". --- composer.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9da97bf6d..27ecaed05 100644 --- a/composer.json +++ b/composer.json @@ -176,13 +176,17 @@ "@phpcbf", "@dev-test" ], + "cleanup-and-test-full": [ + "@phpcbf", + "@dev-test", + "@codeception-no-coverage" + ], "codeception": "codecept run --no-interaction --coverage --coverage-xml --fail-fast", "codeception-no-coverage": "codecept run --no-interaction", "dev-test": [ "@phplint", "@phpstan", - "@phpcs", - "@codeception-no-coverage" + "@phpcs" ], "phpcbf": "phpcbf", "phpcs": "phpcs",