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-ftp-upload

v1.0.4

Published

A Strapi provider to upload files to a FTP server with connection concurrency limitation.

Downloads

18

Readme

STRAPI-PROVIDER-FTP-UPLOAD

MIT License   Donation

A Strapi provider to upload files to a FTP server with connection concurrency limitation.

This package is deeply inspired and based by strapi4-ftp-provider. All credits go to BaptisteAg

Give me a ⭐ if you like it.

🗝️ Features

  • Support FTP Connection Concurrency Limitation (mainly for FTP servers with IP connection rate limit)
  • Support Sentry Error Reporting (only activated when Sentry is installed and configured)

📦 Requirements

  • Strapi v4 or higher

🚀 Getting Started

Installation 🍀

npm install strapi-provider-ftp-upload

Visit the npm page.

Configuration 🛠️

Provider

// config/plugins.js or config/plugins.ts

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "strapi-provider-ftp-upload",
      providerOptions: {
        host: env("FTP_HOST"),
        port: env("FTP_PORT", 21),
        user: env("FTP_USER"),
        password: env("FTP_PASSWORD"),
        secure: env.bool("FTP_SECURE", false),
        path: env("FTP_BASE_PATH"),
        baseUrl: env("FTP_BASE_URL"),

        connectionConcurrency: env("FTP_CONNECTION_CONCURRENCY", 5), // 👈 Optional. Default to 5
        useSentry: true, // 👈 Optional. Default to false
      },
    },
  },
});

Security Middleware

// config/middleware.js or config/middleware.ts
module.exports = ({ env }) => [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': [
            "'self'",
            'data:',
            'blob:',
            env('FTP_BASE_URL'), // 👈 new line
          ],
          'media-src': [
            "'self'",
            'data:',
            'blob:',
            env('FTP_BASE_URL'), // 👈 new line
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  // ...
];

Environment Variables

# .env

FTP_HOST=cloud-provider.example.com
FTP_PORT=21
FTP_USER=your-ftp-username
FTP_PASSWORD=your-ftp-password
FTP_BASE_URL=https://ftp.mysite.com/uploads/
FTP_BASE_PATH=/uploads/
FTP_SECURE=true              # 👈 Optional
FTP_CONNECTION_CONCURRENCY=5 # 👈 Optional
Tips

| Environment Variable | Tips | | -------------------- | ---- | | FTP_HOST | If you are using cloud provider, you may need to set the host to the given host name, otherwise, you set it to your FTP server host name or IP address. | | FTP_BASE_URL | If you set "FTP_HOST" to cloud provider host name, you may need to set this to your FTP server host name or IP address to make sure pointing to the correct domain. Otherwirse, just set to upload path, eg. "/uploads/"| | FTP_SECURE | Recommended if you have SSL certificate installed | | FTP_CONNECTION_CONCURRENCY | Never put the real max connection number of your FTP server. Let's say your FTP server can handle 10 connections with the same IP simultaneously, you can set this to 2-3 to make sure there is enough buffer for other FTP operations, eg. connect the FTP server through WinSCP. |

🐛 Known Issues

  • Waiting for your report.

⭐ TODO

  • Waiting for your request.

🤝 Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue. If you want to contribute code, please fork the repository and submit a pull request.

📝 License

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

☕ Donation

Love it? Consider a donation to support my work.

"Donation" <- click me~