Skip to content

Latest commit

 

History

History
155 lines (104 loc) · 8.3 KB

README.md

File metadata and controls

155 lines (104 loc) · 8.3 KB

SublimeText2-FTPSync

Simple and free plugin for FTP syncing. Just hit the save as usual and it's upped.

What's there for you?

  • Multiple named upload targets
  • Ignored file regex patterns
  • Secure transfer using TLS
  • Downloading via temporary file (better stability)
  • Determining newer remote files, overwrite protection
  • Manual multiple file & folder up/downloading (sidebar context menu)
  • Multithreaded uploading and downloading
  • Local&remote renaming and deleting
  • Progress bar for multiple up/download
  • [ experimental ] Remote browsing and manipulating via file list

For more info look into Wiki

How to use

To mark a folder and descendants for upload insert ftpsync.settings file in following format. Don't worry - the skeleton can be simply inserted using Preferences > Package Settings > FTPSync > Setup FTPSync in this folder or using context menu in Side bar or using Control/CMD+Shift+P.

Simply:

 {
    <connection_name>: {
        host: {string}, // url of the ftp server

        username: {string=null},
        password: {string=""},

        path: {string="/"}, // your project's root path on the _server_

        upload_on_save: {bool=true}, // whether upload on save [true] or manually [false]

        tls: {bool=false}, // set [true] to use secured transfer, recommended!
        // (server needs to support, but not enforce SSL_REUSE)
    }
}

Whole connection config:

{
    <connection_name>: {
        host: {string},

        username: {null|string=null}, // null means anonymous manipulation
        password: {null|string=""},

        path: {string="/"}, // your project's root path on the _server_

        upload_on_save: {bool=true}, // whether upload on save or manually
        download_on_open: {bool=false}, // checks whether there's a newer remote file on opening a file
        overwrite_newer_prevention: {bool=true}, // overwrite protection when remote file is newer
        upload_delay: {int=0}, // delays [seconds] upload triggered by upload_on_save

        encoding: {string=auto}, // encoding used for filenames on FTP server; auto = UTF8 if extension enabled, otherwise nothing
        port: {int=21}, // remote port, pretty much always 21, unless SFTP
        tls: {bool=false}, // set true to use secured transfer, recommended! (server needs to support)
        passive: {bool=true}, // whether to use passive or active connection
        timeout: {int=30}, // [seconds] to invalidate the cached connection
        ignore: {null|string}, // regular expression, matched against file path - not applied for downloading
        time_offset: {int=0}, // [seconds] to adjust for a different timezone of server
        set_remote_lastmodified: {bool=true}, // if MFMT extension is availible, will set true lastModified based on local file

        default_folder_permissions: {string=755}, // default permissions for newly created folders
        default_local_permissions: {null|string="auto"}, // permissions for downloaded files, "auto" = same as on server
        always_sync_local_permissions: {bool=true}, // set permissions for downloaded file even if it already exists

        after_save_watch: {null|list<list<subfolder, filepatter>>=null} // after save watch
        // example: [ [ "code/assets/css", "*.css" ], [ "code/assets/", "*.jpg, *.png, *.gif" ] ]
        // more in Wiki

    } //,
    // <connection2_name>: { ... }
}

Files are automatically uploaded on save (unless disabled by upload_on_save=false setting). In your newly created settings file some options are preceded with //, this means they are commented out (and default value from global settings file is used) - remove the // to enable the entry.

Drawbacks and notes

  • FTPS is not supported at the moment and is not planned in near future (you can use SFTP or Mote plugins)
  • SSL/TLS is not supported for servers that enforce SSL_REUSE
  • Does not support continuous watching and syncing, only (after) manual action
  • Does not support proxy connections at the moment
  • Does not support remote diff at the moment

About

Done by @NoxArt ~ Twitter

Released under MIT licence.

Feel free to add issues, ideas, pull requests...

Thanks to castus, tommymarshall, TotallyInformation, saiori, vnabet, Jcrs, ItayXD, bibimij, digitalmaster, alfaex, seyDoggy, Nuno, mikedoug, stevether, zaus, noAlvaro, zofie86, fma965, PixelVibe, Kaisercraft, benkaiser, anupdebnath, sy4mil, leek, surfac, mitsurugi, MonoSnippets, Zegnat, cwhittl, shadowsdweller, adiulici01, tablatronix, bllim, Imaulle and friskfly, lysenkobv, nosfan1019, smoochieboochies for reporting issues, ideas and fixing!

Tips

  • Set key bindings (hotkeys) for frequent actions you use

Please edit only Key Bindings - User (clicking Preferences > Package Control > FTPSync > Key Bindings - User will open that file for you). You can use the contents of Key Bindings - Default as a template and copy it there. If you edit Key Bindings - Default (either Sublime's or FTPSync's), your changes will be lost on update.

  • Renaming and deleting

Please keep in mind that for deleting and renaming on server you need to use FTPSync > Rename and FTPSync > Delete features, not those in Sublime Text 2 or SideBarEnhancements.

  • Working from more places? Or in team?

You can either use download_on_open=true to check files upon openning or FTPSync: Check current file command to see whether you have the same version as is on all servers. Using overwrite_newer_prevention is also recommended (it's actually enabled by default).

  • Upload different language versions to different servers of paths

      {
          <connection_name>: {
              host: "ftp.host.en.com",
              ignore: "/locale/(?!fr)\\w+/.*"
          },
          <connection2_name>: {
              host: "ftp.host.cz.com",
              ignore: "/locale/(?!cz)\\w+/.*"
          }
      }
    
  • Using file compilation? Want to upload as well?

You can use after_save_watch option to setup files to be watched for change after uploading on save. Learn how to use in Wiki.

Recent -though older- changes

  • Setting true lastModified (based on local file's last modified value) on FTP server, if it has MFMT extension installed
  • Mutlithreaded upload and download for much better speed
  • Added empty shortcuts wiki entry
  • Fixed Renaming feature
  • Added Delete feature (confirm dialogue inspired by SideBarEnhancements)
  • Improved dialogues
  • Remembering "overwrite cancelled" decision
  • Fixing special characters in file path
  • Stability improvement (fresh connection per non-multithreaded command: those use their own connection handling)
  • Experimental browsing feature