Skip to content

Commit

Permalink
feature(storage-sftp): add sftp (ssh) storage adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Oct 10, 2023
1 parent 926fe59 commit ea98b7e
Show file tree
Hide file tree
Showing 14 changed files with 474 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
ports:
- "20-21:20-21"
- "40000-40009:40000-40009"
storage-sftp:
image: atmoz/sftp:alpine
ports:
- "22:22"
options: user:123:::upload
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
1 change: 0 additions & 1 deletion packages/storage-ftp/src/ftp-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export class StorageFtpAdapter implements StorageAdapter {

await this.chmodRecursive(path, permission);
}

}

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/storage-ftp/tests/storage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ setAdapterFactory(async () => {
host: 'localhost',
user: 'user',
password: '123',
});;
});

if (platform() === 'darwin') {
// docker run -d --name storage-ftp -p 20-21:20-21 -p 40000-40009:40000-40009 --env FTP_USER=user --env FTP_PASS=123 garethflowers/ftp-server
adapter = new StorageFtpAdapter({
Expand Down
1 change: 1 addition & 0 deletions packages/storage-sftp/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests
1 change: 1 addition & 0 deletions packages/storage-sftp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Deepkit SFTP (SSH) Storage adapter
Empty file.
1 change: 1 addition & 0 deletions packages/storage-sftp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/ftp-adapter.js';
51 changes: 51 additions & 0 deletions packages/storage-sftp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@deepkit/storage-fstp",
"version": "1.0.1-alpha.13",
"description": "Deepkit storage adapter for sFTP (via SSH)",
"private": true,
"type": "commonjs",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/cjs/index.d.ts",
"exports": {
".": {
"types": "./dist/cjs/index.d.ts",
"require": "./dist/cjs/index.js",
"default": "./dist/esm/index.js"
}
},
"repository": "https://github.com/deepkit/deepkit-framework",
"author": "Marc J. Schmidt <[email protected]>",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "echo '{\"type\": \"module\"}' > ./dist/esm/package.json"
},
"dependencies": {
"ssh2-sftp-client": "^9.1.0"
},
"devDependencies": {
"@deepkit/storage": "^1.0.1-alpha.13",
"@types/ssh2-sftp-client": "^9.0.1"
},
"jest": {
"runner": "../../jest-serial-runner.js",
"testEnvironment": "node",
"transform": {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "<rootDir>/tsconfig.json"
}
]
},
"moduleNameMapper": {
"(.+)\\.js": "$1"
},
"testMatch": [
"**/tests/**/*.spec.ts"
]
}
}
Loading

0 comments on commit ea98b7e

Please sign in to comment.