Env prepare, redis session

This commit is contained in:
Ernest Wiśniewski 2023-06-02 18:28:23 +02:00
parent 88b14acc06
commit a2f479acd9
6 changed files with 33 additions and 32 deletions

View file

@ -13,6 +13,7 @@
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
# kbin variables
KBIN_DOMAIN=app.localhost
KBIN_TITLE=/kbin
KBIN_DEFAULT_LANG=en
@ -29,26 +30,24 @@ KBIN_META_KEYWORDS="kbin, content agregator, open source, fediverse"
KBIN_HEADER_LOGO=false
KBIN_CAPTCHA_ENABLED=false
CARDANO_CLI=
CARDANO_WALLET_URL=https://cardano-testnet.karab.in/api/v0/
CARDANO_EXPLORER_URL=https://graphql-api.testnet.dandelion.link/
OAUTH_FACEBOOK_ID=
OAUTH_FACEBOOK_SECRET=
OAUTH_GOOGLE_ID=
OAUTH_GOOGLE_SECRET=
OAUTH_GITHUB_ID=
OAUTH_GITHUB_SECRET=
# Redis
REDIS_DNS=redis://${REDIS_PASSWORD}@redis
REDIS_PASSWORD=!ChangeThisRedisPass!
# S3 storage (optional)
S3_KEY=
S3_SECRET=
S3_BUCKET=media.karab.in
S3_REGION=eu-central-1
S3_VERSION=latest
# @todo fix typo
REDIS_DNS=redis://${REDIS_PASSWORD}@redis
REDIS_PASSWORD=!ChangeThisRedisPass!
# oAuth (optional)
OAUTH_FACEBOOK_ID=
OAUTH_FACEBOOK_SECRET=
OAUTH_GOOGLE_ID=
OAUTH_GOOGLE_SECRET=
OAUTH_GITHUB_ID=
OAUTH_GITHUB_SECRET=
###> symfony/framework-bundle ###
APP_ENV=dev
@ -64,10 +63,9 @@ DATABASE_URL="postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&
###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=doctrine://default
RABBITMQ_PASSWORD=!ChangeThisRabbitPass!
MESSENGER_TRANSPORT_DSN=amqp://kbin:${RABBITMQ_PASSWORD}@rabbitmq:5672/%2f/messages
#MESSENGER_TRANSPORT_DSN=amqp://kbin:${RABBITMQ_PASSWORD}@host.docker.internal:5672/%2f/messages // for mac
#MESSENGER_TRANSPORT_DSN=doctrine://default
#MESSENGER_TRANSPORT_DSN=redis://${REDIS_PASSWORD}@redis:6379/messages
###< symfony/messenger ###

2
.gitignore vendored
View file

@ -39,7 +39,7 @@ yarn-error.log
###< liip/imagine-bundle ###
.env
/public/media/
/public/media/*
###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem

View file

@ -232,4 +232,4 @@ aside.comments {
#comment-add {
margin: .5rem 0;
}
}

View file

@ -1,16 +1,16 @@
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
secret: '%env(APP_SECRET)%'
#csrf_protection: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: '%env(REDIS_DNS)%'
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native
#esi: true
#fragments: true
php_errors:
log: true
#esi: true
#fragments: true
php_errors:
log: true

View file

@ -10,7 +10,7 @@ framework:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
retry_strategy:
max_retries: 0
delay: 60000
delay: 1800000
multiplier: 2
max_delay: 0
serializer: messenger.transport.symfony_serializer
@ -18,7 +18,7 @@ framework:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
retry_strategy:
max_retries: 0
delay: 65000
delay: 1800000
multiplier: 2
max_delay: 0
serializer: messenger.transport.symfony_serializer

View file

@ -68,6 +68,8 @@ services:
image: redis:7.0.11-alpine
restart: always
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD:-!ChangeThisRedisPass!} --maxmemory-policy volatile-ttl
volumes:
- redis-data:/data
rabbitmq:
image: rabbitmq:3-management
@ -165,3 +167,4 @@ volumes:
caddy_config:
db-data:
rabbitmq-data:
redis-data: