Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
paperclip-storage-ftp
Advanced tools
Allow Paperclip attachments to be stored on FTP servers.
Add this line to your application's Gemfile
:
gem "paperclip-storage-ftp"
And then execute:
$ bundle
Or install it manually:
$ gem install paperclip-storage-ftp
Somewhere in your code:
require "paperclip/storage/ftp"
In your model:
class User < ActiveRecord::Base
has_attached_file :avatar, {
# Choose the FTP storage backend
:storage => :ftp,
# Set where to store the file on the FTP server(s).
# This supports Paperclip::Interpolations.
:path => "/path_on_ftp_server/:attachment/:id/:style/:filename",
# The full URL of where the attachment is publicly accessible.
# This supports Paperclip::Interpolations.
:url => "/url_prefix/:attachment/:id/:style/:filename",
# The list of FTP servers to use
:ftp_servers => [
{
:host => "ftp1.example.com",
:user => "foo",
:password => "bar"
},
# Add more servers if needed
{
:host => "ftp2.example.com",
:user => "foo",
:password => "bar",
:port => 2121, # optional, 21 by default
:passive => true # optional, false by default
}
],
# Optional socket connect timeout (in seconds).
# This only limits the connection phase, once connected
# this option is of no more use.
:ftp_connect_timeout => 5, # optional, nil by default (OS default timeout)
# Optional flag to skip dead servers.
# If set to true and the connection to a particular server cannot be
# established, the connection error will be ignored and the files will
# not be uploaded to that server.
# If set to false and the connection to a particular server cannot be established,
# a SystemCallError will be raised (Errno::ETIMEDOUT, Errno::ENETUNREACH, etc.).
:ftp_ignore_failing_connections => true, # optional, false by default
# Optional flag to keep empty parent directories when deleting files.
:ftp_keep_empty_directories => true # optional, false by default
}
end
:ftp_keep_empty_directories
to disable the removal of empty parent directories when deleting files (introduced in 1.2.2). See usage example above.file_exists?
#22Paperclip::Storage::Ftp::NoServerAvailable
error when using :ftp_ignore_failing_connections => true
but all servers are down:ftp_connect_timeout
and :ftp_ignore_failing_connections
. See usage example above.Mostly performance enhancements
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)You can find out more about our work on our dev blog.
Copyright (c) 2015 XING AG
Released under the MIT license. For full details see LICENSE included in this distribution.
FAQs
Unknown package
We found that paperclip-storage-ftp 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.