Skip to content
Snippets Groups Projects
Verified Commit 8c5b6803 authored by Jonas Leder's avatar Jonas Leder
Browse files

render images through imgproxy

parent d465f5ec
Branches
No related tags found
No related merge requests found
Pipeline #7548 canceled
<?php <?php
use GraphQL\Server\StandardServer; use GraphQL\Server\StandardServer;
use GraphQL\Type\Schema; use GraphQL\Type\Schema;
use GraphQL\Error\DebugFlag;
require 'vendor/autoload.php'; require 'vendor/autoload.php';
require "./lib/config.php"; require "./lib/config.php";
...@@ -17,7 +18,8 @@ try { ...@@ -17,7 +18,8 @@ try {
'schema' => $schema, 'schema' => $schema,
'rootValue' => [ 'rootValue' => [
'db' =>$conn, 'db' =>$conn,
] ],
'debugFlag' => DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE,
]; ];
$server = new StandardServer($serverConfig); $server = new StandardServer($serverConfig);
......
...@@ -28,7 +28,11 @@ function getSkills() { ...@@ -28,7 +28,11 @@ function getSkills() {
// Get the actual presigned-url // Get the actual presigned-url
$downloadURL = (string) $presignedRequest->getUri(); $downloadURL = (string) $presignedRequest->getUri();
array_push($response, $downloadURL); $encodedUrl = rtrim(strtr(base64_encode($downloadURL), '+/', '-_'), '=');
$path = "/rs:fit:0:80:1/g:no/{$encodedUrl}.png";
$signature = rtrim(strtr(base64_encode(hash_hmac('sha256', $imgProxySalt.$path, $imgProxyKey, true)), '+/', '-_'), '=');
array_push($response, $imgProxyUrl . "/" . $signature . $path);
} }
return $response; return $response;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment