Coder Social home page Coder Social logo

mkloubert / vscode-remote-workspace Goto Github PK

View Code? Open in Web Editor NEW
205.0 17.0 36.0 3.17 MB

Multi protocol support for handling remote files like local ones in Visual Studio Code.

Home Page: https://marketplace.visualstudio.com/items?itemName=mkloubert.vscode-remote-workspace

License: GNU Lesser General Public License v3.0

TypeScript 99.55% JavaScript 0.45%
vscode-extension ftp sftp webdav s3-bucket azure-blob slack dropbox workspaces uri

vscode-remote-workspace's Introduction

vscode-remote-workspace

Share via Facebook Share via Twitter Share via Pinterest Share via Reddit Share via LinkedIn Share via Wordpress Share via Email

Latest Release Installs Rating

Multi protocol support of new Visual Studio Code FileSystem API, especially for handling remote files like local ones.

Demo 1

Table of contents

  1. Install
  2. How to use
  3. Commands
  4. Logs
  5. Support and contribute
  6. Related projects

Install []

Launch VS Code Quick Open (Ctrl + P), paste the following command, and press enter:

ext install vscode-remote-workspace

Or search for things like vscode-remote-workspace in your editor.

How to use []

Create (or update) a .code-workspace file and open it by using File >> Open Workspace... in the GUI:

{
    "folders": [{
        "uri": "sftp://my-user:[email protected]?debug=1",
        "name": "My SFTP folder"
    }]
}

If you've never created a .code-workspace file, you might start with a new folder in your home directory, for instance you could name it "VSCodeWorkspace" or "MyApp". Copy the example configuration (shown above) into a new file, and make sure you edit the URI to be specific to your desired protocol and path. Save the file, ensuring the file name ends with .code-workspace. Then, in the VS Code GUI, open that file using File >> Open Workspace...; after a few moments you'll be connected to the URI you specified.

About parameters []

A parameter is a key-value-pair, which has to be setup in the URI and NOT in the settings section of a .code-workspace file.

If you want to set the debug parameter to 1 for a SFTP connection, e.g.:

{
    "folders": [{
        "uri": "sftp://myUser:[email protected]?debug=1",
        "name": "My SFTP folder"
    }]
}

Import parameters []

Any URI / protocol supports a general parameter, called params, which can load / import parameters from an external file, that contains a JSON object.

For example, you can create a file, lets say sftp_server1_uri_params.json, inside your home directory with the following content:

{
    "debug": 1,
    "mode": 664,
    "key": "id_rsa",
    "phrase": "My Key Passphrase",
    "noPhraseFile": 1
}

In the URI, inside your .code-workspace file, you have to define the params parameter and set it to the path / name of that JSON file:

{
    "folders": [{
        "uri": "sftp://myUser:[email protected]?params=sftp_server1_uri_params.json",
        "name": "My SFTP folder"
    }]
}

Relative paths will be mapped to the user's home directory.

Explicit URI parameters, which are also defined in such an external file, will be overwritten by the values of the file.

Placeholders []

An URI parameter can store placeholders, which are replaced by the values of an external file.

For example, you can create a file, like my_values.json, inside your home directory with the following content:

{
    "importEnvVars": true,
    "exclude": [
        "fooParam"
    ],
    "values": {
        "ENC": {
            "code": " ('UTF' + '8').toLowerCase() ",
            "type": "code"
        },
        "FOO": "bar",
        "SSL": {
            "value": 1
        }
    }
}

You can now place them into the values of parameters, by using the format ${VAR_NAME}:

{
    "folders": [{
        "uri": "webdav://myUser:[email protected]/?values=my_values.json&ssl=${SSL}&encoding=${ENC}&binEncoding=${ENC}&fooParam=${FOO}",
        "name": "My WebDAV folder"
    }]
}

If importEnvVars is set to (true), all environment variables of the current process will be imported automatically. The default value is (false).

Parameters, where placeholders DO NOT work:

  • params
  • values
Code []
{
    "values": {
        "FOO": {
            "code": " $h.normalizeString('b' + 'AR') ",
            "type": "code"
        }
    }
}

Code execution allows you to access the following constants, which contain modules, functions and special values:

Name Description
_ lodash module
$fs fs-extra module
$h vscode-helpers module
$l Logger object (s. Logs)
$m Moment.js module, with timezone support
$os os module
$p path module
$r Extened require() function, which also allows to use the modules of that extension.
$v An object with variables, like $v['cache'], which stores an object for caching values for later executions.

Keep in mind: Code is always executed synchronous and NOT via things like promises!

Environment variables []
{
    "values": {
        "FOO": {
            "name": "SSH_AUTH_SOCK",
            "type": "env"
        }
    }
}
Static []
{
    "values": {
        "foo1": "bar1",
        "Foo2": {
            "value": 2
        }
    }
}

Azure []

URL Format: azure://[account:key@][container][/path/to/file/or/folder][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "azure://my-account:my-storage-key@my-container/",
        "name": "My Azure folder"
    }]
}

For accessing local storage emulator, use something like that:

{
    "folders": [{
        "uri": "azure://mycontainer/",
        "name": "My local Azure folder"
    }]
}

Parameters []

Name Description Example
auth A path to a file, that contains the part left to @ (the credentials). Relative paths will be mapped to the user's home directory. auth=my_azure_account
host The custom host address. host=azure.example.com
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=azure_uri_params.json
values The name of an external file, which contains placeholders values=my_values.json

Remarks []

If you create a new folder, a file called .vscode-remote-workspace with 0 size is created there, to keep sure to detect that new folder later. Before you delete that file, you should store another file there, otherwise the directory will disappear.

Dropbox []

URL Format: dropbox://token[/path/to/file/or/folder][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "dropbox://<API-TOKEN>/",
        "name": "My Dropbox folder"
    }]
}

Parameters []

Name Description Example
auth A path to a file, that contains the part left to @ (the API token). Relative paths will be mapped to the user's home directory. auth=dropbox_token
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=dropbox_uri_params.json
values The name of an external file, which contains placeholders values=my_values.json

FTP []

URL Format: ftp://[user:password@]host[:port][/path/to/a/folder][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "ftp://my-user:[email protected]/",
        "name": "My FTP folder"
    }]
}

Parameters []

Name Description Example
auth A path to a file, that contains the part left to @ (the credentials). Relative paths will be mapped to the user's home directory. auth=ftp_server1
follow Follow symbolic links or not. Default: 1 follow=0
keepAlive Defines a time interval, in seconds, that sends a NOOP command automatically to keep the connection alive. keepAlive=15
noop The custom FTP command to execute to check if connection is still alive. Default: NOOP noop=SYST
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=ftp_uri_params.json
queue Use a queue for each action inside the connection. Default: 1 queue=0
queueSize Maximum number of actions to execute at once inside a connection. Default: 1 queueSize=3
values The name of an external file, which contains placeholders values=my_values.json

FTPs []

URL Format: ftps://[user:password@]host[:port][/path/to/a/folder][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "ftps://my-user:[email protected]/",
        "name": "My (secure) FTP folder"
    }]
}

Parameters []

Name Description Example
auth A path to a file, that contains the part left to @ (the credentials). Relative paths will be mapped to the user's home directory. auth=ftps_server1
follow Follow symbolic links or not. Default: 1 follow=0
keepAlive Defines a time interval, in seconds, that sends a NOOP command automatically to keep the connection alive. Default 10 keepAlive=45
legacy Use ftp module instead of forked @icetee/ftp, if you have problems. Default: 0 legacy=1
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=ftps_uri_params.json
queue Use a queue for each action inside the connection. Default: 1 queue=0
queueSize Maximum number of actions to execute at once inside a connection. Default: 1 queueSize=3
rejectUnauthorized Reject unauthorized server certificates or not. Default: 0 rejectUnauthorized=1
secure Use secure (1) or plain (0) FTP connection. Default: 1 secure=0
values The name of an external file, which contains placeholders values=my_values.json

S3 Buckets []

URL Format: s3://[credential_type@]bucket[/path/to/file/or/folder][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "s3://my-bucket/?acl=public-read",
        "name": "My S3 Bucket"
    }]
}

credential_type []

Default value: shared

Name Description Class in AWS SDK
environment Represents credentials from the environment. EnvironmentCredentials
file Represents credentials from a JSON file on disk. FileSystemCredentials
shared Represents credentials loaded from shared credentials file. SharedIniFileCredentials
values The name of an external file, which contains placeholders values=my_values.json

Parameters []

Name Description Example
api A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify latest to use the latest possible version. api=latest
acl The ACL for new or updated files to use. Default: private acl=public-read
debug Set to 1, to debug a connection, by writing all messages to log files. Default: 0 debug=1
endpoint The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like https://{service}.{region}.amazonaws.com. endpoint=https%3A%2F%2Ffoo.bar.amazonaws.com
file If credential type is set to file, this defines the path to the .json file, which should be used. Relative paths will be mapped to the .aws sub folder inside the user's home directory. file=aws.json
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=s3_uri_params.json
profile If credential type is set to shared, this defines the name of the section inside the .ini file, which should be used. Default: default profile=mkloubert
values The name of an external file, which contains placeholders values=my_values.json
varPrefix If credential type is set to environment, this defines the custom prefix for the environment variables (without _ suffix!), which contain the credentials. Default: AWS varPrefix=MY_AWS_PREFIX

SFTP []

URL Format: sftp://[user:password@]host[:port][/path/to/a/folder][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "sftp://my-user:[email protected]/",
        "name": "My SFTP folder"
    }]
}

Parameters []

Name Description Example
agent Name or path to ssh-agent for ssh-agent-based user authentication. agent=myAgent
agentForward Set to 1, to use OpenSSH agent forwarding ([email protected]) for the life of the connection. Default: 0 agentForward=1
allowedHashes Comma-separated list of hashes to verify. allowedHashes=md5,sha-1
auth A path to a file, that contains the part left to @ (the credentials). Relative paths will be mapped to the user's home directory. auth=ftp_server1
debug Set to 1, to debug a connection, by writing all messages to log files. Default: 0 debug=1
dirMode Defines a special chmod access permission value for the folders on server. This can be an octal number or the path to a JSON file, that contains a "mapper" object. If not defined, the value of mode parameter is used. s. mode for more information. dirMode=755
follow Follow symbolic links or not. Default: 1 follow=0
hash The algorithm to use to verify the fingerprint of a host. Possible values are md5 and sha-1 Default: md5 hash=sha-1
keepAlive Defines a time interval, in seconds, that sends "keep alive packages" automatically. keepAlive=15
keepMode Tries to detect the current chmod access permission value of an existing file on server and tries to apply it when saving. Default: 1 keepMode=0
key The path to the key file or the Base64 string with its content. Relative paths will be mapped to the sub folder .ssh inside the user's home directory. key=id_rsa
mode Defines the chmod access permission value for the files / folders on server. This can be an octal number or the path to a JSON file, that contains a "mapper" object. s. mode for more information. mode=644
noop By default, a list operation is done for the root directory of the server, to check if a connection is alive. You can change this by executing a fast command on the server, which does not produce much response, e.g. noop=uname
noPhraseFile 1 indicates, that phrase parameter will NEVER handled as file path. Default: 0 noPhraseFile=1
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=sftp_uri_params.json
phrase The passphrase (or path to a file with it) for the key file, if needed. To prevent conflicts, you should additionally set noPhraseFile to 1, if that value is explicitly a passphrase value and NO path to an external file. Relative file paths will be mapped to the user's home directory. phrase=myPassphrase
queue Use a queue for each action inside the connection. Default: 1 queue=0
queueSize Maximum number of actions to execute at once inside a connection. Default: 1 queueSize=3
timeout How long (in milliseconds) to wait for the SSH handshake to complete. Default: 20000 timeout=60000
tryKeyboard Try keyboard-interactive user authentication if primary user authentication method fails. Can be 0 or 1. Default: 0 tryKeyboard=1
values The name of an external file, which contains placeholders values=my_values.json
mode []

For the parameters dirMode and mode, you can define an octal number, which will be applied to all files and folders, which are created or changed.

You also can define a path to a JSON file, which contains a mapper object:

{
    "644": [
        "**/*.php",
        "**/*.phtml"
    ],
    "777": "/*.txt"
}

Save the content to a file, like sftp_modes.json, inside your user directory, e.g., and save your mapping in the format as described by the upper JSON snippet.

To use the mappings, setup the mode parameter with the path of that file (in that example to sftp_modes.json). Relative paths will be mapped to the user's home directory.

Glob patterns are handled by minimatch.

Using ssh-agent []

If you use ssh-agent for ssh login, you will likely need to use an environment variable to get the path for the agent parameter. To do this, you'll need to create a values json file to pull the appropriate variable. For instance, in MacOS X, the default ssh-agent path is in $SSH_AUTH_SOCK:

$ ssh-agent
SSH_AUTH_SOCK=/var/folders/w9/mq8x8g87880wn99v2pdx77vr0000gn/T//ssh-VCVBAx48ZEXj/agent.37705; export SSH_AUTH_SOCK;
...

Make a json file to get this value. For instance:

{
    "values": {
        "SSHSOCK": {
            "name": "SSH_AUTH_SOCK",
            "type": "env"
        }
    }
}

Finally, in your .code-workspace file, reference the values json file, and the agent. For instance, if your values json file is named remotessh.json in ~/VSCodeworkspace, your .code-workspace file might have

{
    "folders": [{
        "uri": "sftp://my-user:[email protected]/?values=VSCodeworkspace/remotessh.json&agent=${SSHSOCK}",
        "name": "My SFTP folder"
    }]
}

Slack []

URL Format: slack://token@channel[/][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "slack://<API-TOKEN>@<CHANNEL-ID>",
        "name": "My Slack channel"
    }]
}

Parameters []

Name Description Example
auth A path to a file, that contains the part left to @ (the API token). Relative paths will be mapped to the user's home directory. auth=slack_token
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=slack_uri_params.json
values The name of an external file, which contains placeholders values=my_values.json

Remarks []

The protocol only supports read and list operations.

WebDAV []

URL Format: webdav://[user:password@]host[:port][/path/to/file/or/folder][?param1=value1&param2=value2]

{
    "folders": [{
        "uri": "webdav://myUser:[email protected]/?ssl=1",
        "name": "My WebDAV server"
    }]
}

Parameters []

Name Description Example
auth A path to a file, that contains the part left to @ (the credentials). Relative paths will be mapped to the user's home directory. auth=webdav_server1
base The base path, that is used as prefix for all requests. base=nextcloud/remote.php/webdav/
binEncoding The encoding for reading and writing binary files to use. Default: binary binEncoding=utf8
encoding The encoding for reading and writing text files to use. Default: binary encoding=utf8
authType Kind of authentication to use if at least a username and/or password is defined (s. authType. Default: basic authType=digest
params The name of an external file, which contains other parameters for the URI. s. Import parameters params=webdav_uri_params.json
ssl Use secure HTTP or not. Can be 0 or 1. Default: 0 ssl=1
values The name of an external file, which contains placeholders values=my_values.json

authType []

Defines, what type of authentication should be used, if at least a username and/or password is defined. Possible values are:

Name Alternatives Description
basic b Basic access authentication
digest d Digest access authentication

Commands []

Press F1 and enter one of the following commands:

Name Description ID
Remote Workspace: Execute 'git' Command ... Executes git CLI tool on a remote workspace. extension.remote.workspace.executeGit
Remote Workspace: Execute Remote Command ... Executes a command on a remote workspace. extension.remote.workspace.executeRemoteCommmand
Remote Workspace: Open URI ... Adds / opens a new workspace folder with a supported URI. extension.remote.workspace.openURI
Remote Workspace: Receive Remote URI ... Receives a remote URI from another editor. extension.remote.workspace.receiveWorkspaceURI
Remote Workspace: Reset Remote Command History ... Resets all values of last executed remote commands. extension.remote.workspace.resetRemoteCommandHistory
Remote Workspace: Share Remote URI ... Shares a remote URI with another editor. extension.remote.workspace.sendWorkspaceURI

If you want to define shortcuts for one or more command(s), have a look at the article Key Bindings for Visual Studio Code.

Logs []

Log files are stored inside the .vscode-remote-workspace/.logs subfolder of the user's home directory, separated by day.

Support and contribute []

If you like the extension, you can support the project by sending a donation via PayPal to me.

To contribute, you can open an issue and/or fork this repository.

To work with the code:

  • clone this repository
  • create and change to a new branch, like git checkout -b my_new_feature
  • run npm install from your project folder
  • open that project folder in Visual Studio Code
  • now you can edit and debug there
  • commit your changes to your new branch and sync it with your forked GitHub repo
  • make a pull request

Contributors []

Related projects []

node-simple-socket []

node-simple-socket is a simple socket class, which supports automatic RSA encryption and compression for two connected endpoints and runs in Node.js.

vscode-helpers []

vscode-helpers is a NPM module, which you can use in your own VSCode extension and contains a lot of helpful classes and functions.

vscode-remote-workspace's People

Contributors

angeart avatar mkloubert avatar mlibbey avatar mtorromeo avatar supersandro2000 avatar turekbot 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  avatar

vscode-remote-workspace's Issues

searching and code navigation

I was able to view and edit my files using Remote Workspace but was not able to search the workspace for text ("no results found") or use the code navigation feature "go to definition." Are these yet to be implemented or is there likely a problem with my configuration? Thanks for any info.

NB. The project was transferred from a local directory, where these functions were working fine, to a ubuntu AWS server using rsync -a, so the only variable should be the location of the project on a remote server.

Here's the contents from my .code-workspace file:

{
"folders": [{
"uri": "sftp://[email protected]/home/me/project1/?key=/Volumes/ssh-keys/id_rsa",
"name": "project1"
}
],
"settings": {}

How do I set identity file on config?

Hello I am using amazon aws ec2 as my remote machine

I use private key file .pem to connect my machine.

sftp -o StrictHostKeyChecking=no -i .ssh/myidrsa [email protected]

I used following config

{
    "folders": [{
        "uri": "sftp://[email protected]/",
        "name": "miae"
    }],
    "settings": {key=myidrsa}
}


but it showed

screen shot 2018-06-21 at 12 15 03 pm

Is there any way to pass identity_file to code-workspace?

Remote Workspace Search

This extension is exactly what I was looking for, but it has one major missing functionality issue...

Any file opened from the workspace (or files IN the workspace) are not searched when running a "Find In Files" search.

Is this a problem with the remote filesystem API or the search service?

E.g. If I define a remote workspace on to an Ubuntu machine, using sftp - although I can browse and open files through the workspace GUI -- any attempt to search/find in files fails with "nothing found" (even files open in the editor)

Open multiple files at same time

Is there a setting to allow to open multiple remote files at once? When I have one file open and I click on a second file to open, it closes the first and replaces it with the second. Can it not just open the second file in a new tab? It works if I open it with the "Open to the Side" command, but I don't want it in a side by side mode I want to be able to switch between them.

Please document password limitations.

Following problem with sftp:

I have an user which has a password with special symbols (~!?$/...). When i have setup the uri on code-workspace file, the remote folder became yellow and the ! shows an error like this "could not resolve workspace folder". Then i put ?debug=1 on the end, to see whats going on under the hood. The debug log said "Invalid username" which made no sense the username is right, checked it in WinSCP and Putty. Then i thought a little bit about it, urlencoded the special characters and now it works.

Suggestion: Please document that when you have a password with special characters that you have to "urlencode" these. This would help others not wasting much time figuring out whats wrong, this bugger stole me 45 mins.

BTW: Great job on that extension, i absolutely like it having VS Code not needing any SFTP/SCP client to remote edit files :)

Best regards
T. Schumacher

show "hidden" files

When connecting to ftp server files starting with "." (.htaccess, .gitignore) do not show up.
Is there a setting I am missing to enable it?

Cannot connect via SFTP with a key file.

No matter what settings I attempt, such as:

{
    "folders": [{
        "uri": "sftp://[email protected]",
        "name": "Name"
    }],
    "settings": {
        "debug": 1,
	"key": "C:\\Users\\username\\Documents\\ssh\\id_rsa",
        "noPhraseFile": 1,
        "phrase": "passphrase"
    }
}

I always get:

TRACE fs.sftp.sftpfilesystem.forconnection() - [19/Jun/2018:05:27:29 +0000] "(Error) All configured authentication methods failed

Stack:
	at vscode_helpers.createLogger (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\out\extension.js:128:64)
	at ActionLogger.<anonymous> (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:244:25)
	at Generator.next (<anonymous>)
	at C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:23:71
	at Promise (<anonymous>)
	at __awaiter (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:19:12)
	at ActionLogger.onLog (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:226:16)
	at ActionLogger.<anonymous> (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:109:95)
	at Generator.next (<anonymous>)
	at C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:23:71
	at Promise (<anonymous>)
	at __awaiter (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:19:12)
	at ActionLogger.log (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:102:16)
	at ActionLogger.logSync (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:123:14)
	at ActionLogger.trace (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\node_modules\vscode-helpers\lib\logging\index.js:146:21)
	at SFTPFileSystem.<anonymous> (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\out\fs\sftp.js:135:22)
	at Generator.throw (<anonymous>)
	at rejected (C:\Users\username\.vscode\extensions\mkloubert.vscode-remote-workspace-0.27.0\out\fs\sftp.js:21:65)
	at <anonymous>"

Can not authenticate with extension

I can connect to my remote with sftp -i ~/.ssh/id_rsa [email protected].

I can also connect using an FTP GUI program (with either my ssh key, or my username and password).

However, with this configuration:

    "folders": [
        {
            "uri": "sftp://[email protected]",
            "name": "My Remote"
        }
    ],
    "settings": {
        "key": "id_rsa",
        "debug": 1
    }
}

I get the error 'All configured authentication methods have failed'.

I've tried an absolute path for key. I have tried putting the username and password in the uri property, with and withouttryKeyboard set to 1, and I get the same error.

Thoughts?

Vscode remote workspace cannot work fun with cpptools.

When I use remote workspace to map a remote c++ project directory to vscode and open a file with .cpp extension,cpptools tried to start for cpp code intellisense but just failed with the following errors:

  • Unable to start the C/C++ language server. IntelliSense features will be disabled. Error: Launching server using command ~/.vscode/extensions/ms-vscode.cpptools-0.17.6/bin/Microsoft.VSCode.CPP.Extension.darwin failed.
  • Couldn't start client cpptools:

I'm using vscode on Mac.

FTP can only access top level files or folders

Examples:

"uri": "ftp://username:[email protected]/public_html/subfolder1/"

  • fails in explorer panel with (Cannot resolve workspace folder)

"uri": "ftp://username:[email protected]/public_html/"

  • shows files and folders in explorer panel, but trying to open index.html fails with (Unable to open...: File not found...) and trying to open subfolder1 fails with (File not found...)

"uri": "ftp://username:[email protected]/"

  • shows files and folders in explorer panel and allows you to open readme.html, or open public_html to see the index.html and subfolder1. But trying open public_html/subfolder1 still fails and trying to open public_html/index.html still fails

remote-workspace didn't save file

{ "folders" : [{ "uri" : "sftp://ID:PW@host:22/dir/", "name" : "my server" }], "settings": {} }

is working and i can open my server file.
but can not save.
why....?

specific endpoint of s3

I'm trying to mount my Aliyun OSS which provide a Amazon S3 compatible API, just need to specific endpoint and can access with amazon sdk.

but I can't find anywhere to write endpoint in workspace

Reconnect when connection lost

I'm facing an issue while developing using this extension: for any reason when I loose connection with the server, it won't reconnect automatically, forcing me to reopen the workspace. It would be a great feature to have

Close workspace not working

After closing and reopening Visual Code, remote workspace seems to work correctly by opening files that were not previously opened. Closing and reopening files already open do not end up loading. When this happens, "Close workspace" no longer works from the Visual Code File menu.

sftp issues

Great extension! But I am facing some issues while using the sftp protocol:

  1. Symbolic links are not recognized.
  2. We have to put password in the URI? It's showing in the "OPEN EDITORS". "tryKeyboard" seems not working. What about some ssh servers using RSA token as authentication to login?
  3. Can we echo something to the server timely to keep the session alive for longer time?
    Thanks!

Cannot Connect to Remote Host | With Errors?

[2018-08-02 19:25:40.678] [renderer1] [error] write EPIPE: Error: write EPIPE
    at exports._errnoException (util.js:1050:11)
    at WriteWrap.afterWrite (net.js:813:14)
[2018-08-02 19:29:16.436] [renderer1] [info] no standard startup: not the explorer viewlet
[2018-08-02 19:34:34.637] [renderer1] [info] no standard startup: not a new window
[2018-08-02 19:34:38.821] [renderer1] [error] connect ECONNREFUSED 162.253.131.98:32683: Error: connect ECONNREFUSED 162.253.131.98:32683
    at Object.exports._errnoException (util.js:1050:11)
    at exports._exceptionWithHostPort (util.js:1073:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)

This is from the Log (Window)

OS: Windows 10 & Mac 10.13.6
VSCode Version: Latest
Extension Version: Latest

The extension will just constantly try to connect. Connects to other hosts, without an issue...and this is the same configuration as FTP/Filezilla in regards to settings.

PHP validation not working

The following error is shown when opening PHP files from SFTP:

Cannot validate since C://PHP//php.exe is not a valid php executable. Use the setting 'php.validate.executablePath' to configure the PHP executable.

Relative path in URI is not handled relative

I want to create a workspace for a Node.js/Typescript project, where source files and transpilation is handled local on my working host, and distributed files are located on remote host.
My .code-workspace file looks for example:

{
    "folders": [ 
        {
            "uri": "sftp://pi@pi18/home/pi/test1/dist?debug=1&mode=664&key=id_rsa_pi18&passphrase=&noPhraseFile=1",
            "name": "pi18/home/pi/test1/dist"
        },
        {
            "uri": "file://src",
            "name" "src"
        }
    ]
}

Works fine, but the URI file://src is handled as absolute path. I would expect that file://src would be handled relative and file:///src would be handled absolute.

Because file://src is handled as absolute path this folder must be located on local host as /src or I have to change the URI to the absolut path on local host, for example file:///home/xyz/projects/pxyz/src. Using absolute paths in project configuration may lead to problems, when you manage such a project with version control software, and other people clone that project to their local machine and having a different absolute path.

I think the best solution would be to handle relative paths relative to the workspace file by default, and to introduce an additional parameter which is used to change it to users home directory or to any other location.

Local Backup

Great plugin. Thank you. Please post setting to save/ reflect edited changes to local backup.

Introduce additional library for handling FTPS connections

FTPS connections seem to work quite fine, except with both FTP libraries, I have hit following issue on certain servers: icetee/node-ftp#6

I have recently discovered https://github.com/patrickjuchli/basic-ftp which seems to work fine. Would it be possible to either replace the libraries for FTPS with this one, or ditch the node-ftp library and keep the newer one alongside with this one?

I am not quite sure about this since the plugin could then end up quite heavy with having to carry quite a lot of packages along.

FTP should support FTPS connection

I think it is super important to have FTP connection support FTPS mode so the connection to the remote server can be encrypted and secure.

I think it is very important to be able to have secure connection to the server in today's world.

Cannot resolve workspace folder

Tried with &legacy=1, not work too. Data I use to login, works for example in Filezilla. So it's not problem with my config I guess.

Basically it shows "Cannot resolve workspace folder"

{
	"folders": [
		{
			"uri": "ftp://xyz:password@host/?debug=1",
			"name": "temp"
		}
	],
	"settings": {}
}

Formatter not working with vscode-remote-workspace

Thanks for this extremely useful extension!

I have vscode-remote-workspace working perfectly with the editor running on macOS and the project files located on a Linux server over sftp. I have the Python extension ms-python.python installed and its variables have been configured to use autopep8 to format the file on save.

Formatting works fine while editing in a local workspace on the Mac.
Formatting on save does not work when saving remote-workspace files - files are saved without running the formatter.
Explicitly trying to format via Option-Shift-F produces a message:
"There is no document formatter for 'python'-files installed."

This is not a problem with formatter installation. If I open a local workspace at the same time, formatting works.

It would be extremely useful for formatting to work with a remote-workspace where the formatter just runs on the local machine and saves to the remote system. Since the edited file is remote, git submission happens from the remote system and having the pushed file be properly formatted is valuable.


Versions:
VS Code: Version 1.23.1 (1.23.1)
ms-python.python: 2018.6.0
mkloubert.vscode-remote-workspace: 0.30.2

Config:
// Controls if the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.
"editor.formatOnPaste": true,
// Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down.
"editor.formatOnSave": true,
// Format on save timeout. Specifies a time limit in milliseconds for formatOnSave-commands. Commands taking longer than the specified timeout will be cancelled.
"editor.formatOnSaveTimeout": 3000,

Trouble using literal IPv6 addresses in the URI

I'm trying to connect to an SFTP server using its IPv6 address, however there appears to be an issue with parsing the address.

The following configuration results in the error getaddrinfo ENOTFOUND [fe80 [fe80:22 :

{
    "folders": [{
        "uri": "sftp://user:password@[fe80::a00:27ff:fec3:a0ca]/",
        "name": "Toolchain VM"
    }]
}

The Log (Window) view outputs:

[2018-07-11 13:26:36.587] [renderer1] [info] no standard startup: not a new window
[2018-07-11 13:26:44.977] [renderer1] [info] no standard startup: not a new window
[2018-07-11 13:26:51.302] [renderer1] [error] getaddrinfo ENOTFOUND [fe80 [fe80:22: Error: getaddrinfo ENOTFOUND [fe80 [fe80:22
	at errnoException (dns.js:28:10)
	at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)

The same URI works fine when entered into WinSCP or used with a command-line SFTP client, but I can't get it to work here as a remote workspace. Is there something else I need to do to make literal IPv6 addresses work?

Error: New terminal using the remote

Hello,

I added my remote (sftp) to the workspace. It works well.

Now, if I open the integrated terminal and click on "+ new terminal" on the right. I have two option:

  • the directory in local
  • the directory of the remote

new-terminal

If I select the second option, I get this error:

screen shot 2018-08-07 at 11 32 22

Is it possible to add a new terminal automatically connected to the remote with the sftp informations ?

Git Usage out of remote Workspace

Hi,

this extension is a real helper!

I'm remotely connected to a VM with all code and SCM (git) inside. And here starts the problem. All git commands must be made inside the VM. Unfortunately I cannot use the git functionality from inside VS Code.

Is it possible to make scm and scode-remote-workspace work together?

Thanks!

SFTP Server can't stay connected

Configuration is as follows:
{
"folders": [
{
"uri": "sftp://root:*@.com/myfolder",
"name": "mywork",
"keepAlive":15,
}
],
"settings": {}
}

keepAlive Invalid use, When the editor is not used for 20 minutes, it will be automatically dropped and must be reopened to connect.

Prompt for key phrase

Is there any way to prompt for password rather than saving it in clear text inside the project file? I tried to force tryKeyboard by supplying a wrong password and key, but that has no effect

Different chmod file/folders in SFTP

Is it possible to set a different default mode for folders (such as 755) and files (such as 644)?

I didn't find the option.

Also, what's the default for creating new files?

Mode lost after saving the file to the server

The mode is 777 before I save it through VSCode:

-rwxrwxrwx 1 user group 1.9K May 25 14:20 proc.py

After I save it, it's changed to 666:

-rw-rw-rw- 1 user group 1.9K May 25 14:23 proc.py

The executable permission is lost. Can we try to keep it?

WebDav Not Using User Credential

The user id and password is in the workspace file but it's not used to make connection.

TRACE fs.webdav.webdavfilesystem.forconnection() - [22/Jul/2018:05:20:16 +0000] "(Error) HTTP error : 401 - Unauthorized

Stack:
at vscode_helpers.createLogger (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/out/extension.js:129:64)
at ActionLogger. (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:244:25)
at Generator.next ()
at /Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:23:71
at Promise ()
at __awaiter (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:19:12)
at ActionLogger.onLog (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:226:16)
at ActionLogger. (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:109:95)
at Generator.next ()
at /Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:23:71
at Promise ()
at __awaiter (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:19:12)
at ActionLogger.log (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:102:16)
at ActionLogger.logSync (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:123:14)
at ActionLogger.trace (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/node_modules/vscode-helpers/lib/logging/index.js:146:21)
at WebDAVFileSystem. (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/out/fs/webdav.js:109:22)
at Generator.throw ()
at rejected (/Users/weikai/.vscode/extensions/mkloubert.vscode-remote-workspace-0.31.0/out/fs/webdav.js:21:65)
at
at process._tickDomainCallback (internal/process/next_tick.js:135:7)"

How to interrupt my remote command?

I used a SFTP mode to load my workspace, I usde F1 to execute remote command, just like "python test.py", and then I can see the results.
But after that, I modified my program, and want to save it, it failed, nothing happened, and the status of that file was still unsaved.
It seems to be stucked, is there any way to shutdown the program or to continue doing something? Now I can execute the command again or execute other commands like 'echo "test"', they all had results shown on the screen, but I just can't save my file.

Do i miss anything ?

Because is not connecting :(
I got a green folder in VSC with !
I test that sftp conn from terminal is working. Not in VSC. So i suppose i do something wrong.

{
"folders": [{
"uri": "sftp://ID:PASS@SERVERIP:PORT/var/www/www.example.com/lsapp/",
"name": "LSAPP R FOLDER "
}]
}

Any help is apreciated.

Remote Explorer for FTP

Can we connect to the remote server and normaly download the catalogs and files strucure as exist?
The extension GO Outliner creating own icon with menu.
https://marketplace.visualstudio.com/items?itemName=766b.go-outliner

Maybe some ideas from Qucikftp can implemented? I'm the explorer in the dock with new icon? And the manager for the ftp accounts and other workspaces with tree of types, eg. docker, ftp, azure?
microsoft/vscode#20861

I'm realy not sure how this plugin should works with ftp.

linting and formatting

Thank you for the great extension.

Could it possible to implement also linting and code formatting (e.g. for python)? I believe one can have a download on open functionality to achieve, given that there is no possibility to run a remote interpreter...

Multiple folders

Is it me or is it not possible to have multiple folders in workspace?
My workspace settings looks like this and it is working fine when I only have one entry but two is not working.

{
"folders": [
{
"uri": "sftp://username:password@server1:2200/www/",
"name": "server1"
},
{
"uri": "sftp://username:password&Ru@server2:2200/www/",
"name": "server"
}
],
"settings": {}
}

Pageant support for SFTP is missing

Hello,

I want to use the remote workspace with an pageant authentication. I don't see any descriptions in the tutorial how I could use them, if the remote workspace already supports pageant.

For this, the password sector should be an optional parameter or better should be prohibted / disallowed.

Many thanks for your support in advance.

files.exclude in .vscode/settings.json is ignored for remote location

Visual studio code allows to configure that some files are not shown in the Explorer view. The patterns are defined in the file .vscode/settings.json as attribute files.exclude.

If you have a workspace file containing an entry for a local path and an entry for a remote path, then these files.exclude settings are only working for the local path but not for the remote path.

Example:
File README.md is located on remote host and local host. Normally they are visible both in Explorer view. If excluding README.md using an entry in files.exclude, then README.md disappears from local folder but stays in remote folder. I would expect that it disappears from both location views.

File .vscode/settings.json:

{
    "files.exclude": {
        "**/README.md": true,
    }
}

File project.code-workspace:

{
    "folders": [
        {
            "uri": "sftp://user@remotehost/home/user/project?debug=1&key=id_rsa&passphrase=&noPhraseFile=1",
            "name": "remote"
        },
        {
            "uri": "file:///home/user/project",
            "name": "local"
        }
    ]
}

Execute Remote Command dosen't work for training network

I use SFTP to connect my gpu server, it works fine to run a simple code using 'python test.py', but when I run a deep network, it just shows the result "Executing 'python vgg19_bn.py' on sftp://gpu_server/home/sunxk/Documents/DMVCS' ... [Done]", and nothing happened in remote server even a process.

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.