benmain / nest-sftp Goto Github PK
View Code? Open in Web Editor NEWSftp Client for Nest.js Framework
License: MIT License
Sftp Client for Nest.js Framework
License: MIT License
Expose the file stat function
Nestjs can be updated to nestjs v7 and ssh-sftp client can be updated from version 2.X-5.X which has some type changes. Including .exists()
which changes the result.
Hello Ben,
First of all thanks a lot for this jewelry. But the problem i'm facing is multiple connection instances.
I would like to have possibility to register or connect to multiple sftp identified by a connection name as available in the ssh2 lib.
Did you think about it ? Is an update expected ?
The method to upload has the wrong types from @types/ssh2-streams and therefore the implementation in this project is not correct:
Fails:
aync upload(
contents: string | Buffer | NodeJS.ReadableStream,
remoteFilePath: string,
options: TransferOptions = null,
): Promise<void> {
await this.sftpClient.put(contents, remoteFilePath, options);
}
Succeeds:
aync upload(
contents: string | Buffer | NodeJS.ReadableStream,
remoteFilePath: string,
options: WriteStreamOptions = null,
): Promise<void> {
await this.sftpClient.put(contents, remoteFilePath, options);
}
Hi,
Any plan to update the dependencies? Is it safe to install with force?
Getting:
npm ERR! nest-sftp@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Expose the ssh.end() function to be able to close and reopen connections during a session such as a lambda function.
I have no idea what is the problem but when I'm importing SftpModule with the following informations:
@Module({
imports: [HttpModule,
SftpModule.forRoot({
host: '*********************',
port: 21,
username: '********',
password: '*********',
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule { }
I'm able to connect with sftp on the 21 port with that user and that password without any problem from terminal
[1] 21:12:01 - Found 0 errors. Watching for file changes.
[0] [Nest] 17424 - 2019-10-10 21:12:02 [NestFactory] Starting Nest application...
[0] [Nest] 17424 - 2019-10-10 21:12:02 [InstanceLoader] HttpModule dependencies initialized +42ms
[0] [Nest] 17424 - 2019-10-10 21:12:02 [InstanceLoader] AppModule dependencies initialized +1ms
[0] 1: 0x9bcb80 node::Abort() [node]
[0] 2: 0xa30de9 [node]
[0] 3: 0xb8466c [node]
[0] 4: 0xb86477 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
[0] 5: 0x134e979 [node]
[0] Aborted (core dumped)
[0] [nodemon] app crashed - waiting for file changes before starting...
^C[0] wait-on dist/main.js && nodemon exited with code SIGINT
[1] tsc -w -p tsconfig.build.json exited with code SIGINT
Hello,
This package is using an older version of ssh2-sftp-client
which has a known timeout bug that happens during connect. The solution was that a new package was published, version 7.0.2, which uses a newer version of the ssh2
package, which is where the timeout bug was found.
theophilusx/ssh2-sftp-client#338
But the nest-sftp
package is still using broken version 5.3.2:
https://github.com/benMain/nest-sftp/blob/master/package.json#L43
Please update this package to the latest version in the package.json. Thank you
Build failed on semantic release with node version requirements not met:
#!/bin/bash -eo pipefail
npx semantic-release
[semantic-release]: node version >=10.18 is required. Found v8.16.0.See https://github.com/semantic-release/semantic-release/blob/master/docs/support/node-version.md for more details and solutions.
Exited with code exit status 1
Dear Maintainer,
my audit log shows a certain amount of unfixable high vulnerabilities, may I ask you to fix these ?
axios <=0.21.1
Severity: high
Incorrect Comparison in axios - GHSA-cph5-m8f7-6c5x
fix available via npm audit fix
node_modules/nest-sftp/node_modules/axios
@nestjs/common 4.6.0 - 8.0.6
Depends on vulnerable versions of axios
node_modules/nest-sftp/node_modules/@nestjs/common
@nestjs/core <=2.0.2 || 5.0.0-beta.0 - 8.0.0-alpha.7
Depends on vulnerable versions of @nestjs/common
Depends on vulnerable versions of @nestjs/microservices
Depends on vulnerable versions of @nestjs/platform-express
node_modules/nest-sftp/node_modules/@nestjs/core
@nestjs/microservices 5.0.0-beta.0 - 8.0.0-alpha.7
Depends on vulnerable versions of @nestjs/common
node_modules/nest-sftp/node_modules/@nestjs/microservices
@nestjs/platform-express <=8.0.0-alpha.7
Depends on vulnerable versions of @nestjs/common
node_modules/nest-sftp/node_modules/@nestjs/platform-express
ssh2 <1.4.0
Severity: high
OS Command Injection in ssh2 - GHSA-652h-xwhf-q4h6
No fix available
node_modules/ssh2
ssh2-sftp-client <=6.0.1
Depends on vulnerable versions of ssh2
node_modules/ssh2-sftp-client
nest-sftp *
Depends on vulnerable versions of ssh2-sftp-client
node_modules/nest-sftp
Thank you very much in advance
Would be useful to have forRootAsync when configuration is coming from ConfigModule
Thanks!
On Readme file you sad that upload method has remotePath and localPath as parameters, but in the dependecy code i found this :
upload(contents: string | Buffer | NodeJS.ReadableStream, remoteFilePath: string, transferOptions?: TransferOptions): Promise<string>;
Has contents , remoteFilePath as parameters.
Please can you provide us more examples, to explain this method
Some sftp servers have a different user for retrieving and submitting data. Add the ability to reset the connection to the sftp server.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.