From f0666ab175ff48a5000e5a6c00215f9184a81eaf Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Mon, 30 Jan 2023 07:21:25 -0600 Subject: [PATCH] Revert Meilisearch rollout for now. --- CHANGELOG.md | 4 - Dockerfile | 23 +- composer.json | 1 - composer.lock | 458 +--------------- config/events.php | 1 - config/messagequeue.php | 3 - config/services.php | 1 - frontend/vue/components/Public/OnDemand.vue | 40 +- frontend/vue/components/Public/Requests.vue | 25 +- .../Api/Stations/Files/BatchAction.php | 25 +- .../Api/Stations/Files/ListAction.php | 80 +-- .../Api/Stations/FilesController.php | 18 - .../Api/Stations/OnDemand/ListAction.php | 141 +++-- .../Api/Stations/PlaylistsController.php | 51 -- .../Api/Stations/RequestsController.php | 108 ++-- .../Frontend/PublicPages/OnDemandAction.php | 2 +- src/Environment.php | 9 - src/Media/BatchUtilities.php | 44 -- src/Message/Meilisearch/AddMediaMessage.php | 19 - .../Meilisearch/UpdatePlaylistsMessage.php | 16 - src/Paginator.php | 37 +- src/Service/Meilisearch.php | 70 --- src/Service/Meilisearch/Index.php | 490 ------------------ src/Service/Meilisearch/MessageHandler.php | 65 --- src/Service/Meilisearch/PaginatorAdapter.php | 60 --- src/Service/ServiceControl.php | 1 - src/Sync/Task/CheckFolderPlaylistsTask.php | 16 +- src/Sync/Task/UpdateMeilisearchIndex.php | 149 ------ tests/Functional/Api_RequestsCest.php | 47 ++ util/docker/web/meilisearch/config.toml | 3 - util/docker/web/service.full/meilisearch.conf | 17 - util/docker/web/setup/meilisearch.sh | 7 - 32 files changed, 272 insertions(+), 1759 deletions(-) delete mode 100644 src/Message/Meilisearch/AddMediaMessage.php delete mode 100644 src/Message/Meilisearch/UpdatePlaylistsMessage.php delete mode 100644 src/Service/Meilisearch.php delete mode 100644 src/Service/Meilisearch/Index.php delete mode 100644 src/Service/Meilisearch/MessageHandler.php delete mode 100644 src/Service/Meilisearch/PaginatorAdapter.php delete mode 100644 src/Sync/Task/UpdateMeilisearchIndex.php create mode 100644 tests/Functional/Api_RequestsCest.php delete mode 100644 util/docker/web/meilisearch/config.toml delete mode 100644 util/docker/web/service.full/meilisearch.conf delete mode 100644 util/docker/web/setup/meilisearch.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 364e87677..63fac3300 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,6 @@ release channel, you can take advantage of these new features and fixes. ## New Features/Changes -- **Smarter, Faster Searches**: For searches in the Media Manager, as well as the public-facing Requests and On Demand - pages, we now use a new search tool called Meilisearch that allows for very fast, very accurate search results, as - well as more complex search queries (and other goodies, like typo correction). - ## Code Quality/Technical Changes ## Bug Fixes diff --git a/Dockerfile b/Dockerfile index 02d151cd2..927a12425 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,21 +12,6 @@ RUN go install github.com/aptible/supercronic@v0.2.1 RUN go install github.com/centrifugal/centrifugo/v4@v4.1.2 -# -# Rust dependencies build step -# -FROM rust:1-bullseye AS rust-dependencies - -RUN mkdir -p /tmp/meilisearch - -WORKDIR /tmp/meilisearch - -RUN curl -fsSL https://github.com/meilisearch/meilisearch/archive/refs/tags/v1.0.0-rc.2.tar.gz -o meilisearch.tar.gz \ - && tar -xvzf meilisearch.tar.gz --strip-components=1 \ - && cargo build --release \ - && chmod a+x ./target/release/meilisearch \ - && mv ./target/release/meilisearch /usr/local/bin/meilisearch - # # MariaDB dependencies build step # @@ -44,9 +29,6 @@ COPY --from=go-dependencies /go/bin/dockerize /usr/local/bin COPY --from=go-dependencies /go/bin/supercronic /usr/local/bin/supercronic COPY --from=go-dependencies /go/bin/centrifugo /usr/local/bin/centrifugo -# Add Meilisearch -COPY --from=rust-dependencies /usr/local/bin/meilisearch /usr/local/bin/meilisearch - # Add MariaDB dependencies COPY --from=mariadb /usr/local/bin/healthcheck.sh /usr/local/bin/db_healthcheck.sh COPY --from=mariadb /usr/local/bin/docker-entrypoint.sh /usr/local/bin/db_entrypoint.sh @@ -81,7 +63,7 @@ RUN bash /bd_build/redis/setup.sh \ RUN rm -rf /bd_build -VOLUME ["/var/azuracast/stations", "/var/azuracast/uploads", "/var/azuracast/backups", "/var/azuracast/sftpgo/persist", "/var/azuracast/servers/shoutcast2", "/var/azuracast/meilisearch/persist"] +VOLUME ["/var/azuracast/stations", "/var/azuracast/uploads", "/var/azuracast/backups", "/var/azuracast/sftpgo/persist", "/var/azuracast/servers/shoutcast2"] # # Final build (Just environment vars and squishing the FS) @@ -135,8 +117,7 @@ ENV TZ="UTC" \ PROFILING_EXTENSION_ALWAYS_ON=0 \ PROFILING_EXTENSION_HTTP_KEY=dev \ PROFILING_EXTENSION_HTTP_IP_WHITELIST=* \ - ENABLE_WEB_UPDATER="true" \ - MEILI_MASTER_KEY="zejNISMlGe_6IUGBsdjfG6c6Qi8g2RngTxOmWsTbwvw" + ENABLE_WEB_UPDATER="true" # Entrypoint and default command ENTRYPOINT ["tini", "--", "/usr/local/bin/my_init"] diff --git a/composer.json b/composer.json index 755cdc0c7..75490346f 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,6 @@ "lstrojny/fxmlrpc": "dev-master", "marcw/rss-writer": "^0.4.0", "matomo/device-detector": "^6", - "meilisearch/meilisearch-php": "^0.27.0", "mezzio/mezzio-session": "^1.3", "mezzio/mezzio-session-cache": "^1.7", "monolog/monolog": "^3", diff --git a/composer.lock b/composer.lock index b918f8986..cc9b467ce 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f92319538865587280bea86d366629b8", + "content-hash": "b1487b626a93972c92e12cb2130e0454", "packages": [ { "name": "aws/aws-crt-php", @@ -434,72 +434,6 @@ ], "time": "2022-08-10T22:54:19+00:00" }, - { - "name": "clue/stream-filter", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/clue/stream-filter.git", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/d6169430c7731d8509da7aecd0af756a5747b78e", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "Clue\\StreamFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "support": { - "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.6.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-21T13:15:14+00:00" - }, { "name": "composer/ca-bundle", "version": "1.3.5", @@ -3808,74 +3742,6 @@ }, "time": "2023-01-11T09:41:57+00:00" }, - { - "name": "meilisearch/meilisearch-php", - "version": "v0.27.0", - "source": { - "type": "git", - "url": "https://github.com/meilisearch/meilisearch-php.git", - "reference": "e95db9ed85a45dcd831573979bf1d42cb99b9b3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/meilisearch/meilisearch-php/zipball/e95db9ed85a45dcd831573979bf1d42cb99b9b3b", - "reference": "e95db9ed85a45dcd831573979bf1d42cb99b9b3b", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.4 || ^8.0", - "php-http/client-common": "^2.0", - "php-http/discovery": "^1.7", - "php-http/httplug": "^2.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.0", - "guzzlehttp/guzzle": "^7.1", - "http-interop/http-factory-guzzle": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "1.9.3", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^9.5" - }, - "suggest": { - "guzzlehttp/guzzle": "Use Guzzle ^7 as HTTP client", - "http-interop/http-factory-guzzle": "Factory for guzzlehttp/guzzle" - }, - "type": "library", - "autoload": { - "psr-4": { - "MeiliSearch\\": "src/", - "Meilisearch\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Clementine Urquizar", - "email": "clementine@meilisearch.com" - } - ], - "description": "PHP wrapper for the Meilisearch API", - "keywords": [ - "api", - "client", - "instant", - "meilisearch", - "php", - "search" - ], - "support": { - "issues": "https://github.com/meilisearch/meilisearch-php/issues", - "source": "https://github.com/meilisearch/meilisearch-php/tree/v0.27.0" - }, - "time": "2023-01-10T19:29:02+00:00" - }, { "name": "mezzio/mezzio-session", "version": "1.12.0", @@ -5041,81 +4907,6 @@ }, "time": "2022-12-09T13:57:05+00:00" }, - { - "name": "php-http/client-common", - "version": "2.6.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "45db684cd4e186dcdc2b9c06b22970fe123796c0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/45db684cd4e186dcdc2b9c06b22970fe123796c0", - "reference": "45db684cd4e186dcdc2b9c06b22970fe123796c0", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "common", - "http", - "httplug" - ], - "support": { - "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.6.0" - }, - "time": "2022-09-29T09:59:43+00:00" - }, { "name": "php-http/discovery", "version": "1.14.3", @@ -5183,253 +4974,6 @@ }, "time": "2022-07-11T14:04:40+00:00" }, - { - "name": "php-http/httplug", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "f640739f80dfa1152533976e3c112477f69274eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/f640739f80dfa1152533976e3c112477f69274eb", - "reference": "f640739f80dfa1152533976e3c112477f69274eb", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1", - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "support": { - "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.3.0" - }, - "time": "2022-02-21T09:52:22+00:00" - }, - { - "name": "php-http/message", - "version": "1.13.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/7886e647a30a966a1a8d1dad1845b71ca8678361", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.5", - "php": "^7.1 || ^8.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.6", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "laminas/laminas-diactoros": "^2.0", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "files": [ - "src/filters.php" - ], - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "support": { - "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.13.0" - }, - "time": "2022-02-11T13:41:14+00:00" - }, - { - "name": "php-http/message-factory", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/master" - }, - "time": "2015-12-19T14:08:53+00:00" - }, - { - "name": "php-http/promise", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", - "phpspec/phpspec": "^5.1.2 || ^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.1.0" - }, - "time": "2020-07-07T09:29:14+00:00" - }, { "name": "phpmyadmin/motranslator", "version": "5.3.0", diff --git a/config/events.php b/config/events.php index 99f2f38a0..f1e7dd4fb 100644 --- a/config/events.php +++ b/config/events.php @@ -144,7 +144,6 @@ return static function (CallableEventDispatcherInterface $dispatcher) { App\Sync\Task\RunBackupTask::class, App\Sync\Task\SendTimeOnSocketTask::class, App\Sync\Task\UpdateGeoLiteTask::class, - App\Sync\Task\UpdateMeilisearchIndex::class, App\Sync\Task\UpdateStorageLocationSizesTask::class, ]); } diff --git a/config/messagequeue.php b/config/messagequeue.php index a4924bcea..eec78b259 100644 --- a/config/messagequeue.php +++ b/config/messagequeue.php @@ -20,8 +20,5 @@ return [ Message\DispatchWebhookMessage::class => App\Webhook\Dispatcher::class, Message\TestWebhookMessage::class => App\Webhook\Dispatcher::class, - Message\Meilisearch\AddMediaMessage::class => App\Service\Meilisearch\MessageHandler::class, - Message\Meilisearch\UpdatePlaylistsMessage::class => App\Service\Meilisearch\MessageHandler::class, - Mailer\Messenger\SendEmailMessage::class => Mailer\Messenger\MessageHandler::class, ]; diff --git a/config/services.php b/config/services.php index 899b2fbfa..0e7b63a1d 100644 --- a/config/services.php +++ b/config/services.php @@ -125,7 +125,6 @@ return [ // $config->setSQLLogger(new Doctrine\DBAL\Logging\EchoSQLLogger); $config->addCustomNumericFunction('RAND', DoctrineExtensions\Query\Mysql\Rand::class); - $config->addCustomStringFunction('FIELD', DoctrineExtensions\Query\Mysql\Field::class); if (!Doctrine\DBAL\Types\Type::hasType('carbon_immutable')) { Doctrine\DBAL\Types\Type::addType('carbon_immutable', Carbon\Doctrine\CarbonImmutableType::class); diff --git a/frontend/vue/components/Public/OnDemand.vue b/frontend/vue/components/Public/OnDemand.vue index 55d3e6091..f7d3e53db 100644 --- a/frontend/vue/components/Public/OnDemand.vue +++ b/frontend/vue/components/Public/OnDemand.vue @@ -32,7 +32,7 @@ -