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.
refinerycms-settings
Advanced tools
Refinery Settings was extracted from Refinery CMS just before 2.0.0 was released and can now be used separately.
Add the gem to you Gemfile:
gem 'refinerycms-settings'
Generate and install the necessary migrations:
rails generate refinery:settings
rake db:migrate
When you upgrade from version 2.0.x make sure you run:
rails generate refinery:settings
rake db:migrate
It will copy the new migration and migrate the database.
Settings can be really useful, especially when you have custom display logic or new plugins that need to behave in different ways.
To best explain how settings work, let's use an example. Say you have a client who has a display in a local trade show every year and 2 months before the trade show, they want to display a little banner in the header of all pages.
Once the trade show is finished, the client needs to be able to hide it again
until next year. This is what your application.html.erb
file might look like:
...
<div id='header'>
<h1>My Company</h1>
<% if ::Refinery::Setting.find_or_set(:show_trade_show_banner, false) %>
<%= image_tag ('trade-show-banner.jpg') %>
<% end %>
</div>
...
The following will automatically create a new Refinery setting called
"show_trade_show_banner" and set its default to false
.
If that setting already exists, it just reads in what the current value is.
So as you can see, this is quite clever because you can quickly define new settings and their defaults right from the view as you need them.
This setting would then show up in the backend in the 'Settings' area where the client could change the value as their trade show approaches. Easy as pie!
limit = Refinery::Setting.find_or_set(:list_limit, 20)
FAQs
Unknown package
We found that refinerycms-settings 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.