Download the PHP package emotality/laravel-block-cf-origin without Composer

On this page you can find all versions of the php package emotality/laravel-block-cf-origin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-block-cf-origin

Block non-Cloudflare requests in Laravel

License Latest Version Total Downloads

Laravel package to block direct requests to your Cloudlfare-protected origin server.

Overview

This packages should only be used when the following applies:

  1. You can't add firewall rules (to only accept requests from CF Edge IP addresses) because your server is shared with other projects that don't use Cloudflare. If you have a single app running on your server, rather add firewall rules.
  2. You can't add deny/allow rules to your Nginx/Apache config because you are using the set_real_ip_from / mod_remoteip module to forward the user's real IP (X-Forwarded-For). If you don't need to forward the user's real IP, rather add deny/allow rules to your Nginx/Apache config.
  3. You can't install cloudflared and create a tunnel. Read more

See Useful Links section below for more information.

Requirements

*Note: This package only supports the Redis cache driver!

Installation

  1. composer require emotality/laravel-block-cf-origin
  2. php artisan vendor:publish --provider="Emotality\Cloudflare\CloudflareBlockOriginServiceProvider"
  3. Add the middleware in app/Http/Kernel.php:

  4. Add the cronjob to update Cloudflare's netmasks:

  5. Update your config/cloudflare-block.php config and .env accordingly.
  6. Add FastCGI (PHP-FPM) param to your Nginx config:

_$realip_remote_addr will be Cloudflare's IP if the request went through a Cloudflare Edge proxy, or the user's IP if the request was direct.
$remote_addr will be the user's IP address._

Useful Links

Contributing

This package is in its early stages, feel free to report any issues or suggest improvements. Please use the master branch for any pull requests.

License

laravel-block-cf-origin is released under the MIT license. See LICENSE for details.


All versions of laravel-block-cf-origin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-redis Version *
illuminate/cache Version ^9.0|^10.0|^11.0
illuminate/console Version ^9.0|^10.0|^11.0
illuminate/http Version ^9.0|^10.0|^11.0
illuminate/support Version ^9.0|^10.0|^11.0
symfony/http-kernel Version ^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package emotality/laravel-block-cf-origin contains the following files

Loading the files please wait ....