Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.