
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Middleware that displays a custom notification for every HTML page. It's designed to work both in production and development.
Add this line to your application's Gemfile:
gem 'rack-env-notifier'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack-env-notifier
For Rails add use the middleware in application.rb:
config.middleware.use Rack::EnvNotifier
Rack::EnvNotifier can display a custom notification on every html page. It can be configured:
Rack::EnvNotifier.notify = Rails.env.production?
or
Rack::EnvNotifier.notify = true if ["12.34.56.78", "127.0.0.1"].include?(request.remote_ip)
The notification message is wrapped by #env-notifer
CSS ID. This can be customized using custom CSS.
To disable default CSS and use a custom one, configure the initializer:
Rack::EnvNotifier.custom_css = true
and define the custom CSS:
#env-notifier {
font-size: 16px;
}
/* Rack::EnvNotifier.message = 'development' */
#env-notifier.development {
background: #369;
color: #fff;
}
/* Rack::EnvNotifier.message = 'watch out! production environment!!!' */
#env-notifier.watch-out-production-environment {
background: #8a0000;
color: #fff;
font-weight: bold;
}
Rack::EnvNotifier.message = "development mode"
The default message is configured in the initializer:
case Rails.env
when "development"
Rack::EnvNotifier.message = "safe environment"
when "staging"
Rack::EnvNotifier.message = "qa environment"
else
Rack::EnvNotifier.message = "hot environment"
end
if Rails.env.development?
Rack::EnvNotifier.notify = true
Rack::EnvNotifier.message = 'Dev'
end
Thanks to our contributors.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that rack-env-notifier demonstrated a not healthy version release cadence and project activity because the last version was released 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.