Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,22 @@ To be able to create your first news, you will need to add sections with link

Be sure to set title `LinuxFr.org` to one of your sections, otherwise you won't
be able to create news in the redaction space.

## Alternative Redis configuration

Default Redis configuration is `redis://localhost:6379/0` and for the 1h cache
`redis://localhost:6379/1/cache`.

You can override the configuration with the following environment variables:

- `REDIS_HOST` for the hostname or the IP of your Redis server
- `REDIS_PORT` for the port (default TCP 6379)
- `REDIS_URL` for the full address (like `redis://127.0.0.1:6379/0`)
- `REDIS_CACHE_URL` for the cache full address (like `redis://127.0.0.1:6379/1/cache`)

The first three environment variables are classic for Redis.
The last one about the cache is specific to LinuxFr.org CMS configuration.

Warning: the current configuration doesn't support authentication or TLS. Be
careful with a remote Redis because everything will be exchange in plain text,
and you exposed your Redis server on the network.
2 changes: 1 addition & 1 deletion config/environments/alpha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
config.log_tags = [ :request_id ]

# Use a different cache store in production.
config.cache_store = :redis_cache_store, { url: "redis://localhost:6379/1/cache", expires_in: 1.hour }
config.cache_store = :redis_cache_store, { url: ENV.has_value?("REDIS_CACHE_URL") ? ENV["REDIS_CACHE_URL"] : "redis://localhost:6379/1/cache", expires_in: 1.hour }

config.action_mailer.perform_caching = false

Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
config.log_tags = [ :request_id ]

# Use a different cache store in production.
config.cache_store = :redis_cache_store, { url: "redis://localhost:6379/1/cache", expires_in: 1.hour }
config.cache_store = :redis_cache_store, { url: ENV.has_value?("REDIS_CACHE_URL") ? ENV["REDIS_CACHE_URL"] : "redis://localhost:6379/1/cache", expires_in: 1.hour }

config.action_mailer.perform_caching = false

Expand Down