mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add configuration for R2
This commit is contained in:
parent
a22028799d
commit
922aecdd9f
@ -213,13 +213,7 @@ class CreateEntityPdf implements ShouldQueue
|
||||
|
||||
if ($pdf) {
|
||||
try {
|
||||
// if (! Storage::disk($this->disk)->exists($path)) {
|
||||
// Storage::disk($this->disk)->makeDirectory($path, 0775);
|
||||
// }
|
||||
|
||||
Storage::disk($this->disk)->put($file_path, $pdf, 'public');
|
||||
|
||||
//r2 Storage::disk($this->disk)->put($file_path, $pdf);
|
||||
Storage::disk($this->disk)->put($file_path, $pdf);
|
||||
} catch (\Exception $e) {
|
||||
throw new FilePermissionsFailure($e->getMessage());
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ class UploadFile implements ShouldQueue
|
||||
$previewHeight = $height * Document::DOCUMENT_PREVIEW_SIZE / $width;
|
||||
} else {
|
||||
$previewHeight = Document::DOCUMENT_PREVIEW_SIZE;
|
||||
$previewWidth = $width * DOCUMENT_PREVIEW_SIZE / $height;
|
||||
$previewWidth = $width * Document::DOCUMENT_PREVIEW_SIZE / $height;
|
||||
}
|
||||
|
||||
$img->resize($previewWidth, $previewHeight);
|
||||
|
12
app/Jobs/Vendor/CreatePurchaseOrderPdf.php
vendored
12
app/Jobs/Vendor/CreatePurchaseOrderPdf.php
vendored
@ -99,20 +99,11 @@ class CreatePurchaseOrderPdf implements ShouldQueue
|
||||
if ($pdf) {
|
||||
|
||||
try{
|
||||
|
||||
// if(!Storage::disk($this->disk)->exists($this->path))
|
||||
// Storage::disk($this->disk)->makeDirectory($this->path, 0775);
|
||||
|
||||
Storage::disk($this->disk)->put($this->file_path, $pdf, 'public');
|
||||
|
||||
//r2 Storage::disk($this->disk)->put($this->file_path, $pdf);
|
||||
|
||||
Storage::disk($this->disk)->put($this->file_path, $pdf);
|
||||
}
|
||||
catch(\Exception $e)
|
||||
{
|
||||
|
||||
throw new FilePermissionsFailure($e->getMessage());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,7 +202,6 @@ class CreatePurchaseOrderPdf implements ShouldQueue
|
||||
|
||||
if($numbered_pdf)
|
||||
$pdf = $numbered_pdf;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -105,13 +105,7 @@ class GenerateDeliveryNote
|
||||
info($maker->getCompiledHTML());
|
||||
}
|
||||
|
||||
// if (! Storage::disk($this->disk)->exists($this->invoice->client->invoice_filepath($invitation))) {
|
||||
// Storage::disk($this->disk)->makeDirectory($this->invoice->client->invoice_filepath($invitation), 0775);
|
||||
// }
|
||||
|
||||
Storage::disk($this->disk)->put($file_path, $pdf, 'public');
|
||||
|
||||
//r2 Storage::disk($this->disk)->put($file_path, $pdf);
|
||||
Storage::disk($this->disk)->put($file_path, $pdf);
|
||||
|
||||
return $file_path;
|
||||
}
|
||||
|
@ -81,14 +81,14 @@ return [
|
||||
|
||||
'r2' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION'),
|
||||
'bucket' => env('AWS_BUCKET'),
|
||||
'url' => env('AWS_URL'),
|
||||
'key' => env('R2_ACCESS_KEY_ID'),
|
||||
'secret' => env('R2_SECRET_ACCESS_KEY'),
|
||||
'region' => env('R2_DEFAULT_REGION'),
|
||||
'bucket' => env('R2_BUCKET'),
|
||||
'url' => env('R2_URL'),
|
||||
'visibility' => 'private',
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
'endpoint' => env('R2_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('R2_USE_PATH_STYLE_ENDPOINT', false),
|
||||
'throw' => false,
|
||||
],
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user