Socket
Socket
Sign inDemoInstall

strapi-provider-upload-azure-sftp

Package Overview
Dependencies
43
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    strapi-provider-upload-azure-sftp

Strapi plugin for file uploading to Azure storage and SFTP.


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
11.1 MB
Created
Weekly downloads
 

Readme

Source

Double Strapi Provider Upload Azure Storage and SFTP

Strapi plugin for file uploading to Azure storage and SFTP.

Change log

  • 1.0.3: Patch with file routes
  • 1.0.2: Added private field
  • 1.0.1: Small hotfix
  • 1.0.0: Initial version

Installing

Inside your strapi project run the following

yarn add strapi-provider-upload-azure-sftp

# or

npm install strapi-provider-upload-azure-sftp

You will need to extend the file model for having two URL keys, url and urlAzure. For this, copy the File.settings.json from node_modules/strapi-plugin-upload/models to extensions/upload/models and add urlAzure to the attribute list

  ...
    "url": {
      "type": "string",
      "configurable": false,
      "required": true
    },
    "urlAzure": {
      "type": "string",
      "configurable": false
    },
  ...

Usage

Strapi version >= 3.0.0

With a stable release of Strapi 3.0.0, the configuration was moved to a JavaScript file. Official documentation here.

To enable the provider, create or edit the file at ./config/plugins.js.

This is an example plugins.js file for Azure storage:

module.exports = ({ env }) => ({
  upload: {
    provider: 'azure-sftp',
    providerOptions: {
      //AZURE CONFIG
      account: CSTORAGE_ACCOUNT'),
      accountKey: env('STORAGE_ACCOUNT_KEY'),
      serviceBaseURL: env('STORAGE_URL'),
      containerName: env('STORAGE_CONTAINER_NAME'),
      defaultPath: 'files',
      maxConcurrent: 10
      //SFTP CONFIG
      host: env('HOST'),
      port: env('PORT'),
      user: env('USER'),
      password: env('PASSWORD'),
      basePath: env('BASE_PATH'),
      baseUrl: env('BASE_URL')
    }
  }
});

serviceBaseURL is optional, it is useful when connecting to Azure Storage API compatible services, like the official emulator Azurite. serviceBaseURL would then look like http://localhost:10000/your-storage-account-key.
When serviceBaseURL is not provided, default https://${account}.blob.core.windows.net will be used.

Private field

If the file object which the provider receives from Strapi have a field private: true the file won't be uploaded to the SFTP and url and urlAzure will have the same URL

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • strapi.io

Keywords

FAQs

Last updated on 05 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc