Explorar el Código

Merge pull request #1672 from visuddhinanda/laravel

添加 'attachments_bucket_name' 配置
visuddhinanda hace 2 años
padre
commit
6639b9e582

+ 5 - 4
app/Console/Commands/ExportZip.php

@@ -96,11 +96,12 @@ class ExportZip extends Command
                 ];
                 ];
         }
         }
 
 
-        $this->info('upload file='.$zipFile);
-        Log::debug('export offline: upload file {filename}',['filename'=>$zipFile]);
-
-        $bucket = 'attachments-'.config('app.env');
+        $bucket = config('mint.attachments_bucket_name');
         $tmpFile =  $bucket.'/'. $zipFile ;
         $tmpFile =  $bucket.'/'. $zipFile ;
+
+        $this->info('upload file='.$tmpFile);
+        Log::debug('export offline: upload file {filename}',['filename'=>$tmpFile]);
+
         Storage::put($tmpFile, file_get_contents($zipFullFileName));
         Storage::put($tmpFile, file_get_contents($zipFullFileName));
 
 
         $this->info('upload done file='.$tmpFile);
         $this->info('upload done file='.$tmpFile);

+ 1 - 1
app/Http/Controllers/OfflineIndexController.php

@@ -24,7 +24,7 @@ class OfflineIndexController extends Controller
             $fileInfo = RedisClusters::get('/offline/index');
             $fileInfo = RedisClusters::get('/offline/index');
             foreach ($fileInfo as $key => $file) {
             foreach ($fileInfo as $key => $file) {
                 $zipFile = $file['filename'];
                 $zipFile = $file['filename'];
-                $bucket = 'attachments-'.config('app.env');
+                $bucket = config('mint.attachments_bucket_name');
                 $tmpFile =  $bucket.'/'. $zipFile ;
                 $tmpFile =  $bucket.'/'. $zipFile ;
                 $url = array();
                 $url = array();
                 foreach (config('mint.server.cdn_urls') as $key => $cdn) {
                 foreach (config('mint.server.cdn_urls') as $key => $cdn) {

+ 1 - 0
app/Tools/Markdown.php

@@ -11,6 +11,7 @@ class Markdown
 
 
     public static function morus($text){
     public static function morus($text){
         $host = config('mint.server.rpc.morus');
         $host = config('mint.server.rpc.morus');
+        Log::debug('morus host='.$host);
         $client = new \Mint\Morus\V1\MarkdownClient($host, [
         $client = new \Mint\Morus\V1\MarkdownClient($host, [
             'credentials' => \Grpc\ChannelCredentials::createInsecure(),
             'credentials' => \Grpc\ChannelCredentials::createInsecure(),
         ]);
         ]);

+ 4 - 0
config/mint.php

@@ -26,8 +26,12 @@ return [
         'dashboard_base_path' => env('DASHBOARD_BASE_PATH', "http://127.0.0.1:3000/my"),
         '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")),
         'cdn_urls' => explode(',',env('CDN_URLS', "https://www.wikipali.cc/downloads")),
+
+
     ],
     ],
 
 
+    'attachments_bucket_name' => env('ATTACHMENTS_BUCKET_NAME', "attachments-next"),
+
     'cache' => [
     'cache' => [
         //这个值prod,staging无需设置
         //这个值prod,staging无需设置
         'expire' => env('CACHE_EXPIRE', 3600),
         'expire' => env('CACHE_EXPIRE', 3600),