diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 1627ed1..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -ko_fi: ivanvermeyen -custom: https://paypal.me/ivanvermeyen diff --git a/.github/SECURITY.md b/.github/SECURITY.md index b0a92f1..2698525 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -1,3 +1,3 @@ # Security Policy -If you discover any security related issues, please email ivan@codezero.be instead of using the issue tracker. +If you discover any security related issues, please email james@jamesking.dev instead of using the issue tracker. diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d7b0425..cb29489 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,6 +1,7 @@ name: Tests -on: [ push, pull_request ] +on: + pull_request: jobs: test: @@ -8,66 +9,31 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.0, 8.1, 8.2, 8.3 ] - laravel: [ 8.*, 9.*, 10.*, 11.* ] - dependency-version: [ prefer-stable ] - include: - - laravel: 5.7.* - php: 7.2 - testbench: 3.7.* - - laravel: 5.8.* - php: 7.2 - testbench: 3.8.* - - laravel: 6.* - php: 7.2 - testbench: 4.* - - laravel: 6.* - php: 8.0 - testbench: 4.* - - laravel: 7.* - php: 7.2 - testbench: 5.* - - laravel: 7.* - php: 8.0 - testbench: 5.* - - laravel: 8.* - php: 7.3 - testbench: 6.* - - laravel: 8.* - testbench: 6.* - - laravel: 9.* - testbench: 7.* - - laravel: 10.* - php: 8.1 - testbench: 8.* - - laravel: 10.* - php: 8.2 - testbench: 8.* - - laravel: 10.* - php: 8.3 - testbench: 8.* - - laravel: 11.* - php: 8.2 - testbench: 9.* - - laravel: 11.* - php: 8.3 - testbench: 9.* - exclude: - - laravel: 10.* - php: 8.0 - - laravel: 11.* - php: 8.0 - - laravel: 11.* - php: 8.1 + php: [ 8.4, 8.5 ] + laravel: [ 11.*, 12.* ] + dependency-version: [ prefer-stable ] + include: + - laravel: 11.* + php: 8.4 + testbench: 9.* + - laravel: 11.* + php: 8.5 + testbench: 9.* + - laravel: 12.* + php: 8.4 + testbench: 10.* + - laravel: 12.* + php: 8.5 + testbench: 10.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} diff --git a/LICENSE.md b/LICENSE.md index b52fbf6..2677db6 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,7 @@ # The MIT License (MIT) Copyright (c) 2017 Ivan Vermeyen () +Copyright (c) 2025 James King () > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index bcaf7d8..02cdfcd 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # Laravel StageFront -[![GitHub release](https://img.shields.io/github/release/codezero-be/laravel-stagefront.svg?style=flat-square)](https://github.com/codezero-be/laravel-stagefront/releases) +[![GitHub release](https://img.shields.io/github/release/jamesking56/laravel-stagefront.svg?style=flat-square)](https://github.com/jamesking56/laravel-stagefront/releases) [![Laravel](https://img.shields.io/badge/laravel-11-red?style=flat-square&logo=laravel&logoColor=white)](https://laravel.com) -[![License](https://img.shields.io/packagist/l/codezero/laravel-stagefront.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/github/actions/workflow/status/codezero-be/laravel-stagefront/run-tests.yml?style=flat-square&logo=github&logoColor=white&label=tests)](https://github.com/codezero-be/laravel-stagefront/actions) -[![Code Quality](https://img.shields.io/codacy/grade/a5db8a1321664e67900c96eadc575ece/master?style=flat-square)](https://app.codacy.com/gh/codezero-be/laravel-stagefront) -[![Total Downloads](https://img.shields.io/packagist/dt/codezero/laravel-stagefront.svg?style=flat-square)](https://packagist.org/packages/codezero/laravel-stagefront) +[![License](https://img.shields.io/packagist/l/jamesking56/laravel-stagefront.svg?style=flat-square)](LICENSE.md) +[![Build Status](https://img.shields.io/github/actions/workflow/status/jamesking56/laravel-stagefront/run-tests.yml?style=flat-square&logo=github&logoColor=white&label=tests)](https://github.com/jamesking56/laravel-stagefront/actions) +[![Code Quality](https://img.shields.io/codacy/grade/a5db8a1321664e67900c96eadc575ece/master?style=flat-square)](https://app.codacy.com/gh/jamesking56/laravel-stagefront) +[![Total Downloads](https://img.shields.io/packagist/dt/jamesking56/laravel-stagefront.svg?style=flat-square)](https://packagist.org/packages/codezero/laravel-stagefront) -[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R3UQ8V) +### RIP Ivan Vermeyen: thank you for your fantastic work #### Quickly add password protection to a staging site. @@ -21,35 +21,23 @@ By installing StageFront with composer, adding the middleware and setting 3 vari ## ✅ Requirements -- PHP ^7.1 | ^8.0 -- [Laravel](https://laravel.com/) >= 5.7 +- PHP ^8.4 +- [Laravel](https://laravel.com/) >= 11 ## 📦 Installation #### ☑️ Require the package via Composer: ```bash -composer require codezero/laravel-stagefront +composer require jamesking56/laravel-stagefront ``` -Laravel will automatically register the [ServiceProvider](https://github.com/codezero-be/laravel-stagefront/blob/master/src/StageFrontServiceProvider.php) and routes. +Laravel will automatically register the [ServiceProvider](https://github.com/jamesking56/laravel-stagefront/blob/master/src/StageFrontServiceProvider.php) and routes. When StageFront is disabled, its routes will not be registered. #### ☑️ Install Middleware -To activate the middleware, add it to the `web` middleware group in `app/Http/Kernel.php`, **right after the `StartSession` middleware**: - -```php -protected $middlewareGroups = [ - 'web' => [ - \Illuminate\Session\Middleware\StartSession::class, // <= after this - \CodeZero\StageFront\Middleware\RedirectIfStageFrontIsEnabled::class, - //... - ], -]; -``` - -In Laravel 6+ you need to add the middleware to the `$middlewarePriority` array in `app/Http/Kernel.php`, **right after the `StartSession` middleware**. +To activate the middleware, you need to add the middleware to the `$middlewarePriority` array in `app/Http/Kernel.php`, **right after the `StartSession` middleware**. ```php protected $middlewarePriority = [ @@ -65,7 +53,7 @@ Now you just need to set some `.env` variables and you are up and running! Set some options in your `.env` file or publish the [configuration file](#-publish-configuration-file). -See an [example .env file](https://github.com/codezero-be/laravel-stagefront/blob/master/.env.example). +See an [example .env file](https://github.com/jamesking56/laravel-stagefront/blob/master/.env.example). Enable StageFront and choose a login and password: @@ -76,7 +64,7 @@ Enable StageFront and choose a login and password: | `STAGEFRONT_PASSWORD` | `string` | `stagefront` | | `STAGEFRONT_ENCRYPTED` | `bool` | `false` | -By default StageFront is disabled and uses a plain text password when it's enabled. If you set `STAGEFRONT_ENCRYPTED` to `true` the password should be a hashed value. You can generate this using Laravel's `\Hash::make('your password')` function. +By default, StageFront is disabled and uses a plain text password when it's enabled. If you set `STAGEFRONT_ENCRYPTED` to `true` the password should be a hashed value. You can generate this using Laravel's `\Hash::make('your password')` function. ##### Artisan Commands for Quick Setup @@ -113,13 +101,13 @@ The above login and password settings will then be ignored. | `STAGEFRONT_DATABASE_PASSWORD_FIELD` | `string` | `password` | If you want to grant access to just a few of those users, you can whitelist them by setting `STAGEFRONT_DATABASE_WHITELIST` to a comma separated string: `'john@doe.io,jane@doe.io'`. -In the config file itself you can also use an array of e-mail addresses. +In the config file itself, you can also use an array of e-mail addresses. -By default the `users` table is used with the `email` and `password` field names. But you can change this if you are using some other table or fields. +By default, the `users` table is used with the `email` and `password` field names. But you can change this if you are using some other table or fields. ## 🔖 IP Whitelist -You can add a comma separated list of IP's to grant these users easier or exclusive access to your staging site. +You can add a comma-separated list of IP's to grant these users easier or exclusive access to your staging site. For example: `'1.2.3.4,1.2.3.4'`. In the config file itself you can also use an array of IP's. | Option | Type | Default | @@ -141,7 +129,7 @@ Set `STAGEFRONT_IP_WHITELIST_REQUIRE_LOGIN` to `true` to set this up. #### ☑️ Change Route URL -By default a `GET` and `POST` route will be registered with the `/stagefront` URL. +By default, a `GET` and `POST` route will be registered with the `/stagefront` URL. You can change the URL by setting this option: @@ -193,14 +181,14 @@ For example: 'ignore_urls' => [ // ignores /john, but noting under /john '/john', - // ignores everyting under /jane, but not /jane itself + // ignores everything under /jane, but not /jane itself '/jane/*', ], ``` #### ☑️ Ignore Domains -If for any reason you wish to disable StageFront on specific doamins, you can add these to the `ignore_udomains` array in the [configuration file](#-publish-configuration-file). You can't set this in the `.env` file. +If for any reason you wish to disable StageFront on specific domains, you can add these to the `ignore_domains` array in the [configuration file](#-publish-configuration-file). You can't set this in the `.env` file. For example: @@ -266,17 +254,18 @@ composer test ## ☕️ Credits -- [Ivan Vermeyen](https://byterider.io/) +- [Ivan Vermeyen (RIP)](https://byterider.io/) +- [James King](https://jamesking.dev/) - [All contributors](../../contributors) ## 🔓 Security -If you discover any security related issues, please [e-mail me](mailto:ivan@codezero.be) instead of using the issue tracker. +If you discover any security-related issues, please [e-mail me](mailto:james@jamesking.dev) instead of using the issue tracker. ## 📑 Changelog A complete list of all notable changes to this package can be found on the -[releases page](https://github.com/codezero-be/laravel-stagefront/releases). +[releases page](https://github.com/jamesking56/laravel-stagefront/releases). ## 📜 License diff --git a/composer.json b/composer.json index 17c10eb..d509eff 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "codezero/laravel-stagefront", + "name": "jamesking56/laravel-stagefront", "description": "Quickly add some password protection to a staging site.", "keywords": [ "laravel", @@ -12,16 +12,20 @@ { "name": "Ivan Vermeyen", "email": "ivan@codezero.be" + }, + { + "name": "James King", + "email": "james@jamesking.dev" } ], "require": { - "php": "^7.1|^8.0", + "php": "^8.4", "codezero/dotenv-updater": "^1.1|^2.0", - "illuminate/support": "^5.7|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0" + "illuminate/support": "^11.0|^12.0" }, "require-dev": { - "orchestra/testbench": "^3.7|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0|^10.0" + "orchestra/testbench": "^9.0|^10.0", + "phpunit/phpunit": "^10.0|^11.5.3" }, "scripts": { "test": "phpunit"