diff --git a/config/config.sample.php b/config/config.sample.php index 870d09e24a7..366b6fbbc75 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1227,6 +1227,11 @@ $CONFIG = [ */ 'preview_imaginary_url' => 'http://previews_hpb:8088/', +/** + * If you want set a api key for imaginary. + */ +'preview_imaginary_key' => 'secret', + /** * Only register providers that have been explicitly enabled * diff --git a/lib/private/Preview/Imaginary.php b/lib/private/Preview/Imaginary.php index ed8b9eaa838..74f04e09250 100644 --- a/lib/private/Preview/Imaginary.php +++ b/lib/private/Preview/Imaginary.php @@ -136,9 +136,10 @@ class Imaginary extends ProviderV2 { ]; try { + $imaginaryKey = $this->config->getSystemValueString('preview_imaginary_key', ''); $response = $httpClient->post( $imaginaryUrl . '/pipeline', [ - 'query' => ['operations' => json_encode($operations)], + 'query' => ['operations' => json_encode($operations), 'key' => $imaginaryKey], 'stream' => true, 'content-type' => $file->getMimeType(), 'body' => $stream,