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. 27
      frankenphp/Caddyfile
  8. 4
      symfony.lock

29
.env.dist

@ -33,15 +33,12 @@ POSTGRES_CHARSET=utf8
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=${POSTGRES_CHARSET}" DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=${POSTGRES_CHARSET}"
###< doctrine/doctrine-bundle ### ###< doctrine/doctrine-bundle ###
###> symfony/mercure-bundle ### ###> mercure ###
# See https://symfony.com/doc/current/mercure.html#configuration MERCURE_JWT_SECRET="!NotSecretAtAll!"
# The URL of the Mercure hub, used by the app to publish updates (can be a local URL) MERCURE_PUBLISHER_JWT_KEY="!NotSoSecretMercureHubJWTSecretKey!"
MERCURE_URL=https://newsroom-php/.well-known/mercure MERCURE_SUBSCRIBER_JWT_KEY="!NotSoSecretMercureHubJWTSecretKey!"
# The public URL of the Mercure hub, used by the browser to connect ###< mercure ###
MERCURE_PUBLIC_URL="https://${SERVER_NAME}/.well-known/mercure"
# The secret used to sign the JWTs
MERCURE_JWT_SECRET="!NotSoSecretMercureHubJWTSecretKey!"
###< symfony/mercure-bundle ###
###> elastic ### ###> elastic ###
# Set to 'true' to enable Elasticsearch, 'false' to use database queries # Set to 'true' to enable Elasticsearch, 'false' to use database queries
ELASTICSEARCH_ENABLED=false ELASTICSEARCH_ENABLED=false
@ -50,17 +47,14 @@ ELASTICSEARCH_PORT=9200
ELASTICSEARCH_USERNAME=elastic ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=your_password ELASTICSEARCH_PASSWORD=your_password
ELASTICSEARCH_INDEX_NAME=articles ELASTICSEARCH_INDEX_NAME=articles
ELASTICSEARCH_USER_INDEX_NAME=users
###< elastic ### ###< elastic ###
###> redis ### ###> redis ###
REDIS_HOST=localhost REDIS_HOST=localhost
REDIS_PASSWORD=r_password REDIS_PASSWORD=r_password
###< redis ### ###< redis ###
###> LNBits ###
LNBITS_URL=https://legend.lnbits.com
LNBITS_API_KEY=<your-lnbits-admin-key>
###< LNBits ###
###> symfony/messenger ### ###> symfony/messenger ###
MESSENGER_TRANSPORT_DSN="redis://:${REDIS_PASSWORD}@${REDIS_HOST}/devel" MESSENGER_TRANSPORT_DSN="redis://:${REDIS_PASSWORD}@${REDIS_HOST}/1"
###< symfony/messenger ### ###< symfony/messenger ###
###> nostr relay ### ###> nostr relay ###
@ -69,9 +63,4 @@ RELAY_DOMAIN=relay.localhost
# Internal relay URL used by the Symfony app (ws:// for internal, wss:// for external) # Internal relay URL used by the Symfony app (ws:// for internal, wss:// for external)
NOSTR_DEFAULT_RELAY=ws://strfry:7777 NOSTR_DEFAULT_RELAY=ws://strfry:7777
# Upstream relays to sync from (space-separated list, must be quoted) # 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" RELAY_UPSTREAMS="wss://relay.somewhere.com"
# Time windows for periodic sync (in days)
RELAY_DAYS_ARTICLES=7
RELAY_DAYS_THREADS=3
###< nostr relay ###

6
Dockerfile

@ -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 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 --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"] ENTRYPOINT ["docker-entrypoint"]
HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1 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 # Dev FrankenPHP image
FROM frankenphp_base AS frankenphp_dev FROM frankenphp_base AS frankenphp_dev
@ -74,7 +74,7 @@ RUN set -eux; \
COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/ 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 # Prod FrankenPHP image
FROM frankenphp_base AS frankenphp_prod FROM frankenphp_base AS frankenphp_prod

2
compose.override.yaml

@ -7,7 +7,7 @@ services:
target: frankenphp_dev target: frankenphp_dev
volumes: volumes:
- ./:/app - ./:/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 - ./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 # 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: # from the bind-mount for better performance by enabling the next line:

39
compose.yaml

@ -9,13 +9,11 @@ services:
SERVER_NAME: ${SERVER_NAME:-localhost}, php:80 SERVER_NAME: ${SERVER_NAME:-localhost}, php:80
MERCURE_PUBLISHER_JWT_ALG: ${MERCURE_PUBLISHER_JWT_ALG:-HS256} MERCURE_PUBLISHER_JWT_ALG: ${MERCURE_PUBLISHER_JWT_ALG:-HS256}
MERCURE_SUBSCRIBER_JWT_ALG: ${MERCURE_SUBSCRIBER_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 # 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} 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 # Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
MERCURE_URL: ${MERCURE_URL:-http://php/.well-known/mercure} MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_PUBLIC_URL: ${MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure} MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
# Nostr relay configuration # Nostr relay configuration
NOSTR_DEFAULT_RELAY: ${NOSTR_DEFAULT_RELAY:-} NOSTR_DEFAULT_RELAY: ${NOSTR_DEFAULT_RELAY:-}
volumes: volumes:
@ -36,8 +34,6 @@ services:
protocol: udp protocol: udp
# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service # Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
###> doctrine/doctrine-bundle ### ###> doctrine/doctrine-bundle ###
database: database:
@ -129,11 +125,33 @@ services:
- "7777:7777" # Expose for local testing (ws://localhost:7777) - "7777:7777" # Expose for local testing (ws://localhost:7777)
###< strfry relay ### ###< 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: volumes:
caddy_data: caddy_data:
caddy_config: caddy_config:
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
###> doctrine/doctrine-bundle ### ###> doctrine/doctrine-bundle ###
database_data: database_data:
@ -143,3 +161,8 @@ volumes:
strfry_data: strfry_data:
###< strfry relay ### ###< strfry relay ###
###> symfony/mercure-bundle ###
mercure_data:
mercure_config:
###< symfony/mercure-bundle ###

3
composer.json

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

633
composer.lock generated

File diff suppressed because it is too large Load Diff

27
frankenphp/Caddyfile

@ -29,18 +29,21 @@ frankenphp {
root /app/public root /app/public
encode zstd br gzip encode zstd br gzip
mercure { mercure {
# Transport to use (default to Bolt) transport bolt {
transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db} 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 key
anonymous publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# Enable the subscription API (double-check that it's what you want) # Subscriber JWT key
subscriptions subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
# Extra directives
{$MERCURE_EXTRA_DIRECTIVES} anonymous
} subscriptions
{$MERCURE_EXTRA_DIRECTIVES}
}
vulcain vulcain

4
symfony.lock

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

Loading…
Cancel
Save