From 6a73c7053e3283a2e69ee1292eccafdae41c4bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Tue, 29 Jul 2025 12:28:35 +0200 Subject: [PATCH] Downsizing: replace db --- .env.dist | 14 +- Dockerfile | 5 +- compose.yaml | 18 +- composer.lock | 584 +-------------------------- config/bundles.php | 1 - config/packages/framework.yaml | 2 +- config/services.yaml | 11 +- migrations/Version20250516120936.php | 77 ---- migrations/Version20250516123543.php | 37 -- migrations/Version20250516123632.php | 31 -- src/Entity/Nzine.php | 2 +- src/Entity/NzineBot.php | 8 +- symfony.lock | 9 - 13 files changed, 28 insertions(+), 771 deletions(-) delete mode 100644 migrations/Version20250516120936.php delete mode 100644 migrations/Version20250516123543.php delete mode 100644 migrations/Version20250516123632.php diff --git a/.env.dist b/.env.dist index 35ec3a6..f741802 100644 --- a/.env.dist +++ b/.env.dist @@ -20,17 +20,18 @@ APP_SECRET=9e287f1ad737386dde46d51e80487236 ###< symfony/framework-bundle ### ###> docker ### SERVER_NAME=localhost -POSTGRES_DB=newsroom_db -POSTGRES_USER=dn_user -POSTGRES_PASSWORD=password -POSTGRES_VERSION=17 -POSTGRES_CHARSET=utf8 +MYSQL_DATABASE=unfold_db +MYSQL_USER=unfold_user +MYSQL_PASSWORD=password +MYSQL_ROOT_PASSWORD=root_password +MYSQL_VERSION=8.0 +MYSQL_CHARSET=utf8mb4 ###< docker ### ###> doctrine/doctrine-bundle ### # Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=${POSTGRES_CHARSET}" +DATABASE_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@database:3306/${MYSQL_DATABASE}?serverVersion=${MYSQL_VERSION}&charset=${MYSQL_CHARSET}" ###< doctrine/doctrine-bundle ### ###> symfony/mercure-bundle ### @@ -50,4 +51,3 @@ REDIS_PASSWORD=r_password LNBITS_URL=https://legend.lnbits.com LNBITS_API_KEY= ###< LNBits ### - diff --git a/Dockerfile b/Dockerfile index 9904a2f..107ba02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ ENV PHP_INI_SCAN_DIR=":$PHP_INI_DIR/app.conf.d" ###> recipes ### ###> doctrine/doctrine-bundle ### -RUN install-php-extensions pdo pdo_pgsql +RUN install-php-extensions pdo pdo_mysql ###< doctrine/doctrine-bundle ### ###< recipes ### @@ -100,5 +100,4 @@ RUN set -eux; \ composer dump-autoload --classmap-authoritative --no-dev; \ composer dump-env prod; \ composer run-script --no-dev post-install-cmd; \ - chmod +x bin/console; sync; \ - docker exec newsroom-php-1 php bin/console asset-map:compile; + chmod +x bin/console; sync; diff --git a/compose.yaml b/compose.yaml index 688c8b3..908893a 100644 --- a/compose.yaml +++ b/compose.yaml @@ -10,7 +10,7 @@ services: MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} # Run "composer require symfony/orm-pack" to install and configure Doctrine ORM - DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8} + DATABASE_URL: mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8.0}&charset=${MYSQL_CHARSET:-utf8mb4} # Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration MERCURE_URL: ${MERCURE_URL:-http://php/.well-known/mercure} MERCURE_PUBLIC_URL: ${MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure} @@ -38,21 +38,21 @@ services: ###> doctrine/doctrine-bundle ### database: - image: postgres:${POSTGRES_VERSION:-16}-alpine + image: mysql:${MYSQL_VERSION:-8.0} environment: - POSTGRES_DB: ${POSTGRES_DB:-app} - # You should definitely change the password in production - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!} - POSTGRES_USER: ${POSTGRES_USER:-app} + MYSQL_DATABASE: ${MYSQL_DATABASE:-app} + MYSQL_USER: ${MYSQL_USER:-app} + MYSQL_PASSWORD: ${MYSQL_PASSWORD:-!ChangeMe!} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-!ChangeRootPassword!} healthcheck: - test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"] + test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] timeout: 5s retries: 5 start_period: 60s volumes: - - database_data:/var/lib/postgresql/data:rw + - database_data:/var/lib/mysql:rw # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! - # - ./docker/db/data:/var/lib/postgresql/data:rw + # - ./docker/db/data:/var/lib/mysql:rw ###< doctrine/doctrine-bundle ### cron: diff --git a/composer.lock b/composer.lock index 988eb43..27e891f 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": "b86dce5335224284e826d5e102c0bc65", + "content-hash": "9363e776834fe38b6d383eabb8461adb", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1507,73 +1507,6 @@ }, "time": "2025-01-24T11:45:48+00:00" }, - { - "name": "elasticsearch/elasticsearch", - "version": "v7.17.2", - "source": { - "type": "git", - "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "2d302233f2bb0926812d82823bb820d405e130fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/2d302233f2bb0926812d82823bb820d405e130fc", - "reference": "2d302233f2bb0926812d82823bb820d405e130fc", - "shasum": "" - }, - "require": { - "ext-json": ">=1.3.7", - "ezimuel/ringphp": "^1.1.2", - "php": "^7.3 || ^8.0", - "psr/log": "^1|^2|^3" - }, - "require-dev": { - "ext-yaml": "*", - "ext-zip": "*", - "mockery/mockery": "^1.2", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "^3.4", - "symfony/finder": "~4.0" - }, - "suggest": { - "ext-curl": "*", - "monolog/monolog": "Allows for client-level logging and tracing" - }, - "type": "library", - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Elasticsearch\\": "src/Elasticsearch/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0", - "LGPL-2.1-only" - ], - "authors": [ - { - "name": "Zachary Tong" - }, - { - "name": "Enrico Zimuel" - } - ], - "description": "PHP Client for Elasticsearch", - "keywords": [ - "client", - "elasticsearch", - "search" - ], - "support": { - "issues": "https://github.com/elastic/elasticsearch-php/issues", - "source": "https://github.com/elastic/elasticsearch-php/tree/v7.17.2" - }, - "time": "2023-04-21T15:31:12+00:00" - }, { "name": "embed/embed", "version": "v4.4.17", @@ -1866,217 +1799,6 @@ ], "time": "2024-10-21T23:18:20+00:00" }, - { - "name": "ezimuel/guzzlestreams", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/ezimuel/guzzlestreams.git", - "reference": "b4b5a025dfee70d6cd34c780e07330eb93d5b997" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezimuel/guzzlestreams/zipball/b4b5a025dfee70d6cd34c780e07330eb93d5b997", - "reference": "b4b5a025dfee70d6cd34c780e07330eb93d5b997", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Fork of guzzle/streams (abandoned) to be used with elasticsearch-php", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "support": { - "source": "https://github.com/ezimuel/guzzlestreams/tree/3.1.0" - }, - "time": "2022-10-24T12:58:50+00:00" - }, - { - "name": "ezimuel/ringphp", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/ezimuel/ringphp.git", - "reference": "5e4ee1dfc7a323b87873b83f17c69c76ba047793" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezimuel/ringphp/zipball/5e4ee1dfc7a323b87873b83f17c69c76ba047793", - "reference": "5e4ee1dfc7a323b87873b83f17c69c76ba047793", - "shasum": "" - }, - "require": { - "ezimuel/guzzlestreams": "^3.0.1", - "php": ">=5.4.0", - "react/promise": "^2.0 || ^3.0" - }, - "replace": { - "guzzlehttp/ringphp": "self.version" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~9.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Fork of guzzle/RingPHP (abandoned) to be used with elasticsearch-php", - "support": { - "source": "https://github.com/ezimuel/ringphp/tree/1.3.0" - }, - "time": "2025-02-24T10:29:27+00:00" - }, - { - "name": "friendsofsymfony/elastica-bundle", - "version": "v6.6.0", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfSymfony/FOSElasticaBundle.git", - "reference": "b69ad24b9765f82985cd760376ec7b32093f6234" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfSymfony/FOSElasticaBundle/zipball/b69ad24b9765f82985cd760376ec7b32093f6234", - "reference": "b69ad24b9765f82985cd760376ec7b32093f6234", - "shasum": "" - }, - "require": { - "pagerfanta/pagerfanta": "^2.4 || ^3.0 || ^4.0", - "php": "^7.4 || ^8.1", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "ruflin/elastica": "^7.1", - "symfony/console": "^5.4 || ^6.4 || ^7.1", - "symfony/dependency-injection": "^5.4 || ^6.4 || ^7.1", - "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.1", - "symfony/framework-bundle": "^5.4 || ^6.4 || ^7.1", - "symfony/property-access": "^5.4 || ^6.4 || ^7.1", - "symfony/stopwatch": "^5.4 || ^6.4 || ^7.1" - }, - "require-dev": { - "doctrine/doctrine-bundle": "^2.1.1", - "doctrine/mongodb-odm": "^2.2", - "doctrine/orm": "^2.8 || ^3.2", - "doctrine/phpcr-odm": "^1.5.3 || ^2.0", - "ergebnis/composer-normalize": "^2.28", - "jackalope/jackalope-doctrine-dbal": "^1.2 || ^2.0", - "jms/serializer": "^3.8", - "jms/serializer-bundle": "^4.0 || ^5.0", - "knplabs/knp-components": "^2.4 || ^3.0 || ^4.0", - "php-cs-fixer/shim": "3.8.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-symfony": "^1.2", - "phpunit/phpunit": "^9.5", - "symfony/expression-language": "^5.4 || ^6.4 || ^7.1", - "symfony/messenger": "^5.4 || ^6.4 || ^7.1", - "symfony/serializer": "^5.4 || ^6.4 || ^7.1", - "symfony/twig-bundle": "^5.4 || ^6.4 || ^7.1", - "symfony/web-profiler-bundle": "^5.4 || ^6.4 || ^7.1", - "symfony/yaml": "^5.4 || ^6.4 || ^7.1" - }, - "suggest": { - "enqueue/elastica-bundle": "For populating Elasticsearch indexes asynchronously and using significanly less resources. Uses Enqueue.", - "symfony/messenger": "For populating Elasticsearch indexes asynchronously and using significanly less resources." - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "6.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "FOS\\ElasticaBundle\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "FriendsOfSymfony Community", - "homepage": "https://github.com/FriendsOfSymfony/FOSElasticaBundle/contributors" - }, - { - "name": "Tim Nagel", - "email": "tim@nagel.com.au" - }, - { - "name": "Richard Miller", - "email": "richard.miller@limethinking.co.uk" - }, - { - "name": "Jeremy Mikola", - "email": "jmikola@gmail.com" - } - ], - "description": "Elasticsearch PHP integration for your Symfony project using Elastica", - "homepage": "https://github.com/FriendsOfSymfony/FOSElasticaBundle", - "keywords": [ - "doctrine2", - "elastica", - "elasticsearch", - "mongodb", - "search" - ], - "support": { - "issues": "https://github.com/FriendsOfSymfony/FOSElasticaBundle/issues", - "source": "https://github.com/FriendsOfSymfony/FOSElasticaBundle/tree/v6.6.0" - }, - "time": "2025-03-15T11:43:45+00:00" - }, { "name": "genkgo/php-asn1", "version": "v2.8.0", @@ -3186,67 +2908,6 @@ }, "time": "2024-11-26T15:37:43+00:00" }, - { - "name": "nyholm/dsn", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/Nyholm/dsn.git", - "reference": "9445621b426bac8c0ca161db8cd700da00a4e618" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Nyholm/dsn/zipball/9445621b426bac8c0ca161db8cd700da00a4e618", - "reference": "9445621b426bac8c0ca161db8cd700da00a4e618", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "^5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Nyholm\\Dsn\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - } - ], - "description": "Parse your DSN strings in a powerful and flexible way", - "homepage": "http://tnyholm.se", - "keywords": [ - "database", - "dsn", - "dsn parser", - "parser" - ], - "support": { - "issues": "https://github.com/Nyholm/dsn/issues", - "source": "https://github.com/Nyholm/dsn/tree/2.0.1" - }, - "funding": [ - { - "url": "https://github.com/Nyholm", - "type": "github" - } - ], - "time": "2021-11-18T09:23:29+00:00" - }, { "name": "oscarotero/html-parser", "version": "v0.1.8", @@ -3300,107 +2961,6 @@ }, "time": "2023-11-29T20:28:41+00:00" }, - { - "name": "pagerfanta/pagerfanta", - "version": "v4.7.1", - "source": { - "type": "git", - "url": "https://github.com/BabDev/Pagerfanta.git", - "reference": "b09216fc53665c4d8a39b7f60e421165cb4693e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/BabDev/Pagerfanta/zipball/b09216fc53665c4d8a39b7f60e421165cb4693e4", - "reference": "b09216fc53665c4d8a39b7f60e421165cb4693e4", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^8.1", - "symfony/deprecation-contracts": "^2.1 || ^3.0" - }, - "conflict": { - "doctrine/collections": "<1.8", - "doctrine/dbal": "<3.5", - "doctrine/mongodb-odm": "<2.4", - "doctrine/orm": "<2.14", - "doctrine/phpcr-odm": "<1.7", - "ruflin/elastica": "<7.3", - "solarium/solarium": "<6.2", - "twig/twig": "<2.13" - }, - "replace": { - "pagerfanta/core": "self.version", - "pagerfanta/doctrine-collections-adapter": "self.version", - "pagerfanta/doctrine-dbal-adapter": "self.version", - "pagerfanta/doctrine-mongodb-odm-adapter": "self.version", - "pagerfanta/doctrine-orm-adapter": "self.version", - "pagerfanta/doctrine-phpcr-odm-adapter": "self.version", - "pagerfanta/elastica-adapter": "self.version", - "pagerfanta/solarium-adapter": "self.version", - "pagerfanta/twig": "self.version" - }, - "require-dev": { - "dg/bypass-finals": "^1.5.1", - "doctrine/collections": "^1.8 || ^2.0", - "doctrine/dbal": "^3.5 || ^4.0", - "doctrine/mongodb-odm": "^2.4", - "doctrine/orm": "^2.14 || ^3.0", - "doctrine/phpcr-odm": "^1.7 || ^2.0", - "jackalope/jackalope-doctrine-dbal": "^1.9 || ^2.0", - "phpstan/extension-installer": "^1.4", - "phpstan/phpstan": "2.0.3", - "phpstan/phpstan-phpunit": "2.0.1", - "phpunit/phpunit": "10.5.39", - "rector/rector": "2.0.3", - "ruflin/elastica": "^7.3 || ^8.0", - "solarium/solarium": "^6.2", - "symfony/cache": "^5.4 || ^6.3 || ^7.0", - "twig/twig": "^2.13 || ^3.0" - }, - "suggest": { - "twig/twig": "To integrate Pagerfanta with Twig" - }, - "type": "library", - "autoload": { - "psr-4": { - "Pagerfanta\\": "lib/Core/", - "Pagerfanta\\Twig\\": "lib/Twig/", - "Pagerfanta\\Elastica\\": "lib/Adapter/Elastica/", - "Pagerfanta\\Solarium\\": "lib/Adapter/Solarium/", - "Pagerfanta\\Doctrine\\ORM\\": "lib/Adapter/Doctrine/ORM/", - "Pagerfanta\\Doctrine\\DBAL\\": "lib/Adapter/Doctrine/DBAL/", - "Pagerfanta\\Doctrine\\PHPCRODM\\": "lib/Adapter/Doctrine/PHPCRODM/", - "Pagerfanta\\Doctrine\\MongoDBODM\\": "lib/Adapter/Doctrine/MongoDBODM/", - "Pagerfanta\\Doctrine\\Collections\\": "lib/Adapter/Doctrine/Collections/" - }, - "exclude-from-classmap": [ - "lib/**/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Pagination for PHP", - "keywords": [ - "page", - "pagination", - "paginator", - "paging" - ], - "support": { - "issues": "https://github.com/BabDev/Pagerfanta/issues", - "source": "https://github.com/BabDev/Pagerfanta/tree/v4.7.1" - }, - "funding": [ - { - "url": "https://github.com/mbabker", - "type": "github" - } - ], - "time": "2024-12-13T15:12:11+00:00" - }, { "name": "paragonie/ecc", "version": "v2.4.0", @@ -4561,148 +4121,6 @@ }, "time": "2024-09-11T13:17:53+00:00" }, - { - "name": "react/promise", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-05-24T10:39:05+00:00" - }, - { - "name": "ruflin/elastica", - "version": "7.3.2", - "source": { - "type": "git", - "url": "https://github.com/ruflin/Elastica.git", - "reference": "84ba137678707a1aa4242d12bad891dc38fa2608" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ruflin/Elastica/zipball/84ba137678707a1aa4242d12bad891dc38fa2608", - "reference": "84ba137678707a1aa4242d12bad891dc38fa2608", - "shasum": "" - }, - "require": { - "elasticsearch/elasticsearch": "^7.10", - "ext-json": "*", - "nyholm/dsn": "^2.0.0", - "php": "^7.2 || ^8.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0", - "symfony/polyfill-php73": "^1.19" - }, - "require-dev": { - "aws/aws-sdk-php": "^3.155", - "guzzlehttp/guzzle": "^6.3 || ^7.2", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5.8 || ^9.4", - "symfony/phpunit-bridge": "^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow using IAM authentication with Amazon ElasticSearch Service", - "guzzlehttp/guzzle": "Allow using guzzle as transport", - "monolog/monolog": "Logging request" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Elastica\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Ruflin", - "homepage": "http://ruflin.com/" - } - ], - "description": "Elasticsearch Client", - "homepage": "http://elastica.io/", - "keywords": [ - "client", - "search" - ], - "support": { - "issues": "https://github.com/ruflin/Elastica/issues", - "source": "https://github.com/ruflin/Elastica/tree/7.3.2" - }, - "time": "2024-03-11T14:11:50+00:00" - }, { "name": "runtime/frankenphp-symfony", "version": "0.2.0", diff --git a/config/bundles.php b/config/bundles.php index c7d17d5..4fcbc82 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -14,6 +14,5 @@ return [ Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['local' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], - FOS\ElasticaBundle\FOSElasticaBundle::class => ['all' => true], Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true], ]; diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 682129c..6c84317 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -5,7 +5,7 @@ framework: # Note that the session will be started ONLY if you read or write from it. session: - handler_id: Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler + handler_id: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler cookie_secure: auto cookie_samesite: lax cookie_lifetime: 0 # integer, lifetime in seconds, 0 means 'valid for the length of the browser session' diff --git a/config/services.yaml b/config/services.yaml index d872f73..8d01c84 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -28,19 +28,10 @@ services: arguments: - '%env(DATABASE_URL)%' - # Redis + # Redis (still used for cache, just not sessions) Symfony\Component\Cache\Adapter\RedisAdapter: arguments: - '@Redis' - - - Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler: - arguments: - - '@Redis' - # you can optionally pass an array of options. The only options are 'prefix' and 'ttl', - # which define the prefix to use for the keys to avoid collision on the Redis server - # and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null: - # - { 'prefix': 'my_prefix', 'ttl': 600 } Redis: # you can also use \RedisArray, \RedisCluster, \Relay\Relay or \Predis\Client classes diff --git a/migrations/Version20250516120936.php b/migrations/Version20250516120936.php deleted file mode 100644 index 8d0ec52..0000000 --- a/migrations/Version20250516120936.php +++ /dev/null @@ -1,77 +0,0 @@ -addSql(<<<'SQL' - CREATE TABLE app_user (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, roles JSON DEFAULT NULL, PRIMARY KEY(id)) - SQL); - $this->addSql(<<<'SQL' - CREATE UNIQUE INDEX UNIQ_88BDF3E95FB8BABB ON app_user (npub) - SQL); - $this->addSql(<<<'SQL' - CREATE TABLE article (id VARCHAR(225) NOT NULL, raw JSON DEFAULT NULL, event_id VARCHAR(225) DEFAULT NULL, slug TEXT DEFAULT NULL, content TEXT DEFAULT NULL, kind INT DEFAULT NULL, title TEXT DEFAULT NULL, summary TEXT DEFAULT NULL, pubkey VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, sig VARCHAR(255) NOT NULL, image TEXT DEFAULT NULL, published_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, topics JSON DEFAULT NULL, event_status INT DEFAULT NULL, index_status INT DEFAULT NULL, current_places JSON DEFAULT NULL, rating_negative INT DEFAULT NULL, rating_positive INT DEFAULT NULL, PRIMARY KEY(id)) - SQL); - $this->addSql(<<<'SQL' - CREATE TABLE credit_transaction (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(64) NOT NULL, amount INT NOT NULL, type VARCHAR(16) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, reason VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) - SQL); - $this->addSql(<<<'SQL' - CREATE TABLE event (id VARCHAR(225) NOT NULL, event_id VARCHAR(225) DEFAULT NULL, kind INT NOT NULL, pubkey VARCHAR(255) NOT NULL, content TEXT NOT NULL, created_at BIGINT NOT NULL, tags JSON NOT NULL, sig VARCHAR(255) NOT NULL, PRIMARY KEY(id)) - SQL); - $this->addSql(<<<'SQL' - CREATE TABLE nzine (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, main_categories JSON NOT NULL, lists JSON DEFAULT NULL, editor VARCHAR(255) DEFAULT NULL, slug TEXT DEFAULT NULL, state VARCHAR(255) NOT NULL, nzine_bot_id INT DEFAULT NULL, PRIMARY KEY(id)) - SQL); - $this->addSql(<<<'SQL' - CREATE UNIQUE INDEX UNIQ_65025D9871FD5427 ON nzine (nzine_bot_id) - SQL); - $this->addSql(<<<'SQL' - CREATE TABLE nzine_bot (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, encrypted_nsec VARCHAR(255) NOT NULL, PRIMARY KEY(id)) - SQL); - $this->addSql(<<<'SQL' - ALTER TABLE nzine ADD CONSTRAINT FK_65025D9871FD5427 FOREIGN KEY (nzine_bot_id) REFERENCES nzine_bot (id) NOT DEFERRABLE INITIALLY IMMEDIATE - SQL); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql(<<<'SQL' - ALTER TABLE nzine DROP CONSTRAINT FK_65025D9871FD5427 - SQL); - $this->addSql(<<<'SQL' - DROP TABLE app_user - SQL); - $this->addSql(<<<'SQL' - DROP TABLE article - SQL); - $this->addSql(<<<'SQL' - DROP TABLE credit_transaction - SQL); - $this->addSql(<<<'SQL' - DROP TABLE event - SQL); - $this->addSql(<<<'SQL' - DROP TABLE nzine - SQL); - $this->addSql(<<<'SQL' - DROP TABLE nzine_bot - SQL); - } -} diff --git a/migrations/Version20250516123543.php b/migrations/Version20250516123543.php deleted file mode 100644 index 818b4ea..0000000 --- a/migrations/Version20250516123543.php +++ /dev/null @@ -1,37 +0,0 @@ -addSql(<<<'SQL' - ALTER TABLE article ALTER COLUMN id TYPE integer USING id::integer; - SQL); - - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql(<<<'SQL' - ALTER TABLE article ALTER id TYPE VARCHAR(225) - SQL); - - } -} diff --git a/migrations/Version20250516123632.php b/migrations/Version20250516123632.php deleted file mode 100644 index d37e329..0000000 --- a/migrations/Version20250516123632.php +++ /dev/null @@ -1,31 +0,0 @@ -