Skip to content

Commit 5372bba

Browse files
committed
add support for cloudflare
1 parent b6ebd46 commit 5372bba

File tree

8 files changed

+94
-2
lines changed

8 files changed

+94
-2
lines changed

.env.actions

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ DOCKER_USER=1000:1000
55
STEAM_CLIENT_SECRET=STEAM_API_KEY
66
STEAM_REDIRECT_URI="http://localhost/steam/callback"
77

8+
LARAVEL_CLOUDFLARE_ENABLED=false
9+
810
APP_NAME=steam-buddy
911
APP_ENV=local
1012
APP_KEY=

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ APP_DEBUG=true
1212
APP_TIMEZONE=UTC
1313
APP_URL=http://localhost
1414

15+
LARAVEL_CLOUDFLARE_ENABLED=false
16+
1517
APP_LOCALE=en
1618
APP_FALLBACK_LOCALE=en
1719
APP_FAKER_LOCALE=en_US

bootstrap/app.php

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Illuminate\Foundation\Configuration\Exceptions;
1111
use Illuminate\Foundation\Configuration\Middleware;
1212
use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
13+
use Illuminate\Http\Middleware\TrustProxies;
1314

1415
return Application::configure(basePath: dirname(__DIR__))
1516
->withRouting(
@@ -18,6 +19,11 @@
1819
health: "/up",
1920
)
2021
->withMiddleware(function (Middleware $middleware): void {
22+
$middleware->replace(
23+
TrustProxies::class,
24+
Monicahq\Cloudflare\Http\Middleware\TrustProxies::class,
25+
);
26+
2127
$middleware->web(append: [
2228
HandleInertiaRequests::class,
2329
AddLinkHeadersForPreloadedAssets::class,

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"laravel/sanctum": "^4.0",
1313
"laravel/socialite": "^5.12",
1414
"laravel/tinker": "^2.9",
15+
"monicahq/laravel-cloudflare": "^3.7",
1516
"predis/predis": "^2.0",
1617
"socialiteproviders/steam": "^4.2",
1718
"tightenco/ziggy": "^2.0"

composer.lock

+76-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/development/php/entrypoint.sh

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ composer install
77
php artisan key:generate
88
php artisan cache:clear
99
php artisan config:clear
10+
php artisan cloudflare:reload
1011

1112
chown -R www-data:www-data /app/storage
1213

docker/production/php/init.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ mkdir -p /app/storage/framework/views
88
mkdir -p /app/storage/framework/cache
99
mkdir -p /app/storage/framework/testing
1010

11-
mkdir -p /app/storage/logs
11+
mkdir -p /app/storage/logs
12+
13+
php artisan cloudflare:reload

routes/console.php

+3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
use Illuminate\Foundation\Inspiring;
66
use Illuminate\Support\Facades\Artisan;
7+
use Illuminate\Support\Facades\Schedule;
78

89
Artisan::command("inspire", function (): void {
910
$this->comment(Inspiring::quote());
1011
})->purpose("Display an inspiring quote")->hourly();
12+
13+
Schedule::command("cloudflare:reload")->daily();

0 commit comments

Comments
 (0)