Browse Source

Downsizing: remove Mercure

imwald
Nuša Pukšič 9 months ago
parent
commit
8a3b022132
  1. 14
      .env.dist
  2. 3
      compose.override.yaml
  3. 11
      compose.yaml
  4. 1
      composer.json
  5. 381
      composer.lock
  6. 1
      config/bundles.php
  7. 8
      config/packages/mercure.yaml
  8. 12
      symfony.lock
  9. 2
      templates/base.html.twig
  10. 33
      templates/pages/author.html.twig

14
.env.dist

@ -34,20 +34,6 @@ MYSQL_CHARSET=utf8mb4 @@ -34,20 +34,6 @@ MYSQL_CHARSET=utf8mb4
DATABASE_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@database:3306/${MYSQL_DATABASE}?serverVersion=${MYSQL_VERSION}&charset=${MYSQL_CHARSET}"
###< doctrine/doctrine-bundle ###
###> symfony/mercure-bundle ###
# See https://symfony.com/doc/current/mercure.html#configuration
# The URL of the Mercure hub, used by the app to publish updates (can be a local URL)
MERCURE_URL=https://unfold-php/.well-known/mercure
# The public URL of the Mercure hub, used by the browser to connect
MERCURE_PUBLIC_URL="https://${SERVER_NAME}/.well-known/mercure"
# The secret used to sign the JWTs
MERCURE_JWT_SECRET="!NotSoSecretMercureHubJWTSecretKey!"
###< symfony/mercure-bundle ###
###> LNBits ###
LNBITS_URL=https://legend.lnbits.com
LNBITS_API_KEY=<your-lnbits-admin-key>
###< LNBits ###
###> magazine settings ###
MAGAZINE_NPUB=<mag-npub>
MAGAZINE_D_TAG=<mag-d-tag>

3
compose.override.yaml

@ -21,9 +21,6 @@ services: @@ -21,9 +21,6 @@ services:
- host.docker.internal:host-gateway
tty: true
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
###> doctrine/doctrine-bundle ###
database:
restart: always

11
compose.yaml

@ -7,14 +7,8 @@ services: @@ -7,14 +7,8 @@ services:
environment:
APP_ENV: ${APP_ENV:-dev}
SERVER_NAME: ${SERVER_NAME:-localhost}, php:80
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: 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}
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
volumes:
- caddy_data:/data
- caddy_config:/config
@ -32,9 +26,6 @@ services: @@ -32,9 +26,6 @@ services:
published: ${HTTP3_PORT:-443}
protocol: udp
# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
###> doctrine/doctrine-bundle ###
database:
@ -66,8 +57,6 @@ services: @@ -66,8 +57,6 @@ services:
volumes:
caddy_data:
caddy_config:
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
###> doctrine/doctrine-bundle ###
database_data:

1
composer.json

@ -35,7 +35,6 @@ @@ -35,7 +35,6 @@
"symfony/html-sanitizer": "7.1.*",
"symfony/http-foundation": "7.1.*",
"symfony/intl": "7.1.*",
"symfony/mercure-bundle": "^0.3.9",
"symfony/property-access": "7.1.*",
"symfony/property-info": "7.1.*",
"symfony/runtime": "7.1.*",

381
composer.lock generated

@ -4,7 +4,7 @@ @@ -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": "0cd33192da4ef60028e3b2dab8d92170",
"content-hash": "210ea2a31ffe95d3b02f9a5b177fdda3",
"packages": [
{
"name": "bacon/bacon-qr-code",
@ -1967,79 +1967,6 @@ @@ -1967,79 +1967,6 @@
],
"time": "2025-05-05T16:03:34+00:00"
},
{
"name": "lcobucci/jwt",
"version": "5.5.0",
"source": {
"type": "git",
"url": "https://github.com/lcobucci/jwt.git",
"reference": "a835af59b030d3f2967725697cf88300f579088e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/a835af59b030d3f2967725697cf88300f579088e",
"reference": "a835af59b030d3f2967725697cf88300f579088e",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"ext-sodium": "*",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"psr/clock": "^1.0"
},
"require-dev": {
"infection/infection": "^0.29",
"lcobucci/clock": "^3.2",
"lcobucci/coding-standard": "^11.0",
"phpbench/phpbench": "^1.2",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10.7",
"phpstan/phpstan-deprecation-rules": "^1.1.3",
"phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-strict-rules": "^1.5.0",
"phpunit/phpunit": "^11.1"
},
"suggest": {
"lcobucci/clock": ">= 3.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Lcobucci\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Luís Cobucci",
"email": "lcobucci@gmail.com",
"role": "Developer"
}
],
"description": "A simple library to work with JSON Web Token and JSON Web Signature",
"keywords": [
"JWS",
"jwt"
],
"support": {
"issues": "https://github.com/lcobucci/jwt/issues",
"source": "https://github.com/lcobucci/jwt/tree/5.5.0"
},
"funding": [
{
"url": "https://github.com/lcobucci",
"type": "github"
},
{
"url": "https://www.patreon.com/lcobucci",
"type": "patreon"
}
],
"time": "2025-01-26T21:29:45+00:00"
},
{
"name": "league/commonmark",
"version": "2.7.1",
@ -4017,62 +3944,6 @@ @@ -4017,62 +3944,6 @@
},
"time": "2023-04-04T09:54:51+00:00"
},
{
"name": "psr/link",
"version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/link.git",
"reference": "84b159194ecfd7eaa472280213976e96415433f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/link/zipball/84b159194ecfd7eaa472280213976e96415433f7",
"reference": "84b159194ecfd7eaa472280213976e96415433f7",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"suggest": {
"fig/link-util": "Provides some useful PSR-13 utilities"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Link\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for HTTP links",
"homepage": "https://github.com/php-fig/link",
"keywords": [
"http",
"http-link",
"link",
"psr",
"psr-13",
"rest"
],
"support": {
"source": "https://github.com/php-fig/link/tree/2.0.1"
},
"time": "2021-03-11T23:00:27+00:00"
},
{
"name": "psr/log",
"version": "3.0.2",
@ -6471,173 +6342,6 @@ @@ -6471,173 +6342,6 @@
],
"time": "2024-11-08T15:46:42+00:00"
},
{
"name": "symfony/mercure",
"version": "v0.6.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/mercure.git",
"reference": "304cf84609ef645d63adc65fc6250292909a461b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mercure/zipball/304cf84609ef645d63adc65fc6250292909a461b",
"reference": "304cf84609ef645d63adc65fc6250292909a461b",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"symfony/deprecation-contracts": "^2.0|^3.0|^4.0",
"symfony/http-client": "^4.4|^5.0|^6.0|^7.0",
"symfony/http-foundation": "^4.4|^5.0|^6.0|^7.0",
"symfony/polyfill-php80": "^1.22",
"symfony/web-link": "^4.4|^5.0|^6.0|^7.0"
},
"require-dev": {
"lcobucci/jwt": "^3.4|^4.0|^5.0",
"symfony/event-dispatcher": "^4.4|^5.0|^6.0|^7.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.2|^6.0|^7.0",
"symfony/stopwatch": "^4.4|^5.0|^6.0|^7.0",
"twig/twig": "^2.0|^3.0|^4.0"
},
"suggest": {
"symfony/stopwatch": "Integration with the profiler performances"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/dunglas/mercure",
"name": "dunglas/mercure"
},
"branch-alias": {
"dev-main": "0.6.x-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Mercure\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kévin Dunglas",
"email": "dunglas@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Mercure Component",
"homepage": "https://symfony.com",
"keywords": [
"mercure",
"push",
"sse",
"updates"
],
"support": {
"issues": "https://github.com/symfony/mercure/issues",
"source": "https://github.com/symfony/mercure/tree/v0.6.5"
},
"funding": [
{
"url": "https://github.com/dunglas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/mercure",
"type": "tidelift"
}
],
"time": "2024-04-08T12:51:34+00:00"
},
{
"name": "symfony/mercure-bundle",
"version": "v0.3.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/mercure-bundle.git",
"reference": "77435d740b228e9f5f3f065b6db564f85f2cdb64"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mercure-bundle/zipball/77435d740b228e9f5f3f065b6db564f85f2cdb64",
"reference": "77435d740b228e9f5f3f065b6db564f85f2cdb64",
"shasum": ""
},
"require": {
"lcobucci/jwt": "^3.4|^4.0|^5.0",
"php": ">=7.1.3",
"symfony/config": "^4.4|^5.0|^6.0|^7.0",
"symfony/dependency-injection": "^4.4|^5.4|^6.0|^7.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0|^7.0",
"symfony/mercure": "^0.6.1",
"symfony/web-link": "^4.4|^5.0|^6.0|^7.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.3.7|^5.0|^6.0|^7.0",
"symfony/stopwatch": "^4.3.7|^5.0|^6.0|^7.0",
"symfony/ux-turbo": "*",
"symfony/var-dumper": "^4.3.7|^5.0|^6.0|^7.0"
},
"suggest": {
"symfony/messenger": "To use the Messenger integration"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-main": "0.3.x-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Bundle\\MercureBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kévin Dunglas",
"email": "dunglas@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony MercureBundle",
"homepage": "https://symfony.com",
"keywords": [
"mercure",
"push",
"sse",
"updates"
],
"support": {
"issues": "https://github.com/symfony/mercure-bundle/issues",
"source": "https://github.com/symfony/mercure-bundle/tree/v0.3.9"
},
"funding": [
{
"url": "https://github.com/dunglas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/mercure-bundle",
"type": "tidelift"
}
],
"time": "2024-05-31T09:07:18+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v7.1.9",
@ -9197,89 +8901,6 @@ @@ -9197,89 +8901,6 @@
],
"time": "2024-09-25T14:20:29+00:00"
},
{
"name": "symfony/web-link",
"version": "v7.1.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/web-link.git",
"reference": "383aa7566f25e3a1ab323732c2cc6a1748120d3a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/web-link/zipball/383aa7566f25e3a1ab323732c2cc6a1748120d3a",
"reference": "383aa7566f25e3a1ab323732c2cc6a1748120d3a",
"shasum": ""
},
"require": {
"php": ">=8.2",
"psr/link": "^1.1|^2.0"
},
"conflict": {
"symfony/http-kernel": "<6.4"
},
"provide": {
"psr/link-implementation": "1.0|2.0"
},
"require-dev": {
"symfony/http-kernel": "^6.4|^7.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\WebLink\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kévin Dunglas",
"email": "dunglas@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Manages links between resources",
"homepage": "https://symfony.com",
"keywords": [
"dns-prefetch",
"http",
"http2",
"link",
"performance",
"prefetch",
"preload",
"prerender",
"psr13",
"push"
],
"support": {
"source": "https://github.com/symfony/web-link/tree/v7.1.6"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-25T14:20:29+00:00"
},
{
"name": "symfony/workflow",
"version": "v7.1.6",

1
config/bundles.php

@ -4,7 +4,6 @@ return [ @@ -4,7 +4,6 @@ return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],

8
config/packages/mercure.yaml

@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
mercure:
hubs:
default:
url: '%env(MERCURE_URL)%'
public_url: '%env(MERCURE_PUBLIC_URL)%'
jwt:
secret: '%env(MERCURE_JWT_SECRET)%'
publish: '*'

12
symfony.lock

@ -119,18 +119,6 @@ @@ -119,18 +119,6 @@
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
}
},
"symfony/mercure-bundle": {
"version": "0.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "0.3",
"ref": "528285147494380298f8f991ee8c47abebaf79db"
},
"files": [
"./config/packages/mercure.yaml"
]
},
"symfony/phpunit-bridge": {
"version": "7.2",
"recipe": {

2
templates/base.html.twig

@ -11,8 +11,6 @@ @@ -11,8 +11,6 @@
<link rel="apple-touch-icon" href="{{ asset('icons/apple-touch-icon.png') }}">
<meta name="apple-mobile-web-app-title" content="Newsroom" />
<meta name="lightning" content="coffeecalm152228@getalby.com" />
<link rel="manifest" href="{{ path('pwa_manifest') }}">
{% block ogtags %}

33
templates/pages/author.html.twig

@ -21,39 +21,6 @@ @@ -21,39 +21,6 @@
{# {% endfor %}#}
{# {% endif %}#}
{# {% if app.user and app.user.userIdentifier is same as npub %}#}
{# <div id="invoice-component" class="p-4 bg-gray-100 rounded-lg">#}
{# <h3 class="text-xl font-semibold mb-4">Purchase Search Credits</h3>#}
{# <div class="mb-4">#}
{# <p>Amount: {{ amount ?? 0 }} sats</p>#}
{# <p>Status: <span id="payment-status">Pending</span></p>#}
{# </div>#}
{# #}{# You can access the width and height via the matrix #}
{# #}{# Replace the string with the invoice #}
{# {% set qrCode = qr_code_result('My QR Code') %}#}
{# <img src="{{ qrCode.dataUri }}" width="{{ qrCode.matrix.outerSize }}" alt="invoice-qr" />#}
{# <br>#}
{# <button id="check-payment" class="px-4 py-2 bg-blue-500 text-white rounded">Check Payment Status</button>#}
{# <script>#}
{# document.getElementById('check-payment').addEventListener('click', async () => {#}
{# const response = await fetch('/payment-status/{{ payment_hash ?? '' }}');#}
{# const data = await response.json();#}
{# if (data.status === 'paid') {#}
{# document.getElementById('payment-status').innerText = 'Paid';#}
{# } else {#}
{# document.getElementById('payment-status').innerText = 'Pending';#}
{# }#}
{# });#}
{# </script>#}
{# </div>#}
{# {% endif %}#}
<twig:Organisms:CardList :list="articles" class="article-list"></twig:Organisms:CardList>
{% endblock %}

Loading…
Cancel
Save