Browse Source

Update deps, fix breaking changes

imwald
Nuša Pukšič 3 days ago
parent
commit
9103a4d7e0
  1. 29
      .env.dist
  2. 6
      Dockerfile
  3. 2
      compose.override.yaml
  4. 39
      compose.yaml
  5. 3
      composer.json
  6. 633
      composer.lock
  7. 15
      frankenphp/Caddyfile
  8. 4
      symfony.lock

29
.env.dist

@ -33,15 +33,12 @@ POSTGRES_CHARSET=utf8 @@ -33,15 +33,12 @@ POSTGRES_CHARSET=utf8
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=${POSTGRES_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://newsroom-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 ###
###> mercure ###
MERCURE_JWT_SECRET="!NotSecretAtAll!"
MERCURE_PUBLISHER_JWT_KEY="!NotSoSecretMercureHubJWTSecretKey!"
MERCURE_SUBSCRIBER_JWT_KEY="!NotSoSecretMercureHubJWTSecretKey!"
###< mercure ###
###> elastic ###
# Set to 'true' to enable Elasticsearch, 'false' to use database queries
ELASTICSEARCH_ENABLED=false
@ -50,17 +47,14 @@ ELASTICSEARCH_PORT=9200 @@ -50,17 +47,14 @@ ELASTICSEARCH_PORT=9200
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=your_password
ELASTICSEARCH_INDEX_NAME=articles
ELASTICSEARCH_USER_INDEX_NAME=users
###< elastic ###
###> redis ###
REDIS_HOST=localhost
REDIS_PASSWORD=r_password
###< redis ###
###> LNBits ###
LNBITS_URL=https://legend.lnbits.com
LNBITS_API_KEY=<your-lnbits-admin-key>
###< LNBits ###
###> symfony/messenger ###
MESSENGER_TRANSPORT_DSN="redis://:${REDIS_PASSWORD}@${REDIS_HOST}/devel"
MESSENGER_TRANSPORT_DSN="redis://:${REDIS_PASSWORD}@${REDIS_HOST}/1"
###< symfony/messenger ###
###> nostr relay ###
@ -69,9 +63,4 @@ RELAY_DOMAIN=relay.localhost @@ -69,9 +63,4 @@ RELAY_DOMAIN=relay.localhost
# Internal relay URL used by the Symfony app (ws:// for internal, wss:// for external)
NOSTR_DEFAULT_RELAY=ws://strfry:7777
# Upstream relays to sync from (space-separated list, must be quoted)
RELAY_UPSTREAMS="wss://relay.snort.social wss://relay.damus.io wss://relay.nostr.band"
# Time windows for periodic sync (in days)
RELAY_DAYS_ARTICLES=7
RELAY_DAYS_THREADS=3
###< nostr relay ###
RELAY_UPSTREAMS="wss://relay.somewhere.com"

6
Dockerfile

@ -53,12 +53,12 @@ RUN install-php-extensions pdo pdo_pgsql @@ -53,12 +53,12 @@ RUN install-php-extensions pdo pdo_pgsql
COPY --link frankenphp/conf.d/10-app.ini $PHP_INI_DIR/app.conf.d/
COPY --link --chmod=755 frankenphp/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
COPY --link frankenphp/Caddyfile /etc/caddy/Caddyfile
COPY --link frankenphp/Caddyfile /etc/frankenphp/Caddyfile
ENTRYPOINT ["docker-entrypoint"]
HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ]
CMD [ "frankenphp", "run", "--config", "/etc/frankenphp/Caddyfile" ]
# Dev FrankenPHP image
FROM frankenphp_base AS frankenphp_dev
@ -74,7 +74,7 @@ RUN set -eux; \ @@ -74,7 +74,7 @@ RUN set -eux; \
COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ]
CMD [ "frankenphp", "run", "--config", "/etc/frankenphp/Caddyfile", "--watch" ]
# Prod FrankenPHP image
FROM frankenphp_base AS frankenphp_prod

2
compose.override.yaml

@ -7,7 +7,7 @@ services: @@ -7,7 +7,7 @@ services:
target: frankenphp_dev
volumes:
- ./:/app
- ./frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro
- ./frankenphp/Caddyfile:/etc/frankenphp/Caddyfile:ro
- ./frankenphp/conf.d/20-app.dev.ini:/usr/local/etc/php/app.conf.d/20-app.dev.ini:ro
# If you develop on Mac or Windows you can remove the vendor/ directory
# from the bind-mount for better performance by enabling the next line:

39
compose.yaml

@ -9,13 +9,11 @@ services: @@ -9,13 +9,11 @@ services:
SERVER_NAME: ${SERVER_NAME:-localhost}, php:80
MERCURE_PUBLISHER_JWT_ALG: ${MERCURE_PUBLISHER_JWT_ALG:-HS256}
MERCURE_SUBSCRIBER_JWT_ALG: ${MERCURE_SUBSCRIBER_JWT_ALG:-HS256}
# Removed overrides for JWT keys to use values from .env
# 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:-17}&charset=${POSTGRES_CHARSET:-utf8}
# 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!}
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
# Nostr relay configuration
NOSTR_DEFAULT_RELAY: ${NOSTR_DEFAULT_RELAY:-}
volumes:
@ -36,8 +34,6 @@ services: @@ -36,8 +34,6 @@ services:
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:
@ -129,11 +125,33 @@ services: @@ -129,11 +125,33 @@ services:
- "7777:7777" # Expose for local testing (ws://localhost:7777)
###< strfry relay ###
###> symfony/mercure-bundle ###
mercure:
image: dunglas/mercure
restart: unless-stopped
environment:
# Uncomment the following line to disable HTTPS,
#SERVER_NAME: ':80'
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
# Set the URL of your Symfony project (without trailing slash!) as value of the cors_origins directive
MERCURE_EXTRA_DIRECTIVES: |
cors_origins http://127.0.0.1:8000
# Comment the following line to disable the development mode
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
healthcheck:
test: ["CMD", "curl", "-f", "https://localhost/healthz"]
timeout: 5s
retries: 5
start_period: 60s
volumes:
- mercure_data:/data
- mercure_config:/config
###< symfony/mercure-bundle ###
volumes:
caddy_data:
caddy_config:
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
###> doctrine/doctrine-bundle ###
database_data:
@ -143,3 +161,8 @@ volumes: @@ -143,3 +161,8 @@ volumes:
strfry_data:
###< strfry relay ###
###> symfony/mercure-bundle ###
mercure_data:
mercure_config:
###< symfony/mercure-bundle ###

3
composer.json

@ -12,7 +12,6 @@ @@ -12,7 +12,6 @@
"ext-openssl": "*",
"ext-redis": "*",
"ext-simplexml": "*",
"bitvora/bitvora-php": "dev-master",
"doctrine/dbal": "^4.2",
"doctrine/doctrine-bundle": "^2.13",
"doctrine/doctrine-migrations-bundle": "^3.3",
@ -41,7 +40,7 @@ @@ -41,7 +40,7 @@
"symfony/html-sanitizer": "7.3.*",
"symfony/http-foundation": "7.3.*",
"symfony/intl": "7.3.*",
"symfony/mercure-bundle": "^0.3.9",
"symfony/mercure-bundle": "^0.4.2",
"symfony/messenger": "7.3.*",
"symfony/mime": "7.3.*",
"symfony/property-access": "7.3.*",

633
composer.lock generated

File diff suppressed because it is too large Load Diff

15
frankenphp/Caddyfile

@ -30,15 +30,18 @@ frankenphp { @@ -30,15 +30,18 @@ frankenphp {
encode zstd br gzip
mercure {
# Transport to use (default to Bolt)
transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
transport bolt {
path /data/mercure.db
}
# Publisher JWT key
publisher_jwt {env.MERCURE_JWT_SECRET} {env.MERCURE_PUBLISHER_JWT_ALG}
# Allow anonymous subscribers (double-check that it's what you want)
publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# Subscriber JWT key
subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
anonymous
# Enable the subscription API (double-check that it's what you want)
subscriptions
# Extra directives
{$MERCURE_EXTRA_DIRECTIVES}
}

4
symfony.lock

@ -142,7 +142,7 @@ @@ -142,7 +142,7 @@
}
},
"symfony/mercure-bundle": {
"version": "0.3",
"version": "0.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
@ -150,7 +150,7 @@ @@ -150,7 +150,7 @@
"ref": "528285147494380298f8f991ee8c47abebaf79db"
},
"files": [
"./config/packages/mercure.yaml"
"config/packages/mercure.yaml"
]
},
"symfony/messenger": {

Loading…
Cancel
Save