Giter VIP home page Giter VIP logo

sync's Introduction

Known Vulnerabilities FOSSA Status

Syncjs - Upload changed local files to remote server

Syncjs is an easy to use command line tool for uploading your local changes to a remote server.

It's useful in situations where your application needs to be on a remote server to run (dev machines, pubdev environments, etc.) but you still want to use your local environment for development. You can simply map you local copy of the project to the remote version and syncjs will do the rest.

Syncjs in use

This example shows usage with Visual Studio Code but since it's an external script, you can use it with any editor you want.

Vim Example

Features

  • Easy to setup
  • Fast and reliable
  • Runs independently from your toolchain so you can use it with anything
  • Runs on windows, osx and linux
  • detects and handles changes on folders
  • can run multiple instances at the same time

Installation

Syncjs is easy to install, just execute the following

npm install -g syncjs

After this you'll have syncjs binary available to you.

Configuration

Syncjs comes with an init script and sets itself up for you. All you need to do is to cd into your projects directory and run syncjs init it will ask few simple questions and create the config file called sync-config.json make sure you include this file in your .gitignore because this file might contain passwords or secrets depending on your preferences.

cd /my/project/folder
syncjs init

Configuration

Questions on config

  • Username: your username that you use to connect to remote machine

  • Auth method:

    • Password in config: This the least secure version of auth. It will keep your password in the config file as plain text do not use this please
    • Ask during connect: This option will ask your password again every time you start syncjs your password will not be stored anywhere.
    • Private Key: Most secure option, just provide the path for your key file and syncjs will do the rest
  • Hostname or IP of the server: Tell syncjs where to connect

  • Port to connect: defaults to 22 this usually is what you want

  • Local path: syncjs will automatically detect this as the root of your project, but if you only want to sync one specific folder, provide it here as full path

  • Remote path: This is where copy of your local folder lives in the remote server. Make sure you type full path here as well.

License

MIT

License

FOSSA Status

sync's People

Contributors

fossabot avatar primigenus avatar serkanyersen avatar sgtpooki avatar tylerfowle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sync's Issues

id_rsa with passphrase

How de we use sync js with a id_rsa private key with a passphrase ?

if i use the option 'Ask password during connection' i get
"All configured authentication methods failed"

if on the other hand i use 'Path to private key' with a id_rsa key which needs a passphrase i get
'Error: Encrypted private key detected, but no passphrase given'

Any way to use syncjs under these conditions? or it only works with a PK without a passphrase?

thank you

npm install -g syncjs fails

Error: Cannot find module 'gulp-typescript'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/node_modules/syncjs/gulpfile.js:2:10)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)

Windows?

Hi, this could be quite useful. Do you know if it will work on Windows?

multi-path is heavily need and has it support

But there still a little problem: is the project support multipath?
For example, I want to scp a(local) to b(remote), and c(local) to d(remote).

Now I wrote the following format, but it didn’t work.

image

Then what is the corrent format, or did it support the function?

Thanks a million and look forward for your replying.

Is there any way to do an initial sync?

When syncjs is running and I make a change to a file, that change is nicely uploaded to the FTP server. It works really fast too. However, if I have made any local changes while syncjs was not running and then I run syncjs, these changes do not get uploaded (caught up). Is there any a quick way to upload them?

The initialisation step does not allow me to input the final (y/n) step

After filling out all the necessary fields of the syncjs init, the program asks:

Does this look good? (Y/n)

However, it always just exits out of the process.

I have tried this on Command Prompt and Windows PowerShell, and with two different remote servers.
image

I hope this isn't something stupid I've missed out on, and thank you in advance.

Remote CMD and callback feature Request

Do you have any plans to support running build commands on the remote server after a certain file has been uploaded?

For example, I develop locally, sync files to a remote, and then usually run some sort of build command on the remote machine (local builds not possible unfortunately). Allowing me to run a specified command in the folder where the file changed would be excellent. A callback that allows me to refresh the browser locally once that remote command succeeds would be even more dreamy.

ignores in config file

is it possible to write some additional "ignores" in my config file. I try, but it doesn't work.

{
    "username": "xxxxxxxxx",
    "password": "xxxxxxxxx",
    "host": "xxxxxxxxx",
    "localPath": "xxxxxxxxx",
    "remotePath": "xxxxxxxxx",
    "ignores": [
    	".package-lock.json"
    ]
}

Error after 5 minutes

When i use "syncjs" and dont change any files the connection get lost after about 5 minutes every time. When i ssh into my account without syncjs the connection dont get lost after 5 minutes.

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at TCP.onread (net.js:657:25)
Emitted 'error' event at:
    at Client.<anonymous> (/Users/xxx/.nvm/versions/node/v10.2.1/lib/node_modules/syncjs/node_modules/scp2/lib/client.js:81:10)
    at Client.emit (events.js:182:13)
    at Socket.<anonymous> (/Users/xxx/.nvm/versions/node/v10.2.1/lib/node_modules/syncjs/node_modules/ssh2/lib/client.js:215:10)
    at Socket.emit (events.js:187:15)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] sync: `syncjs`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] sync script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2019-03-05T16_28_25_262Z-debug.log
luther$ 

3 logins always required

I just stumbled over this tool and it VERY useful. However, there have been a few hiccups.

  1. Whenever a file is changed, the upload requires three logins each time. It does not matter how many changes there are, it always requires three manual password entries when specifying the password in the config. (When I use a key, this issue goes away).
  2. It seems when first starting it, the tool tries to delete old files and succeeds, but then it fails when trying to upload new files. I need to restart syncjs and then it seems to work ok.

I'm running this from a git bash prompt on windows 10

Turn it into global script

right now syncjs only works from it's own folder. and can only have single config file. it should however work as a script and run from anywhere with given config file.

Publish to npm

it should be on npm so that it can be installed globally and run as a script syncjs name is available

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.