fix(vps): 加 TrustProxies、Redis 持久化 Volume、Log 改 daily
Run Tests / test (pull_request) Successful in 2m15s

- bootstrap/app.php: trustProxies(at: ['*']) 讓 NPM 反向代理的 X-Forwarded-* header 被信任
- docker-compose.yml: Redis 加 redis-data volume,重啟後 session/queue/cache 不再清空
- .env.example: LOG_STACK 改 daily + LOG_DAILY_DAYS=14,避免 VPS 磁碟被單一 log 吃滿

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 23:33:36 +08:00
parent 6b1e31c4af
commit 2fbcd0c50d
3 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12 BCRYPT_ROUNDS=12
LOG_CHANNEL=stack LOG_CHANNEL=stack
LOG_STACK=single LOG_STACK=daily
LOG_DAILY_DAYS=14
LOG_DEPRECATIONS_CHANNEL=null LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug LOG_LEVEL=debug
+1
View File
@@ -13,6 +13,7 @@ return Application::configure(basePath: dirname(__DIR__))
health: '/up', health: '/up',
) )
->withMiddleware(function (Middleware $middleware) { ->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(at: ['*']);
$middleware->alias([ $middleware->alias([
'admin' => \App\Http\Middleware\EnsureAdmin::class, 'admin' => \App\Http\Middleware\EnsureAdmin::class,
]); ]);
+4
View File
@@ -159,6 +159,8 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- cfdive-network - cfdive-network
volumes:
- redis-data:/data
healthcheck: healthcheck:
test: ["CMD", "redis-cli", "ping"] test: ["CMD", "redis-cli", "ping"]
interval: 30s interval: 30s
@@ -205,3 +207,5 @@ networks:
volumes: volumes:
mysql-data: mysql-data:
driver: local driver: local
redis-data:
driver: local