Registry / storage / plugin-sftp-private-storage

plugin-sftp-private-storage

JSON →
library1.0.13jsnpmunverified

Provides SFTP connection management and file operations for external storage integration with NocoBase. Current stable version is 1.0.13. This plugin acts as a storage provider backend for the NocoBase external storage manager, enabling encrypted file transfers via SSH File Transfer Protocol. It is specifically designed for NocoBase v2.x and must be used alongside @nocobase/plugin-file-manager. Distinguishes itself with easy integration, support for both password and private key authentication, and seamless file browsing/uploading within the NocoBase admin UI.

npm install plugin-sftp-private-storage
INSTALL
IMPORT
SIG · PLUGIN-SFTP-PRIVAT
P
plugin-sftp-private-storage
storagejavascriptv1.0.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SFTPStorageProvider
import { SFTPStorageProvider } from '@nocobase/plugin-sftp-private-storage';
const SFTPStorageProvider = require('@nocobase/plugin-sftp-private-storage');
Plugin is ESM-only; use named import for the provider class.
PluginSFTPStorage
import { PluginSFTPStorage } from '@nocobase/plugin-sftp-private-storage';
import PluginSFTPStorage from '@nocobase/plugin-sftp-private-storage';
Default import is not available; use named import.
SFTPStorageProvider (type)
import type { SFTPStorageProvider } from '@nocobase/plugin-sftp-private-storage';
import { SFTPStorageProvider } from '@nocobase/plugin-sftp-private-storage';
For type-only usage in TypeScript, use `import type` to avoid runtime issues.

Registers an SFTP storage provider with the NocoBase file manager using environment variables for configuration.

import { SFTPStorageProvider } from '@nocobase/plugin-sftp-private-storage'; import { Plugin } from '@nocobase/server'; class MyPlugin extends Plugin { async load() { const provider = new SFTPStorageProvider(this, { host: process.env.SFTP_HOST ?? 'localhost', port: parseInt(process.env.SFTP_PORT ?? '22'), username: process.env.SFTP_USER ?? 'user', password: process.env.SFTP_PASSWORD ?? '', // or use privateKey: fs.readFileSync(process.env.SFTP_KEY_PATH ?? '') }); this.app.fileManager.registerStorageProvider('sftp', provider); } }
Debug
Known issues
breakingThis plugin requires NocoBase v2.x; it is not compatible with NocoBase 1.x.
fix
Upgrade NocoBase to version 2.x or later.
affects: 1.x
gotchaThe plugin does not support SCP or FTP; it strictly uses SFTP (SSH File Transfer Protocol). Ensure your server supports SFTP.
fix
Verify that your server supports SFTP on the specified port (usually 22).
affects: >=1.0.0
deprecatedPassword-based authentication is deprecated in favor of public key authentication for better security.
fix
Use a private key instead of a password by providing the `privateKey` option.
affects: >=1.0.0
gotchaThe plugin requires the `@nocobase/plugin-file-manager` to be installed and enabled.
fix
Ensure '@nocobase/plugin-file-manager' is installed and activated in your NocoBase instance.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module '@nocobase/plugin-sftp-private-storage'
The plugin is not installed in the project.
fix
Run `npm install @nocobase/plugin-sftp-private-storage` or `yarn add @nocobase/plugin-sftp-private-storage`.
TypeError: SFTPStorageProvider is not a constructor
Incorrect import or the plugin is not loaded correctly.
fix
Ensure you use named import: `import { SFTPStorageProvider } from '@nocobase/plugin-sftp-private-storage';`.
Error: ENOTFOUND: SFTP host not found
The SFTP server hostname is incorrect or unreachable.
fix
Check that the `host` configuration matches a reachable SFTP server address.
Error: All configured authentication methods failed
Authentication credentials (password or private key) are invalid.
fix
Verify the username and password/private key. If using a private key, ensure it has correct permissions (e.g., chmod 600).
Upgrade
Version history
1.0.13latest on npm
Audit
Dependencies
@nocobase/clientrequiredRequired for client-side integration with NocoBase.
@nocobase/databaserequiredRequired for database operations.
@nocobase/plugin-file-managerrequiredRequired as the file manager provider integration point.
@nocobase/serverrequiredRequired for server-side integration with NocoBase.
@nocobase/utilsrequiredProvides shared utilities used by the plugin.
Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
2
Amazon
1
Resources
plugin-sftp-private-storage — npm install plugin-sftp-private-storage · libregistry