Skip to content

About

Plugin for Pulsar editor, allow upload your files to remote host after every change (FTP\SFTP). This is improving of remote-sync and remote-sync-pro projects.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PulsarSync

Although Microsoft has buried Atom (which, as we all know, is quite typical for this company - to buy competitors projects and shut them down), the community still continues to develop the project under a different name - Pulsar. So it's time to bring new ftp|sftp syncing-package for them.

So what is it?

PulsarSync let you use SFTP and FTP features inside Pulsar, having the ability to upload and download files directly from Tree-view and from editor tabs. PulsarSync is a revision of two projects: remote-sync which was abandoned in 2016 and remote-sync-pro which fixed some of the bugs of the first package. In my version several bugs have been fixed, and support for keepalive connections has been added.

Features

  • Uploading/downloading files to/from the server
  • The same file actions on editor tab right-click as in Tree-view
  • Monitoring files for external changes and automatically uploading - useful for scss/less compiling
  • Support for both SCP/SFTP and FTP
  • Transfer progress in the log panel (file count for folders, byte progress for SCP/SFTP)
  • Unconfigured projects only show Configure in the tree-view and tab menus

Extras

  • Toggle for uploading changes automatically when you save a file
  • Define files to be monitored
  • Toggle the logs for extra information
  • Toggle the hiding and showing of the log panel
  • Set custom config name
  • Support for native Pulsar Notifications

Manual installation

If you need to install a package without the package subsystem, make next steps:

  • Download / clone this repository to your /home/user/.atom/packages/pulsar-sync
  • Enter the directory
  • Run ppm install (in Atom it was apm)

Please note that the finish folder must be named exactly "pulsar-sync", because ppm packages (as and npm too) don't recognize large and small characters.

Usage

You can configure PulsarSync by next ways:

Existing project

Via Pulsar (recommended)

  1. Right click main project folder
  2. Navigate to PulsarSync > Configure
  3. Fill in the details / select options
  4. Hit save

If a project has no .sync.json yet, the tree-view menu only shows Configure. Upload/download items appear after the project is configured.

Manually

  1. Add a file named .sync.json to your project
  2. Add/configure with one of the contents below
  3. Save the file

Options

The .sync.json in your project root will use these options:

Option Datatype Default Details
transport String "" scp for SCP/SFTP, or ftp for FTP
hostname String "" Remote host address
port String "" Remort port to connect on (typically 22 for SCP/SFTP, 21 for FTP)
username String "" Remote host username
password String "" Remote host password
keyfile String "" Absolute path to SSH key (only used for SCP)
secure Boolean false Set to true for both control and data connection encryption (only used for FTP)
passphrase String "" Passphrase for the SSH key (only used for SCP)
useAgent String false Whether or not to use an agent process (only used for SCP)
target String "" Target directory on remote host
source String "" Source directory relative to project root
ignore Array [".sync.json",".git/**"] Array of minimatch patterns of files to ignore
watch Array [] Array of files (relative to project root - starting with "/") to watch for changes
keepalive Integer 0 Number of seconds to wait between two keepalive
uploadMirrors Array [] Transport mirror config array when upload
uploadOnSave Boolean false Whether or not to upload the current file when saved
saveOnUpload Boolean false Whether or not to save a modified file before uploading
useAtomicWrites Boolean false Upload file using a temporary filename before moving to its final location (only used for SCP)
deleteLocal Boolean false Whether or not to delete the local file / folder after remote delete

Example configuration's

SCP example:

{
  "transport": "scp",
  "hostname": "10.10.10.10",
  "port": 22,
  "username": "user",
  "password": "pass",
  "keyfile": "/home/user/.ssh/aws.pem",
  "passphrase": "your_passphrase",
  "target": "/home/user/dirname/subdirname",
  "ignore": [ ".sync.json", ".git/**" ],
  "watch":[
    "/css/styles.css",
    "/index.html"
  ],
  "keepalive": 60
}

SCP useAgent example:

{
  "transport": "scp",
  "hostname": "10.10.10.10",
  "port": 22,
  "username": "user",
  "useAgent": true,
  "target": "/home/user/dirname/subdirname",
  "ignore": [ ".sync.json", ".git/**" ],
  "watch":[
    "/css/styles.css",
    "/index.html"
  ],
  "keepalive": 60
}

FTP example:

{
  "transport": "ftp",
  "hostname": "10.10.10.10",
  "port": 21,
  "username": "user",
  "password": "pass",
  "target": "/home/user/dirname/subdirname",
  "ignore": [ ".git/**" ],
  "watch":[
    "/css/styles.css",
    "/index.html"
  ],
  "keepalive": 60
}

Upload mirrors example:

{
  "transport": "scp",
  "hostname": "10.10.10.10",
  "port": 22,
  "username": "user",
  "password": "pass",
  "keyfile": "/home/user/.ssh/aws.pem",
  "passphrase": "your_passphrase",
  "target": "/home/user/dirname/subdirname",
  "ignore": [ ".git/**" ],
  "watch":[
    "/css/styles.css",
    "/index.html"
  ],
  "uploadMirrors":[
    {
      "transport": "scp",
      "hostname": "10.10.10.10",
      "port": 22,
      "username": "user",
      "password": "pass",
      "keyfile": "/home/user/.ssh/aws.pem",
      "passphrase": "your_passphrase",
      "target": "/home/user/dirname/subdirname_one",
      "ignore": [ ".git/**" ]
    },
    {
      "transport": "ftp",
      "hostname": "10.10.10.10",
      "port": 21,
      "username": "user",
      "password": "pass",
      "target": "/home/user/dirname/subdirname_two",
      "ignore": [ ".git/**" ]
    }
  ]
}

TODO

Follow-ups that are known but not done yet:

  • Replace atom-space-pen-views / jQuery 2.x. The Configure modal and log panel still depend on space-pen; dropping it means rewriting those UIs with Pulsar TextEditor + plain DOM.
  • Replace the unmaintained ftp package with something like basic-ftp. That is a rewrite of FtpTransport, not a drop-in swap.
  • The Configure form does not expose every .sync.json option: source, saveOnUpload, uploadMirrors, and secure can only be set by editing the file.
  • SCP delete runs rm -rf "path" over SSH. A quote in the remote path is unsafe; SFTP unlink/rmdir would be better.
  • SCP folder download lists files with remote find. Hosts without find (typical Windows OpenSSH) will fail.
  • FTP folder delete uses file delete(), not rmdir, so directories may not be removed.
  • useAtomicWrites does remote cp; rm instead of mv, so the replace is not actually atomic.
  • ssh2 1.x dropped some old algorithms. ssh-rsa host keys are still allowed here; very old servers may still fail to connect.

About

Plugin for Pulsar editor, allow upload your files to remote host after every change (FTP\SFTP). This is improving of remote-sync and remote-sync-pro projects.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages