New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sftp-live-update

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sftp-live-update

A fast way to update live change in an SFTP server

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

sftp-live-update

This tool allows you to work on a local copy, listen to change in order to instantly send them to a remote SFTP server. Also you can run a command via SSH on the server & configure proxy.

Use case & Genesis

When I work hard on a project with database inside docker, backend and multiple front end, my laptop said something like "I don't get paid enough for this bullshit" and it starts to grumble. Lucky as I am, I have an unused linux server at my home. With sftp-live-update I will show you how I use this server to run my backend project while I'm still working on my local copy. It allows me to save my precious memory on my computer.

Feature

  • 🚀 Automatically send update on an SFTP server
  • 👻 Setup a proxy from localhost to your server
  • ✈️ Run a command directly after upload by SSH

Requirements

  • Obviously an SFTP / SSH server
  • A folder to watch : in my case a nodejs project

Installation

yarn global add sftp-live-update

Usage

Create a config file (json):

{
  "sftp": {
    "host": "your sftp host",
    "port": 22,
    "username": "your sftp user",

    "privateKey": "/Users/gtaja/.ssh/id_rsa", // You can put a file or the content of your key
    "passphrase": "your passphrase",
    // or
    "password": "your password",

    // You can also pass any parameters accepted by the connect function
    // of https://github.com/theophilusx/ssh2-sftp-client
  },
  "watchDir": "directory to watch in your laptop",
  "targetDir": "directory to target in your Watcher server",
  "ignore": [
    // Ignore theses files : anymatch-compatible definition
    // https://github.com/es128/anymatch
    "/node_modules",
    "/dist",
    "/.git",
    "/.idea"
  ],
  // Optional
  "proxy": {
    // Redirect HTTP Connection from http://{sftp.host}:${proxy.targetPort}
    "targetPort": 3000,
    // To http://localhost:${proxy.localPort}
    "localPort": 3000
  },
  // Optional
  // Run interactive shell on target server in the targetDir
  "commands": [
    // Install your project
    "yarn install",
    // Start your project
    "yarn start:dev"
  ]
}

Run sftp-live-update <config> (make sure you have add yarn binary to PATH export PATH="$(yarn global bin):$PATH")
WARNING: This will update every files in your Watcher server under the targetDir, make sure this dir doesn't contains important things.

Tricks: running sftp-live-update without config file will look in the file .sftp-live-update.json

For my use case, with the configured proxy & commands, I just run sftp-live-update and my app is running on my server with the same confort as on my device (it's so good to use localhost to target the remote server) !

Enjoy ;)

FAQs

Package last updated on 23 Nov 2020

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