mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-27 16:36:00 +00:00
Merge pull request #8028 from wallabag/introduce-a-redis_url
Introduce a REDIS_URL
This commit is contained in:
commit
598515868c
5 changed files with 30 additions and 9 deletions
|
@ -77,6 +77,7 @@ class AppKernel extends Kernel
|
|||
|
||||
$loader->load(function (ContainerBuilder $container) {
|
||||
$this->processDatabaseParameters($container);
|
||||
$this->defineRedisUrlEnvVar($container);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -112,4 +113,29 @@ class AppKernel extends Kernel
|
|||
$container->setParameter('database_port', (string) $container->getParameter('database_port'));
|
||||
$container->setParameter('database_socket', (string) $container->getParameter('database_socket'));
|
||||
}
|
||||
|
||||
private function defineRedisUrlEnvVar(ContainerBuilder $container)
|
||||
{
|
||||
$scheme = $container->getParameter('redis_scheme');
|
||||
$host = $container->getParameter('redis_host');
|
||||
$port = $container->getParameter('redis_port');
|
||||
$path = $container->getParameter('redis_path');
|
||||
$password = $container->getParameter('redis_password');
|
||||
|
||||
$url = $scheme . '://';
|
||||
|
||||
if ($password) {
|
||||
$url .= $password . '@';
|
||||
}
|
||||
|
||||
$url .= $host;
|
||||
|
||||
if ($port) {
|
||||
$url .= ':' . $port;
|
||||
}
|
||||
|
||||
$url .= '/' . ltrim($path, '/');
|
||||
|
||||
$container->setParameter('env(REDIS_URL)', $url);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ parameters:
|
|||
rabbitmq_prefetch_count: 10
|
||||
|
||||
# Redis processing
|
||||
redis_scheme: tcp
|
||||
redis_scheme: redis
|
||||
redis_host: localhost
|
||||
redis_port: 6379
|
||||
redis_path: null
|
||||
|
|
|
@ -248,12 +248,7 @@ services:
|
|||
|
||||
Predis\Client:
|
||||
arguments:
|
||||
$parameters:
|
||||
scheme: '%redis_scheme%'
|
||||
host: '%redis_host%'
|
||||
port: '%redis_port%'
|
||||
path: '%redis_path%'
|
||||
password: '%redis_password%'
|
||||
$parameters: '%env(REDIS_URL)%'
|
||||
|
||||
Wallabag\Event\Subscriber\SQLiteCascadeDeleteSubscriber:
|
||||
tags:
|
||||
|
|
|
@ -40,7 +40,7 @@ parameters:
|
|||
rabbitmq_prefetch_count: ${RABBITMQ_PREFETCH_COUNT:-10}
|
||||
|
||||
# Redis processing
|
||||
redis_scheme: ${REDIS_SCHEME:-tcp}
|
||||
redis_scheme: ${REDIS_SCHEME:-redis}
|
||||
redis_host: ${REDIS_HOST:-redis}
|
||||
redis_port: ${REDIS_PORT:-6379}
|
||||
redis_path: ${REDIS_PATH:-~}
|
||||
|
|
|
@ -7,6 +7,6 @@ DATABASE_PASSWORD=~
|
|||
DATABASE_PATH='"%kernel.project_dir%/data/db/wallabag.sqlite"'
|
||||
DOMAIN_NAME=http://localhost:8000
|
||||
SECRET=ch4n63m31fy0uc4n
|
||||
PHP_SESSION_SAVE_PATH=tcp://redis:6379?database=2
|
||||
PHP_SESSION_SAVE_PATH=redis://redis:6379?database=2
|
||||
PHP_SESSION_HANDLER=redis
|
||||
TRUSTED_PROXIES=0.0.0.0/0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue