diff --git a/.env.example b/.env.example index eb28e4f..ffdcd95 100644 --- a/.env.example +++ b/.env.example @@ -30,10 +30,11 @@ MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= +AZURE_STORAGE_DOMAIN=azure_domain +AZURE_STORAGE_NAME=your_storage_name +AZURE_STORAGE_KEY=your_storage_key +AZURE_STORAGE_CONTAINER=your_container_name +AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=;AccountName=;AccountKey=;EndpointSuffix= PUSHER_APP_ID= PUSHER_APP_KEY= diff --git a/app/Classes/Repositories/OrganisationRepository.php b/app/Classes/Repositories/OrganisationRepository.php index 79a7258..a52068e 100644 --- a/app/Classes/Repositories/OrganisationRepository.php +++ b/app/Classes/Repositories/OrganisationRepository.php @@ -81,6 +81,7 @@ public function updateDetailsWithInput(Organisation $org, array $input) if (array_key_exists('url', $input)) { $org->update([ 'attribution_url' => $input['url'], + 'attribution_file_name' => $input['imageUrl'], ]); } diff --git a/app/Classes/Transformers/OrganisationTransformer.php b/app/Classes/Transformers/OrganisationTransformer.php index 4d4bb20..3df674d 100644 --- a/app/Classes/Transformers/OrganisationTransformer.php +++ b/app/Classes/Transformers/OrganisationTransformer.php @@ -63,7 +63,7 @@ public function transform(Organisation $model) return [ 'id' => $contributor->id, 'name' => $contributor->name, - 'logo' => $contributor->logo, + 'logo' => $contributor->logo ? $contributor->getLogoImageUrl() : null, ]; }); } diff --git a/app/Classes/Transformers/WhatNowEntityTransformer.php b/app/Classes/Transformers/WhatNowEntityTransformer.php index e97c265..17622b6 100644 --- a/app/Classes/Transformers/WhatNowEntityTransformer.php +++ b/app/Classes/Transformers/WhatNowEntityTransformer.php @@ -93,7 +93,7 @@ public function transform(WhatNowEntity $model) return [ 'id' => $contributor->id, 'name' => $contributor->name, - 'logo' => $contributor->logo, + 'logo' => $contributor->logo ? $contributor->getLogoImageUrl() : null, ]; }); } diff --git a/app/Http/Controllers/FileUploadController.php b/app/Http/Controllers/FileUploadController.php new file mode 100644 index 0000000..369939d --- /dev/null +++ b/app/Http/Controllers/FileUploadController.php @@ -0,0 +1,32 @@ +validate([ + 'file' => 'required|file|mimes:jpg,png|max:10240', + ]); + + + $file = $request->file('file'); + + + $fileName = $file->getClientOriginalName(); + + + $path = Storage::disk('azure')->putFileAs('', $file, $fileName); + + return response()->json(['path' => $path], 200); + } catch (\Illuminate\Validation\ValidationException $e) { + return response()->json(['errors' => $e->errors()], 422); + } + } +} diff --git a/app/Models/Contributor.php b/app/Models/Contributor.php index 5b3eb1c..33c1a22 100644 --- a/app/Models/Contributor.php +++ b/app/Models/Contributor.php @@ -72,4 +72,22 @@ public function organisation() return $this->belongsTo(OrganisationDetails::class, 'org_detail_id'); } + public function getLogoPath() + { + return '/' . $this->logo; + } + + public function getLogoImageUrl() + { + $filepath = $this->getLogoPath(); + + if (app()->environment('production')) { + + //return valid url + return url(('https://'). config('app.bucket_name') . '.' . config('app.bucket_domain') . '/' . config('app.bucket_container') . $filepath); + } + //TODO configure for QA environment + return url(('https://'). config('app.bucket_name') . '.' . config('app.bucket_domain') . '/' . config('app.bucket_container') . $filepath); + } + } diff --git a/app/Models/Organisation.php b/app/Models/Organisation.php index 6844d88..52960e8 100644 --- a/app/Models/Organisation.php +++ b/app/Models/Organisation.php @@ -44,7 +44,7 @@ public function regions() public function getAttributionFilePath() { - return '/attribution_images/' . $this->attribution_file_name; + return '/' . $this->attribution_file_name; } public function getAttributionImageUrl() @@ -54,10 +54,10 @@ public function getAttributionImageUrl() if (app()->environment('production')) { //return valid url - return url(config('app.cdn_host') . config('app.cdn_asset_path') . $filepath); + return url(('https://'). config('app.bucket_name') . '.' . config('app.bucket_domain') . '/' . config('app.bucket_container') . $filepath); } - - return url(config('app.url') . config('app.cdn_asset_path') . $filepath); + //TODO configure for QA environment + return url(('https://'). config('app.bucket_name') . '.' . config('app.bucket_domain') . '/' . config('app.bucket_container') . $filepath); } } diff --git a/app/Providers/AzureStorageServiceProvider.php b/app/Providers/AzureStorageServiceProvider.php new file mode 100644 index 0000000..61d1d50 --- /dev/null +++ b/app/Providers/AzureStorageServiceProvider.php @@ -0,0 +1,32 @@ +=5.5", + "symfony/polyfill-intl-idn": "^1.17" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "guzzle/client-integration-tests": "3.0.2", - "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.39 || ^9.6.20", - "psr/log": "^1.1 || ^2.0 || ^3.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" }, "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false + "branch-alias": { + "dev-master": "6.5-dev" } }, "autoload": { @@ -895,20 +885,19 @@ } ], "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", "framework", "http", "http client", - "psr-18", - "psr-7", "rest", "web service" ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.9.2" + "source": "https://github.com/guzzle/guzzle/tree/6.5.8" }, "funding": [ { @@ -924,37 +913,33 @@ "type": "tidelift" } ], - "time": "2024-07-24T11:22:20+00:00" + "time": "2022-06-20T22:16:07+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.4", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0" + "php": ">=5.5" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -991,7 +976,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.4" + "source": "https://github.com/guzzle/promises/tree/1.5.3" }, "funding": [ { @@ -1007,48 +992,42 @@ "type": "tidelift" } ], - "time": "2024-10-17T10:06:22+00:00" + "time": "2023-05-21T12:31:43+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.7.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0" + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { - "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "0.9.0", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { "GuzzleHttp\\Psr7\\": "src/" } @@ -1087,11 +1066,6 @@ "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -1107,7 +1081,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.7.0" + "source": "https://github.com/guzzle/psr7/tree/1.9.1" }, "funding": [ { @@ -1123,7 +1097,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T11:15:46+00:00" + "time": "2023-04-17T16:00:37+00:00" }, { "name": "hollodotme/fast-cgi-client", @@ -1942,6 +1916,104 @@ ], "time": "2022-07-02T13:51:38+00:00" }, + { + "name": "league/flysystem-azure", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-azure.git", + "reference": "0b9838c4f75ee41bc390357b0350e9a62e3b3a1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-azure/zipball/0b9838c4f75ee41bc390357b0350e9a62e3b3a1f", + "reference": "0b9838c4f75ee41bc390357b0350e9a62e3b3a1f", + "shasum": "" + }, + "require": { + "league/flysystem": "~1.0", + "microsoft/azure-storage": "~0.10.1", + "php": ">=5.5.0" + }, + "require-dev": { + "mockery/mockery": "~0.9", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\Azure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Flysystem adapter for Windows Azure", + "support": { + "issues": "https://github.com/thephpleague/flysystem-azure/issues", + "source": "https://github.com/thephpleague/flysystem-azure/tree/master" + }, + "abandoned": "league/flysystem-azure-blob-storage", + "time": "2016-07-10T19:08:39+00:00" + }, + { + "name": "league/flysystem-azure-blob-storage", + "version": "0.1.6", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-azure-blob-storage.git", + "reference": "97215345f3c42679299ba556a4d16d4847ee7f6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-azure-blob-storage/zipball/97215345f3c42679299ba556a4d16d4847ee7f6d", + "reference": "97215345f3c42679299ba556a4d16d4847ee7f6d", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.5", + "league/flysystem": "^1.0", + "microsoft/azure-storage-blob": "^1.1", + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\AzureBlobStorage\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem-azure-blob-storage/issues", + "source": "https://github.com/thephpleague/flysystem-azure-blob-storage/tree/0.1.6" + }, + "abandoned": "azure-oss/storage-blob-flysystem", + "time": "2019-06-07T20:42:16+00:00" + }, { "name": "league/fractal", "version": "0.20.2", @@ -2124,6 +2196,165 @@ }, "time": "2022-11-09T13:18:16+00:00" }, + { + "name": "microsoft/azure-storage", + "version": "v0.10.2", + "source": { + "type": "git", + "url": "https://github.com/Azure/azure-storage-php.git", + "reference": "27de05b00c1858d6e1c6adbc489efa90e0342f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Azure/azure-storage-php/zipball/27de05b00c1858d6e1c6adbc489efa90e0342f82", + "reference": "27de05b00c1858d6e1c6adbc489efa90e0342f82", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6.0", + "php": ">=5.5.0" + }, + "require-dev": { + "mikey179/vfsstream": "~1.6", + "pdepend/pdepend": "~2.2", + "phploc/phploc": "~2.1", + "phpmd/phpmd": "@stable", + "phpunit/phpunit": "~4.0", + "sebastian/phpcpd": "~2.0", + "squizlabs/php_codesniffer": "2.*", + "theseer/phpdox": "~0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "MicrosoftAzure\\Storage\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Azure Storage PHP SDK", + "email": "dmsh@microsoft.com" + } + ], + "description": "This project provides a set of PHP client libraries that make it easy to access Microsoft Azure storage APIs.", + "keywords": [ + "azure", + "php", + "sdk", + "storage" + ], + "support": { + "issues": "https://github.com/Azure/azure-storage-php/issues", + "source": "https://github.com/Azure/azure-storage-php/tree/v0.10.2" + }, + "abandoned": "microsoft/azure-storage-blob;microsoft/azure-storage-queue;microsoft/azure-storage-table;microsoft/azure-storage-file", + "time": "2016-08-19T08:32:57+00:00" + }, + { + "name": "microsoft/azure-storage-blob", + "version": "1.5.4", + "source": { + "type": "git", + "url": "https://github.com/Azure/azure-storage-blob-php.git", + "reference": "1023ce1dbf062351a32ca5ec72ad1fd4a504f1bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Azure/azure-storage-blob-php/zipball/1023ce1dbf062351a32ca5ec72ad1fd4a504f1bf", + "reference": "1023ce1dbf062351a32ca5ec72ad1fd4a504f1bf", + "shasum": "" + }, + "require": { + "microsoft/azure-storage-common": "~1.5", + "php": ">=5.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "MicrosoftAzure\\Storage\\Blob\\": "src/Blob" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Azure Storage PHP Client Library", + "email": "dmsh@microsoft.com" + } + ], + "description": "This project provides a set of PHP client libraries that make it easy to access Microsoft Azure Storage Blob APIs.", + "keywords": [ + "azure", + "blob", + "php", + "sdk", + "storage" + ], + "support": { + "issues": "https://github.com/Azure/azure-storage-blob-php/issues", + "source": "https://github.com/Azure/azure-storage-blob-php/tree/v1.5.4" + }, + "time": "2022-09-02T02:13:06+00:00" + }, + { + "name": "microsoft/azure-storage-common", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/Azure/azure-storage-common-php.git", + "reference": "8ca7b1bf4c9ca7c663e75a02a0035b05b37196a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Azure/azure-storage-common-php/zipball/8ca7b1bf4c9ca7c663e75a02a0035b05b37196a0", + "reference": "8ca7b1bf4c9ca7c663e75a02a0035b05b37196a0", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6.0|^7.0", + "php": ">=5.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "MicrosoftAzure\\Storage\\Common\\": "src/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Azure Storage PHP Client Library", + "email": "dmsh@microsoft.com" + } + ], + "description": "This project provides a set of common code shared by Azure Storage Blob, Table, Queue and File PHP client libraries.", + "keywords": [ + "azure", + "common", + "php", + "sdk", + "storage" + ], + "support": { + "issues": "https://github.com/Azure/azure-storage-common-php/issues", + "source": "https://github.com/Azure/azure-storage-common-php/tree/v1.5.2" + }, + "time": "2021-10-09T03:03:47+00:00" + }, { "name": "monolog/monolog", "version": "2.10.0", @@ -2870,58 +3101,6 @@ }, "time": "2019-01-08T18:20:26+00:00" }, - { - "name": "psr/http-client", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client" - }, - "time": "2023-09-23T14:17:50+00:00" - }, { "name": "psr/http-factory", "version": "1.1.0", @@ -2979,16 +3158,16 @@ }, { "name": "psr/http-message", - "version": "2.0", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { @@ -2997,7 +3176,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -3012,7 +3191,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -3026,9 +3205,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/2.0" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2023-04-04T09:54:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/log", diff --git a/config/app.php b/config/app.php index e721e27..61b6381 100644 --- a/config/app.php +++ b/config/app.php @@ -164,6 +164,7 @@ Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, + App\Providers\AzureStorageServiceProvider::class, /* * Package Service Providers... @@ -231,6 +232,7 @@ 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, + ], 'cdn_alert_path' => '/v1/alerts/cap12', @@ -241,4 +243,10 @@ 'cdn_host' => env('CDN_HOST', 'https://api.preparecenter.org'), + 'bucket_name' => env('AZURE_STORAGE_ACCOUNT'), + + 'bucket_domain' => env('AZURE_STORAGE_DOMAIN'), + + 'bucket_container' => env('AZURE_STORAGE_CONTAINER'), + ]; diff --git a/config/filesystems.php b/config/filesystems.php index ec6a7ce..b9b9fd4 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -64,6 +64,14 @@ 'url' => env('AWS_URL'), ], + 'azure' => [ + 'driver' => 'azure', + 'name' => env('AZURE_STORAGE_NAME'), + 'key' => env('AZURE_STORAGE_KEY'), + 'container' => env('AZURE_STORAGE_CONTAINER'), + 'connection_string' => env('AZURE_STORAGE_CONNECTION_STRING'), + ], + ], ]; diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index a3b2240..ccda831 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -45,6 +45,7 @@ env: PUSHER_APP_CLUSTER: mt1 MIX_PUSHER_APP_KEY: "${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER: "${PUSHER_APP_CLUSTER}" + AZURE_STORAGE_DOMAIN: blob.core.windows.net secrets: dbSecretName: admin-credentials @@ -56,6 +57,10 @@ secrets: DB_USERNAME: DB_USERNAME DB_PASSWORD: DB_PASSWORD APP_KEY: APP_KEY + AZURE_STORAGE_ACCOUNT: AZURE_STORAGE_ACCOUNT + AZURE_STORAGE_KEY: AZURE_STORAGE_KEY + AZURE_STORAGE_CONTAINER: AZURE_STORAGE_CONTAINER + AZURE_STORAGE_CONNECTION_STRING: AZURE_STORAGE_CONNECTION_STRING # Ingress (if using) ingress: diff --git a/routes/api.php b/routes/api.php index f01806d..0aa9e1c 100644 --- a/routes/api.php +++ b/routes/api.php @@ -80,6 +80,9 @@ Route::post('whatnow/publish', 'WhatNowController@publishTranslationsByIds'); Route::patch('whatnow/{id}/revisions/{translationId}', 'WhatNowController@patchTranslation'); Route::delete('whatnow/{id}', 'WhatNowController@deleteById'); + + // File upload + Route::post('upload', 'FileUploadController@upload'); }); Route::get('/health', function () {