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.
Open source mini content management system for programmers.
For rails 5.x.x:
gem 'sunrise-cms', '~> 1.1.0', require: 'sunrise'
For rails 4.x.x:
gem "sunrise-cms", :require => "sunrise"
For rails 3.x.x:
gem "sunrise-cms", "~> 0.7.x" :require => "sunrise"
$> rails g devise:install
$> rails g sunrise:install --orm=active_record
Copy db migrations files:
$> rake sunrise:install:migrations
$> rake page_parts_engine:install:migrations
$> rake meta_manager_engine:install:migrations
$> rails g public_activity:migration
$> rails g sunrise:install --orm=mongoid
Just create class:
class SunriseProduct < Sunrise::AbstractModel
self.resource_name = "Product"
association :structure
after_sort :clear_cache
index :thumbs do
scope { Product.includes(:picture) }
preview lambda { |product| product.picture.try(:url, :thumb) }
field :title
field :price
field :total_stock
end
export do
scope { Product.includes(:picture).recently.with_state(:finished) }
field :id
field :product_title
field :size
field :started_at
field :finished_at
field :unique_accounts_count
field :total_points
end
show do
field :title
field :price
field :total_stock
field :sort_order
field :is_visible
end
form do
field :title
field :price
field :total_stock
field do |form, record|
form.input :notes, :as => :text, :id => record.id
end
group :sidebar, :holder => :sidebar do
field :sale_limit_id, :collection => lambda { SaleLimit.all }, :include_blank => false
field :sort_order
field :is_visible, :boolean => true
end
group :bottom, :holder => :bottom do
nested_attributes :variants, :multiply => true do
field :size
field :total_stock, :html => { :style => 'width:100%;clear:both;' }
field :item_model_id, :collection => lambda { ItemModel.all }, :include_blank => false
end
nested_attributes :project_fields, multiply: true, sort: true do
field :name
field :value
end
field :picture, :as => :uploader
end
end
protected
def clear_cache
Rails.cache.clear
end
end
Assets uploading detect ccurrent user by request.env['warden'].user. To overwrite it use:
class Asset
def uploader_user(request)
request.env['warden'].user(:account) || request.env['warden'].user(:user)
end
end
GET /manage/users/export.xml
GET /manage/users/export.csv
GET /manage/users/export.json
For more info look at jbuilder https://rubygems.org/gems/jbuilder.
gem "ruby2xlsx", "~> 0.0.1"
GET /manage/users/export.xlsx
Now in sunrise file you can perform attributes check. By default permited_attributes allow edit all attributes.
class SunrisePost < Sunrise::AbstractModel
self.resource_name = "Post"
edit do
# Default value
# permited_attributes :all
# Pre user check
permited_attributes lambda { |user|
user.admin? ? :all : [:title, :content]
}
end
end
For example your want to include ckeditor editor. In "Gemfile" include gem:
gem "ckeditor"
Create file "app/assets/javascripts/sunrise/plugins.js":
//= require ckeditor/init
# config/application.rb
config.to_prepare do
Devise::SessionsController.layout "sunrise/devise"
Devise::PasswordsController.layout "sunrise/devise"
Devise::ConfirmationsController.layout "sunrise/devise"
end
Copyright (c) 2014 Fodojo, released under the MIT license
FAQs
Unknown package
We found that sunrise-cms 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.