redis session

This commit is contained in:
Arnaud Fornerot 2022-08-22 16:24:02 +02:00
parent 7fdf41aac8
commit f97bac6e5e
5 changed files with 62 additions and 3 deletions

4
.env
View File

@ -8,6 +8,10 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
# Database
DATABASE_URL="postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8"
# Redis Session
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
# Mailer
MAILER_METHOD=smtp
MAILER_DSN=smtp://127.0.0.1:1025

View File

@ -7,7 +7,7 @@ framework:
# 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
handler_id: Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler
name: '%env(APP_ALIAS)%'
gc_probability: null
cookie_secure: auto

View File

@ -113,6 +113,17 @@ services:
resource: '../src/Controller'
tags: ['controller.service_arguments']
Redis:
class: Redis
calls:
- connect:
- '%env(REDIS_HOST)%'
- '%env(int:REDIS_PORT)%'
Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler:
arguments:
- '@Redis'
App\EventListener\AllSubscriber:
public: true
tags:

View File

@ -1,8 +1,19 @@
version: '3'
services:
database:
redis:
image: redis:4.0
container_name: redis
ports:
- 6379:6379
environment:
- TZ=Europe/Paris
volumes:
- /etc/localtime:/etc/localtime:ro
postgres:
image: postgres:${POSTGRES_VERSION:-13}-alpine
container_name: postgres
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe}
@ -14,12 +25,14 @@ services:
mailer:
image: schickling/mailcatcher
container_name: mailer
ports:
- 1025:1025
- 1080:1080
mercure:
image: dunglas/mercure
container_name: mercure
restart: unless-stopped
ports:
- "80"
@ -35,6 +48,38 @@ services:
- mercure_data:/data
- mercure_config:/config
openldap:
image: osixia/openldap:1.5.0
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "nineskeletor"
LDAP_DOMAIN: "nine.fr"
LDAP_ADMIN_PASSWORD: "admin"
LDAP_CONFIG_PASSWORD: "config"
LDAP_READONLY_USER: "true"
LDAP_READONLY_USER_USERNAME: "readonly"
LDAP_READONLY_USER_PASSWORD: "readonly"
LDAP_TLS: "false"
volumes:
- /var/lib/ldap
- /etc/ldap/slapd.d
- /container/service/slapd/assets/certs/
ports:
- "389:389"
- "636:636"
phpldapadmin:
image: osixia/phpldapadmin:latest
container_name: phpldapadmin
environment:
PHPLDAPADMIN_LDAP_HOSTS: "openldap"
PHPLDAPADMIN_HTTPS: "false"
ports:
- "8080:80"
depends_on:
- openldap
volumes:
db-data:
mercure_data:

View File

@ -237,7 +237,6 @@ class SecurityController extends AbstractController
"client_secret" => $this->getParameter("oauthClientsecret"),
];
$response=$this->apiservice->run("POST",$apiurl,$query);
dump($response);
return $this->render('Home/home.html.twig',[
"useheader"=>true,
"usemenu"=>true,