diff --git a/.env.example b/.env.example index 7d36c9a6..0efcff03 100644 --- a/.env.example +++ b/.env.example @@ -5,5 +5,6 @@ APP_DEBUG=false APP_TIMEZONE=UTC #APP_URL=http://mydomain.com +#FORCE_HTTPS=true #CACHE_DRIVER=memcached diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fd6100b..af53efa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v2.2.1 + +### Added + +- Environment value `FORCE_HTTPS` for forcing `https` scheme usage + ## v2.2.0 ### Changed diff --git a/README.md b/README.md index ebe4721f..389aca3d 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ $ composer create-project tarampampam/mikrotik-hosts-parser [![Docker build][badge_docker_build]][link_docker_build] [![Docker pulls][badge_docker_pulls]][link_docker_pulls] +[![Docker size][badge_docker_size]][link_docker_pulls] [/r/tarampampam/mikrotik-hosts-parser][docker_hub] @@ -78,6 +79,7 @@ This is open-sourced software licensed under the [MIT License][link_license]. [badge_pulls]:https://img.shields.io/github/issues-pr/tarampampam/mikrotik-hosts-parser.svg?style=flat-square&maxAge=180 [badge_docker_build]:https://img.shields.io/docker/build/tarampampam/mikrotik-hosts-parser.svg?style=flat-square&maxAge=180 [badge_docker_pulls]:https://img.shields.io/docker/pulls/tarampampam/mikrotik-hosts-parser.svg?style=flat-square&maxAge=180 +[badge_docker_size]:https://images.microbadger.com/badges/image/tarampampam/mikrotik-hosts-parser:latest.svg?style=flat-square [link_releases]:https://github.com/tarampampam/mikrotik-hosts-parser/releases [link_packagist]:https://packagist.org/packages/tarampampam/mikrotik-hosts-parser [link_build_status]:https://scrutinizer-ci.com/g/tarampampam/mikrotik-hosts-parser/build-status/master diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ddec0469..d2e1742c 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,10 +2,23 @@ namespace App\Providers; +use Illuminate\Support\Facades\URL; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { + /** + * Boot application services. + * + * @return void + */ + public function boot() + { + if ((bool) env('FORCE_HTTPS', false) === true) { + URL::forceScheme('https'); + } + } + /** * Register any application services. * diff --git a/docker-compose.yml b/docker-compose.yml index 7ace770e..30d5e0fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,7 @@ services: LIMIT_SOURCE_LIFE_SIZE: 2048 LIMIT_SOURCE_URI_LENGTH: 256 EXCLUDED_SOURCES_PROTOCOLS: 'http,https,ftp' + #FORCE_HTTPS: 'true' #APP_URL: 'http://mydomain3.com' ports: - "8000:80"