mirror of
https://github.com/cp6/my-idlers.git
synced 2024-11-16 15:33:44 +01:00
Add optional env var to force SSL
This commit is contained in:
parent
2204970248
commit
f9bdc8b124
@ -78,6 +78,7 @@ removed.
|
|||||||
docker run \
|
docker run \
|
||||||
-p 8000:8000\
|
-p 8000:8000\
|
||||||
-e APP_URL=https://... \
|
-e APP_URL=https://... \
|
||||||
|
-e APP_FORCE_SSL=true \
|
||||||
-e DB_HOST=... \
|
-e DB_HOST=... \
|
||||||
-e DB_DATABASE=... \
|
-e DB_DATABASE=... \
|
||||||
-e DB_USERNAME=... \
|
-e DB_USERNAME=... \
|
||||||
|
@ -35,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
if (config('app.env') === 'production') {
|
if (config('app.force_ssl')) {
|
||||||
\Illuminate\Support\Facades\URL::forceScheme('https');
|
\Illuminate\Support\Facades\URL::forceScheme('https');
|
||||||
}
|
}
|
||||||
$this->configureRateLimiting();
|
$this->configureRateLimiting();
|
||||||
|
@ -27,6 +27,7 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'env' => env('APP_ENV', 'production'),
|
'env' => env('APP_ENV', 'production'),
|
||||||
|
'force_ssl' => (bool) env('APP_FORCE_SSL', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
3
run.sh
3
run.sh
@ -13,7 +13,8 @@ DB_HOST=${DB_HOST}
|
|||||||
DB_DATABASE=${DB_DATABASE}
|
DB_DATABASE=${DB_DATABASE}
|
||||||
DB_USERNAME=${DB_USERNAME}
|
DB_USERNAME=${DB_USERNAME}
|
||||||
DB_PASSWORD=${DB_PASSWORD}
|
DB_PASSWORD=${DB_PASSWORD}
|
||||||
APP_URL=${APP_URL}
|
APP_URL=${APP_URL:-http://localhost:8000}
|
||||||
|
APP_FORCE_SSL=${APP_FORCE_SSL:-false}
|
||||||
EOF
|
EOF
|
||||||
php artisan key:generate --no-interaction --force
|
php artisan key:generate --no-interaction --force
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user