
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Remote DiskService through SFTP, for ActiveStorage.
Add this line to your application's Gemfile:
gem 'activestorage-sftp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install activestorage-sftp
Each application server saves blobs to file server through SFTP:
# config/storage.yml
sftp:
service: SFTP
user: user
root: /var/www/proj/shared/storage
host: file.intranet
public_host: https://file.internet
password: <%= ENV['PASSWORD'] %> # optional
File server serves blobs using DiskService:
# config/storage.yml
local:
service: Disk
root: <%= Rails.root.join("storage") %>
Or use it as backup for your primary service:
# config/storage.yml
mirrored:
service: Mirror
primary: local #/S3/AzureStorage/GCS
mirrors:
- sftp
sftp:
service: SFTP
user: user
root: /etc/backup/proj
host: secure.backup
By default the generated URLs will include parameters for content_disposition
, expiration hints etc. A generated blobs URL might thus look like:
https://publichost/PATH/rails/active_storage/disk/hash-hash/name.JPG?content_type=image%2Fjpeg&disposition=inline%3B+filename%3D
If you prefer simple URLs like
https://publichost/PATH/hash
you can set a configuration option:
# config/storage.yml
sftp:
simple_public_urls: true # defaults to false
The default way of verifying that a blob does exist is to login to the sftp server and stat() the relevant file. This is done e.g. before re-transforming and uploading an image variant. While other "caching" solutions exist to speed up that process, a simple and efficient way of verifying the existence of a file is to query the relevant server with an HTTP HEAD request. Depending on the setup this might not always be a viable way, so it can be switched on with a configuration option.
# config/storage.yml
sftp:
verify_via_http_get: true # defaults to false
Bug reports and pull requests are welcome on GitHub at https://github.com/treenewbee/activestorage-sftp.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that activestorage-sftp 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 researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.