- Русские Блоги
- Плагин VsCode SFTP подробное введение
- ftp-simple
- humy2833
- Functions
- Available commands
- Caution
- Startup Settings
- Config setting example
- Remote Config(option)
- sftp sync extension for VS Code
- Usage
- Example Configs
- Simple
- Profiles
- Multiple Context
- Connection Hopping
- Single Hop
- Multiple Hop
- Config in User Setting
- Remote Explorer
- Debug
- Donation
- Remote FS настройка синхронизации с FTP в VS Code
- Настройка Remote FS
- Как подключится к серверу
- ftp-sync
- Łukasz Wroński
- FTP-Sync extension for VS Code
- Usage
- Ftp-sync: Init
- Ftp-sync: Sync Local to Remote
- Ftp-sync: Sync Remote to Local
- Ftp-sync: Commit
- To be added soon:
- Future plans
- Found any bugs? Got any questions or ideas?
Русские Блоги
Плагин VsCode SFTP подробное введение
Введение в использование плагина VsCode SFTP
1. Предисловие
2. Установка SFTP
Три, принцип SFTP
Четыре, конфигурация SFTP
4.1 Общая конфигурация
4.2 Пример конфигурации
Пять, использование SFTP
VI. Заключение
Введение
Для внешней разработки требуется ftp для изменения файлов. Обычно мы будем использовать FlashFXP и другое программное обеспечение для загрузки или скачивания файлов веб-сайтов, но если мне нужно разработать кодирование веб-сайтов, используйте программное обеспечение для редактирования Загружать файлы намного проще.
На этот раз я представляю использование плагина VsCode SFTP для синхронизации файлов веб-сайтов.
ps: SFTP в настоящее время не может обрабатывать китайские файлы, и я не могу найти решение. Если да, оставьте сообщение и дайте мне знать.
Два, установка SFTP
Подключаемый модуль установки VsCode очень прост, управление подключаемым модулем, поиск «SFTP» и установка его.
Три, принцип SFTP
Принцип SFTP заключается в следующем: сначала должна быть папка проекта локально и папка проекта удаленно, а затем синхронизировать их с помощью файла конфигурации.
SFTP может просматривать все файлы удаленного проекта, но с ним нельзя работать напрямую. Вы должны работать с локальным файлом проекта, а затем выполнить синхронизацию с удаленным проектом.
Теперь у нас есть папка «sftpFolder» как локально, так и удаленно. Откройте локальную папку «sftpFolder» с помощью VsCode, затем выполните ctrl + shift + p, найдите SFTP: Config и нажмите Enter, будет создан файл «.vscode / sftp». json «, это файл конфигурации.
В то же время в левой части рисунка ниже будет дополнительный «удаленный каталог».
Четыре, конфигурация SFTP
4.1 Общая конфигурация
В конфигурационный файл нельзя записывать комментарии, поэтому вот некоторые из его свойств:
uploadOnSave: сохранение локального файла обновления будет автоматически синхронизировано с удаленным файлом (файл не будет переименован и удален одновременно)
downloadOnOpen: загрузить открытый файл с удаленного сервера.
ignore: игнорировать файлы (совпадающие файлы не будут синхронизироваться)
watcher: listener (вы можете переименовывать файлы и удалять файлы)
autoUpload: изменения файлов будут автоматически синхронизированы (модификация и переименование)
autoDelete: удаление файлов будет автоматически синхронизировано
context: текущий рабочий корневой каталог по умолчанию, если вы хотите загрузить только dist, вы можете написать: «dist»
>> Смотрите здесь дополнительные конфигурации
4.2 Пример конфигурации
Пять, использование SFTP
Папка загрузки и Папка загрузки используются, когда uploadOnSave и наблюдатель закрыты.
Шесть, заключение
Текст окончен, надеюсь, вам это поможет.
Источник
ftp-simple
humy2833
Functions
- Directly Open, Edit and Save on server files.
- Save the local file or directory to server(upload and backup option)
- Download the file or directory from ftp server.
- Create a directory on the remote server directly.
- Deletedirectory(recursive) and files directly from the server.
- Rename Change the file name on the FTP server.
- Compare a local file server file.
- Remote directory open to workspace (Beta version)
Available commands
- config — Set the ftp connection information.
- create directory — Create a directory on ftp server.
- open — Open the file directly from ftp server and when you save upload it to the ftp server.
- save — File or directory upload to ftp server.(Available from the context menu)
- download — Download the file or directory from ftp server to the workspace.
- delete — Delete the file or directory directly from ftp server.
- rename — Change the file name on the FTP server.
- diff — Compare a local file server file.
- Remote directory open to workspace — (Beta version) Open the directory directly on workspace from the ftp server. Similar to remote synchronization. (Caution : So remote delete a files is only possible using ‘Delete’ in the context menu)
Caution
Be sure to check the console(Ctrl + Shift + U)(«OUTPUT -> ftp-simple») for a response to the all action.
Startup Settings
- Press ‘F1’
- Enter ‘ftp-simple’
- Pick ‘CONFIG’
- Enter ftp connection information and save
Config setting example
See the easy-ftp details.
- name — string — Display name.
- host — string — server domain or ip.
- port — number — (option) port (Default: : 21)
- type — string — (option) ftp type. ‘ftp’ or ‘sftp’ (Default: : ‘ftp’). If ‘ftp’ does not work, try ‘ftp2’.
- username — string — username for authentication.
- password — string — (option) password for authentication.
- privateKey — string — (option) (only sftp) String that contains a private key for either key-based or hostbased user authentication (OpenSSH format) Default: none
- passphrase — string — (option) Use sftp ‘privateKey’ only. For an encrypted private key, this is the passphrase used to decrypt it. Default: none
- agent — string — (option) (only sftp) Path to ssh-agent’s UNIX socket for ssh-agent-based user authentication. Important: Windows users: set to ‘pageant’ for authenticating with Pageant or (actual) path to a cygwin «UNIX socket.» Default: none
- agentForward — boolean — (option) (only sftp) Set to true to use OpenSSH agent forwarding (auth-agent@openssh.com) for the life of the connection. agent must also be set to use this feature. Default: false
- secure — boolean — (only ftp) Explicit FTPS over TLS, default: false
- secureOptions — object — (only ftp) Options for TLS, same as for tls.connect() in Node.js.
- path — string — (option) remote root path. Default: ‘/’
- autosave — boolean — (option) To determine whether the automatically uploaded when you open a file directly and modify and save. Default: true
- backup — string — (option) The local path you want to back up before file saving on the server.
- confirm — boolean — (option) Only save option. When you save the file, ask if you want to overwrite the file if it already exists.. Default: true
- project — object — (option) Only save option. Pre-specify local workspace path and server root path to save directly without selecting a path. Overwrite unconditionally.
- ignore — array — (option) Only ‘Remote directory open to workspace’ option. Path to be ignore. Use glog pattern. (Caution : server path (ex: /home ) + ignore pattern (ex: /**/node_modules ) => /home/**/node_modules )
Remote Config(option)
«File — Preferences — Settings» and type in the format shown below.
Источник
sftp sync extension for VS Code
Very powerful, with smart features. Very simple, requires just three lines of config! Very fast, finished in a blink.
Usage
- Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac open command palette, run SFTP: config command.
- Enjoy.
For detailed usage. Please go to wiki.
Example Configs
You can see the full config here.
Simple
Profiles
Note: context and watcher are only available at root level.
Use SFTP: Set Profile to switch profile.
Multiple Context
The context must not be same.
Note: name is required in this mode.
Connection Hopping
You can connect to a target server through a proxy with ssh protocol.
Note: Variable substitution is not working in a hop config.
Single Hop
local -> hop -> target
Multiple Hop
local -> hopa -> hopb -> target
Config in User Setting
You can use remote to tell sftp to get the config from remote-fs.
In User Setting:
Remote Explorer
Remote Explorer lets you explore files in remote. You can open Remote Explorer by:
- Run Command View: Show SFTP .
- Click SFTP view in Activity Bar.
You can only view a files content with Remote Explorer. Run command SFTP: Edit in Local to edit it in local.
Note: You need to manually refresh the parent folder after you delete a file to make the explorer updated.
Debug
Open User Settings.
- On Windows/Linux — File > Preferences > Settings
- On macOS — Code > Preferences > Settings
Set sftp.debug to true and reload vscode.
View the logs in View > Output > sftp .
Donation
If this project helped you reduce development time, you can give me a cup of coffee 🙂
Источник
Remote FS настройка синхронизации с FTP в VS Code
Remote FS — плагин для редактора кода Visual Studio Code или VS Code. Позволяет работать с файлами на любом сервере, поддерживающем FTP или SFTP как с локальными. После сохранения файла мгновенно загружает его на удалённый сервер по этому протоколу.
Настройка Remote FS
Для использования Remote FS потребуется внести данные о подключении в файл settings.json. Чтобы попасть в этот файл, нажимаем на значок шестеренки в левом нижнем углу или сочетание клавиш Ctrl + , (Ctrl + Б), далее пишем в поле поиска “json” и нажимаем на ссылку “Edit in settings.json”.
Теперь вставляем в settings.json следующие строки кода.
- scheme — протокол подключения, FTP или SFTP.
- host — хостинг FTP, обычно это IP адрес сервера
- username — имя пользователя
- password — пароль пользователя
- port — порт подключения. По умолчанию 21 для FTP, 22 для SFTP
- rootPath — путь до директории, отображаемой в проводнике VS Code
Как подключится к серверу
Нажмите F1 на клавиатуре, и найдите команду “>Remote FS: Add Folder to WorkSpace” и нажмите Enter.
Выберите нужное подключение стрелочками на клавиатуре (Если подключений несколько) и вновь нажмите Enter.
Если данные для подключения были введены верно, то проводнике VS Code отобразятся файлы и папки с удалённого сервера.
Если у вас нет окна с проводником, то открыть его можно сочетанием клавиш Ctrl + B или Ctrl + Shift + E. Или просто нажав на иконку файлов сверху слева.
Источник
ftp-sync
Łukasz Wroński
FTP-Sync extension for VS Code
This extension allows you to easily synchronise your local workspace (project files) with an FTP server. It also has several advanced features such as automatic upload on save.
Usage
There are four commands available. You can access them from the command palette (Ctrl+Shift+P on Windows/Linux).
You can also sync a single file by right-clicking on it in the left menu and using the «Ftp-sync: Upload File» and «Ftp-sync: Download File» commands.
Ftp-sync: Init
Initializes a default FTP-Sync configuration file in the .vscode directory. Options can be customised as follows:
- remotePath — This can be set to the path on the remote that you would like to upload to. The default is ./ i.e. the root.
- host — The hostname of the FTP server you want to connect to.
- username — The username of the FTP account you want to use.
- password — The password of the FTP account you want to use.
- port — The port on the FTP server you would like to connect to. The default is «21» .
- protocol — The FTP protocol to be used. The default is «ftp» but you can also specify «sftp» .
- uploadOnSave — Whether files should automatically be uploaded on save. The default is false .
- passive — Specifies whether to use FTP passive mode. The default is false .
- debug — Specifies whether to display debug information in an ftp-sync Output window. The default is false .
- privateKeyPath — Specifies the path to the private key for SFTP. The default is null .
- passphrase — Specifies the passphrase to use with the private key for SFTP. The default is null .
- agent — Specifies the ssh-agent to use for SFTP. The default is null .
- allow — An array of escaped regular expression strings specifying paths which are allowed. If nonempty, unless a path matches any of these regular expressions it will not be included in the sync. Default value is empty, implying everything is allowed.
- ignore — An array of escaped regular expression strings specifying paths to ignore. If a path matches any of these regular expressions then it will not be included in the sync. Default values are «\\.git» , «\\.vscode» and «.DS_Store» .
- generatedFiles: — Automatically upload freshly generated files. Also uploads files that are deleted. extensionsToInclude has to be set for this feature to work.
- extensionsToInclude: [«»] e.g. [«.js», «.css»] — Array of strings specifying what extensions to add for auto-upload. Default is «» which means that it will automatically upload files of all extensions. An empty array here means that generatedFiles feature is disabled.
- path: «» — This specifies the path to the directory where the files are, [e.g.] «/build», default is «» which is the root workspace directory
Ftp-sync: Sync Local to Remote
Displays a synchronization wizard to configure a sync operation that changes FTP files and folders to match project files.
Ftp-sync: Sync Remote to Local
Displays a synchronization wizard to configure a sync operation that changes project files and folders to match FTP files.
Ftp-sync: Commit
Commits reviewed list of changes made with Sync Local to Remote or Sync Remote to Local command.
To be added soon:
- Config validation (add minimal configuration requirement)
- Better connection error handling
- More real life testing
- Bug fixes
- Context menu to sync folders (up/down)
Future plans
Found any bugs? Got any questions or ideas?
- Rise a ticket here!
- Contact me at vscode[at]lukaszwronski.pl
Please provide as much information as possible. We are dealing with diffrent ftp servers, file structures, file permissions, operating systems and it might be difficult to reproduce your error and fix it without detailed informations.
I’m looking forward to get any feedback from extension users! Contribution, especially on bug fixing is more than welcome!
Great thanks for suggestions and help with debugging for Martin, Allan, Maxime, suuuunto and all other folks who reported bugs or made improvement requests.
Use at your own risk — I do not guarantee that it will work correctly!
Источник