Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
redis-rails
provides a full set of stores (Cache, Session, HTTP Cache) for Ruby on Rails. See the main redis-store readme for general guidelines.
Add the following to your Gemfile:
gem 'redis-rails'
To use with Rails 4.0+, pin the gem to the latest 4.0 version:
gem 'redis-rails', '~> 4'
# config/application.rb
config.cache_store = :redis_store, "redis://localhost:6379/0/cache", { expires_in: 90.minutes }
(NOTE: The :expires_in
option can also be written as :expire_in
and :expire_after
)
Configuration values at the end are optional. If you want to use Redis as a backend for sessions, you will also need to set:
# config/initializers/session_store.rb
MyApplication::Application.config.session_store :redis_store, servers: ["redis://localhost:6379/0/session"]
You can also provide a hash instead of a URL
config.cache_store = :redis_store, {
host: "localhost",
port: 6379,
db: 0,
password: "mysecret",
namespace: "cache"
}
And similarly for the session store:
MyApplication::Application.config.session_store :redis_store, {
servers: [
{
host: "localhost",
port: 6379,
db: 0,
password: "mysecret",
namespace: "session"
},
],
expire_after: 90.minutes
}
And if you would like to use Redis as a rack-cache backend for HTTP caching, add redis-rack-cache
to your Gemfile and add:
# config/environments/production.rb
config.action_dispatch.rack_cache = {
metastore: "redis://localhost:6379/1/metastore",
entitystore: "redis://localhost:6379/1/entitystore"
}
sentinel_config = {
url: "redis://mymaster/0",
role: "master",
sentinels: [{
host: "127.0.0.1",
port: 26379
},{
host: "127.0.0.1",
port: 26380
},{
host: "127.0.0.1",
port: 26381
}]
}
# configure cache, merging opts with sentinel conf
config.cache_store = :redis_store, sentinel_config.merge(
namespace: "cache",
expires_in: 1.days
)
# configure sessions, setting the sentinel config as the
# servers value, merging opts with the sentinel conf.
config.session_store :redis_store, {
servers: [
sentinel_config.merge(
namespace: "sessions"
)
],
expires_in: 2.days
}
gem install bundler
git clone git://github.com/redis-store/redis-rails.git
cd redis-rails
RAILS_VERSION=5.0.1 bundle install
RAILS_VERSION=5.0.1 bundle exec rake
If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" bundle exec rake
2009 - 2011 Luca Guidi - http://lucaguidi.com, released under the MIT license
FAQs
Unknown package
We found that redis-rails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.