
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
solid_cache_dashboard
Advanced tools
A beautiful dashboard for solid_cache. Monitor your Rails application cache performance with detailed stats and visualizations.
Inspired by Solid Queue Dashboard
Add this line to your application's Gemfile:
gem "solid_cache_dashboard"
And then execute:
$ bundle install
Run the installation generator:
$ rails generate solid_cache_dashboard:install
$ rails db:migrate
This will create a migration for the cache events table that tracks cache hits, misses, writes, and deletes.
Mount the dashboard in your config/routes.rb
:
Rails.application.routes.draw do
mount SolidCacheDashboard::Engine => "/solid-cache"
# The rest of your routes...
end
Now you can access the dashboard at /solid-cache
.
You can configure the dashboard by creating an initializer:
# config/initializers/solid_cache_dashboard.rb
SolidCacheDashboard.configure do |config|
config.title = "My App Cache Dashboard"
end
For authentication, you can use routing constraints:
# config/routes.rb
Rails.application.routes.draw do
authenticate :user, -> (user) { user.admin? } do
mount SolidCacheDashboard::Engine => "/solid-cache"
end
end
Or you can create a controller concern:
# app/controllers/concerns/solid_cache_dashboard/authentication.rb
module SolidCacheDashboard
module Authentication
extend ActiveSupport::Concern
included do
before_action :authenticate_solid_cache_dashboard
end
private
def authenticate_solid_cache_dashboard
if !user_signed_in? || !current_user.admin?
redirect_to main_app.root_path, alert: "Not authorized"
end
end
end
end
Then require it in an initializer:
# config/initializers/solid_cache_dashboard.rb
Rails.application.config.to_prepare do
SolidCacheDashboard::ApplicationController.include SolidCacheDashboard::Authentication
end
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
Bug reports and pull requests are welcome on GitHub at https://github.com/afomera/solid_cache_dashboard.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that solid_cache_dashboard demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.