From 21e064ff918e08f7a8aa133cec5d5a90545ecf5c Mon Sep 17 00:00:00 2001 From: sky121113 Date: Fri, 6 Mar 2026 17:16:00 +0800 Subject: [PATCH] =?UTF-8?q?[FIX]=20=E5=BC=B7=E5=88=B6=20HTTPS=20=E8=88=87?= =?UTF-8?q?=E4=BF=A1=E4=BB=BB=E4=BB=A3=E7=90=86=E4=BB=A5=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20Mixed=20Content=20=E5=95=8F=E9=A1=8C=EF=BC=8C=E4=B8=A6?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=20CI/CD=20=E8=87=AA=E5=8B=95=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=20main=20=E9=82=8F=E8=BC=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy-demo.yaml | 14 ++++++++++++++ app/Http/Middleware/TrustProxies.php | 2 +- app/Providers/AppServiceProvider.php | 4 +++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy-demo.yaml b/.gitea/workflows/deploy-demo.yaml index 3904349..e61ca0c 100644 --- a/.gitea/workflows/deploy-demo.yaml +++ b/.gitea/workflows/deploy-demo.yaml @@ -97,3 +97,17 @@ jobs: php artisan view:cache " docker exec star-cloud-demo-laravel chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache + + - name: Step 5 - Auto Sync workflows to main + run: | + git config --global user.email "bot@taiwan-star.com.tw" + git config --global user.name "CICD Bot" + git fetch origin main + git checkout main + git checkout ${{ github.ref_name }} -- .gitea/workflows/ + if ! git diff --cached --quiet; then + git commit -m "[AUTO] Sync workflows from ${{ github.ref_name }} to main" + GIT_SSH_COMMAND="ssh -p 3222 -o StrictHostKeyChecking=no" git push origin main + fi + git checkout ${{ github.ref_name }} + diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 3391630..559dd2f 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -12,7 +12,7 @@ class TrustProxies extends Middleware * * @var array|string|null */ - protected $proxies; + protected $proxies = '*'; /** * The headers that should be used to detect proxies. diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 452e6b6..b395363 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -19,6 +19,8 @@ class AppServiceProvider extends ServiceProvider */ public function boot(): void { - // + if (!$this->app->isLocal()) { + \Illuminate\Support\Facades\URL::forceScheme('https'); + } } }