npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-provider-upload-azure-sftp

v1.0.3

Published

Strapi plugin for file uploading to Azure storage and SFTP.

Downloads

10

Readme

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

  • Al Hill - Join both providers for using them together (https://github.com/alhill)
  • Finnoconsult - SFTP provider - (https://github.com/finnoconsult)
  • Jake Feldman - Azure provider - (https://github.com/jakeFeldman)

License

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

Acknowledgments

  • strapi.io