Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dyno_scp

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dyno_scp

  • 0.3.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Dyno Scp

Heroku doesnt allow you to scp a file up to their server. This gem creates a barebones file upload mechanism that dumps a file uploaded into the public directory. Heroku automatically cleans that directory regularly so we dont have to worry about files lingering around.

Contents

  • Getting Started
  • Tips
  • Uploading A File
  • Accessing Uploaded Files

Getting Started

Add this line to your application's Gemfile:

gem "dyno_scp", "~> <version>"

And then execute:

$ bundle

Mount the engine in your routes file:

mount DynoScp::Engine, at: "/dyno_scp"

Tips

Heroku runs processes in their own separate dynos. If you add a file in your console session and then exit and re-enter your file will be gone. This becomes and issue when using this tool because when you upload a file it is placed in the web dyno which you can't directly access.

See Accessing Uploaded Files for retrieval steps.

Uploading A File

Note: The upload page requires the user to have an office:sys_admin role

After mounting the engine, you can navigate to #{host}/dyno_scp to see the upload page.

Simply choose the file you wish to upload, then press the "upload" button. You will see a confirmation message once the file has been uploaded.

Files are placed in the /public folder, so use this with caution. They will be publicly accessible to anyone who finds out they exist.

In Heroku, these files are cleared out every 24 hours automatically. In other hosting schemes, there may not be automated cleanup of the public folder.

Accessing Uploaded Files

The main use case for this tool is to upload a file to a heroku hosted site for usage in some type of data load or backfill task.

After setting up open a bash console on the heroku app.

heroku run bash --app my-heroku-app

To use files after they've been uploaded with this tool, you need to retreive the file inside the bash terminal from the web dyno where it was uploaded.

Using curl

curl https://my-heroku-app.herokuapp.com/my_uploaded_file.csv -o my_uploaded_file.csv

Using wget

wget https://my-heroku-app.herokuapp.com/my_uploaded_file.csv my_uploaded_file.csv

FAQs

Package last updated on 17 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc