ソースを参照

Merge pull request #1663 from visuddhinanda/laravel

add cdn_urls
visuddhinanda 2 年 前
コミット
3a8fb92dfe
2 ファイル変更10 行追加5 行削除
  1. 8 5
      app/Console/Commands/ExportOffline.php
  2. 2 0
      config/mint.php

+ 8 - 5
app/Console/Commands/ExportOffline.php

@@ -128,17 +128,20 @@ class ExportOffline extends Command
                     ]);
         $info = array();
         $url = array();
-        $url[] = [
-                'link'=>'https://www.wikipali.cc/downloads/'.$zipFile,
-                'hostname'=>'阿里云·中国',
-            ];
+        foreach (config('mint.server.cdn_urls') as $key => $cdn) {
+            $url[] = [
+                    'link' => $cdn . '/' . $zipFile,
+                    'hostname' =>'cdn-' . $key,
+                ];
+        }
+
         //s3
         Storage::put($zipFile, file_get_contents($zipFullFileName));
         $s3Link = Storage::url($zipFile);
         Log::info('export offline: link='.$s3Link);
         $url[] = [
             'link'=>$s3Link,
-            'hostname'=>'Amazon cloud hongkong',
+            'hostname'=>'Amazon cloud storage(Hongkong)',
         ];
         $info[] = ['filename'=>$zipFile,
                     'url' => $url,

+ 2 - 0
config/mint.php

@@ -24,6 +24,8 @@ return [
         'assets' => env('ASSETS_SERVER', "localhost:9999"),
 
         'dashboard_base_path' => env('DASHBOARD_BASE_PATH', "http://127.0.0.1:3000/my"),
+
+        'cdn_urls' => explode(',',env('CDN_URLS', "https://www.wikipali.cc/downloads")),
     ],
 
     'cache' => [