shennyg / azure-blob-remote-volume Goto Github PK
View Code? Open in Web Editor NEWThis plugin integrates Craft CMS and Microsoft Azure Storage Blob cloud storage service.
License: MIT License
This plugin integrates Craft CMS and Microsoft Azure Storage Blob cloud storage service.
License: MIT License
Hi,
There are few updates for this plugin. That doesn't have to be bad news, if it ain't broke then you don't have to fix it :)
But I was wondering if with the release of Craft 4 there will be an update on your roadmap that will also support Craft 4.
Thank you!
This error occurred when re-saving a section that has an asset field connected to an Azure Volumn
RuntimeException:
The provided account key '' is not a valid base64 string. It has to pass the check 'base64_decode(<user_account_key>, true)'. in C:\wamp64\www\gelsons\vendor\microsoft\azure-storage-common\src\Common\Internal\StorageServiceSettings.php:112
Stack trace:
#1 C:\wamp64\www\gelsons\vendor\microsoft\azure-storage-common\src\Common\Internal\ServiceSettings.php(273): MicrosoftAzure\Storage\Common\Internal\ServiceSettings::MicrosoftAzure\Storage\Common\Internal\{closure}(Array)
#2 C:\wamp64\www\gelsons\vendor\microsoft\azure-storage-common\src\Common\Internal\StorageServiceSettings.php(399): MicrosoftAzure\Storage\Common\Internal\ServiceSettings::matchedSpecification(Array, Object(Closure), Object(Closure))
#3 C:\wamp64\www\gelsons\vendor\microsoft\azure-storage-blob\src\Blob\BlobRestProxy.php(134): MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings::createFromConnectionString('DefaultEndpoint...')
#4 C:\wamp64\www\gelsons\vendor\shennyg\azure-blob-remote-volume\src\AzureVolume.php(53): MicrosoftAzure\Storage\Blob\BlobRestProxy::createBlobService('DefaultEndpoint...')
#5 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\base\FlysystemVolume.php(307): shennyg\azureblobremotevolume\AzureVolume->createAdapter()
#6 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\base\FlysystemVolume.php(319): craft\base\FlysystemVolume->adapter()
#7 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\base\FlysystemVolume.php(48): craft\base\FlysystemVolume->filesystem()
#8 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\services\Assets.php(757): craft\base\FlysystemVolume->getFileList('pages/', false)
#9 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\validators\AssetLocationValidator.php(132): craft\services\Assets->getNameReplacementInFolder('shopping.jpg', 21)
#10 C:\wamp64\www\gelsons\vendor\yiisoft\yii2\validators\Validator.php(267): craft\validators\AssetLocationValidator->validateAttribute(Object(craft\elements\Asset), 'newLocation')
#11 C:\wamp64\www\gelsons\vendor\yiisoft\yii2\base\Model.php(367): yii\validators\Validator->validateAttributes(Object(craft\elements\Asset), Array)
#12 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\services\Elements.php(412): yii\base\Model->validate()
#13 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\services\Assets.php(187): craft\services\Elements->saveElement(Object(craft\elements\Asset))
#14 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\fields\Assets.php(429): craft\services\Assets->moveAsset(Object(craft\elements\Asset), Object(craft\models\VolumeFolder))
#15 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\base\Element.php(1841): craft\fields\Assets->afterElementSave(Object(craft\elements\Entry), false)
#16 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\elements\Entry.php(1080): craft\base\Element->afterSave(false)
#17 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\services\Elements.php(498): craft\elements\Entry->afterSave(false)
#18 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\services\Sections.php(1299): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#19 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\services\Sections.php(635): craft\services\Sections->_onSaveSingle(Object(craft\models\Section), false, Array)
#20 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\controllers\SectionsController.php(186): craft\services\Sections->saveSection(Object(craft\models\Section))
#21 [internal function]: craft\controllers\SectionsController->actionSaveSection()
#22 C:\wamp64\www\gelsons\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#23 C:\wamp64\www\gelsons\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#24 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\web\Controller.php(104): yii\base\Controller->runAction('save-section', Array)
#25 C:\wamp64\www\gelsons\vendor\yiisoft\yii2\base\Module.php(528): craft\web\Controller->runAction('save-section', Array)
#26 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\web\Application.php(282): yii\base\Module->runAction('sections/save-s...', Array)
#27 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\web\Application.php(542): craft\web\Application->runAction('sections/save-s...', Array)
#28 C:\wamp64\www\gelsons\vendor\craftcms\cms\src\web\Application.php(266): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#29 C:\wamp64\www\gelsons\vendor\yiisoft\yii2\base\Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#30 C:\wamp64\www\gelsons\web\index.php(21): yii\base\Application->run()
#31 {main}
_Originally posted by @Brian-C-Noble in https://github.com/shennyg/azure-blob-remote-volume/issues/1#issuecomment-495762880_
Hi,
I am currently setting up my local development environment for Craft CMS using docker. I came across your Azure Blob Remote Volume plugin and was trying to set it up when I realized that there is currently no way for me to specify the BlobEndpoint
value in the connection string. I believe the plugin always assumes that people will only be using storage account within the Azure Portal. However, Microsoft also provides storage emulators for local development that have different connection strings / endpoints to the storage accounts in Azure Cloud.
Here are 2 different connection strings that can be used to connect to the Azure Storage Emulators provided by Microsoft:
UseDevelopmentStorage=true
The above connection string is a short-form connection string that tells the Azure Storage Client library to connect to the locally installed storage emulator using default endpoint hostnames, ports, account names and account keys. The above is actually equivalent to the long-form connection string below.
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;
As you can see, there is a BlobEndpoint
property at the end of the connection string that allows you to specify the hostname/port of the endpoint to connect to. I know that this plugin only supports the blob endpoint, so you don't need to pass in the QueueEndpoint
in the connection string above. It can just be removed. It would be great if the plugin allowed admins/devs to also supply a Blob Hostname/Port
during volume creation so that it could be used to connect to properly set up the BlobEndpoint
property in the above connection string to allow connections to the local storage emulator. Keep in mind that it is possible for developers to install the storage emulator locally to a non-standard hostname/port. There is probably no need to support the first short-form connection string above. Please note that the above account name and account key are the default, hard-coded values used by local storage emulators.
Would also be good to be able to choose an HTTP or HTTPS connection during volume creation.
The azure-storage-blob
package from Microsoft that this plugin uses already supports connecting to the local storage emulators, so hopefully it should be pretty straightforward to support it and allow the additional blob hostname and port values to be specified during volume creation.
More information about Azurite (Microsoft's cross-platform storage emulator) can be found here: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite (scroll down to the Connection Strings
section for more connection string examples)
Also, here is a link to the Azurite docker image on docker hub if you need to quickly test on your local machine: https://hub.docker.com/_/microsoft-azure-storage-azurite
Looking forward to hearing from you. Please don't hesitate to let me know if you need help testing the updates on my end.
Thank you ๐๐๐
When downloading assets from the control panel, it fails with the error message fseek(): stream does not support seeking
.
To reproduce:
This seems equivalent to the similar bug with AWS S3 plugin here: craftcms/aws-s3#100, craftcms/aws-s3#95
It would be awesome if we could use environment variables in the additional settings:
Looks like you would need to use parseEnv()
on those values: https://docs.craftcms.com/v3/extend/environmental-settings.html
Let me know if you'd like me to enter a PR
Hey getting this error when doing a fresh install.
Composer output: Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- craftcms/azure-blob is locked to version 1.0.0 and an update of this package was not requested.
- You can only install one version of a package, so only one of these can be installed: league/flysystem-azure-blob-storage[0.1.6, 1.0.0].
- shennyg/azure-blob-remote-volume 1.1.1 requires league/flysystem-azure-blob-storage ^0.1.6 -> satisfiable by league/flysystem-azure-blob-storage[0.1.6].
- craftcms/azure-blob 1.0.0 requires league/flysystem-azure-blob-storage ^1.0.0 -> satisfiable by league/flysystem-azure-blob-storage[1.0.0].
- Root composer.json requires shennyg/azure-blob-remote-volume 1.1.1 -> satisfiable by shennyg/azure-blob-remote-volume[1.1.1].
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.
Copy Stacktrace Search Stackoverflow Search Google Error
PHP Notice โ yii\base\ErrorException
Undefined index: settings
in /Users/marco/Projects/Moorage/Website/vendor/craftcms/cms/src/services/Volumes.php at line 363
354355356357358359360361362363364365366367368369370371372 $volumeRecord = $this->_getVolumeRecord($volumeUid, true);
$isNewVolume = $volumeRecord->getIsNewRecord();
$volumeRecord->name = $data['name'];
$volumeRecord->handle = $data['handle'];
$volumeRecord->type = $data['type'];
$volumeRecord->hasUrls = $data['hasUrls'];
$volumeRecord->sortOrder = $data['sortOrder'];
$volumeRecord->url = !empty($data['url']) ? $data['url'] : null;
$volumeRecord->settings = $data['settings'];
$volumeRecord->uid = $volumeUid;
if (!empty($data['fieldLayouts'])) {
// Save the field layout
$layout = FieldLayout::createFromConfig(reset($data['fieldLayouts']));
$layout->id = $volumeRecord->fieldLayoutId;
$layout->type = Asset::class;
$layout->uid = key($data['fieldLayouts']);
Craft::$app->getFields()->saveLayout($layout);
in /Users/marco/Projects/Moorage/Website/vendor/craftcms/cms/src/web/ErrorHandler.php at line 81 โ yii\base\ErrorHandler::handleError(8, 'Undefined index: settings', '/Users/marco/Projects/Moorage/We...', 363)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.