Giter Club home page Giter Club logo

craft-object-storage's People

Contributors

alexpestell avatar frank-laemmer avatar howells avatar ostark avatar pheeque1 avatar roelvanhintum avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

craft-object-storage's Issues

Download Asset in Craft CMS Control Panel

Hello,

When seeking to download a file stored in object storage via the craftCMS cp asset download button, it attempts to use the Base URL of the site instead of the object storage Base URL. Is this an issue with FortRabbit or CraftCMS?

Screen Shot 2020-12-08 at 4 12 24 PM

Config Changes for Craft 3.5 to avoid Deprecation Error

Hi there,

Installing Craft 3.5.8 with Object Storage 1.10 reveals this deprecation error:

Support for overriding volume configs in config/volumes.php has been deprecated. Environment variables or dependency injection should be used instead.

volumes.php looks like this for me:

<?php
$objectStorageAccess = [
    'url'      => "https://" . getenv('OBJECT_STORAGE_HOST'),
    'endpoint' => "https://" . getenv('OBJECT_STORAGE_SERVER'),
    'keyId'    => '$OBJECT_STORAGE_KEY',
    'secret'   => '$OBJECT_STORAGE_SECRET',
    'bucket'   => getenv('OBJECT_STORAGE_BUCKET'),
    'region'   => getenv('OBJECT_STORAGE_REGION'),
];

return [
    // Default volume
    'objectStorageAssets' => array_merge($objectStorageAccess, [
        'name'      => 'Site Images',
        'subfolder' => 'site_images',
    ]),
    'objectStorageAssets2' => array_merge($objectStorageAccess, [
        'name'      => 'Banner Images',
        'subfolder' => 'banner_images',
    ]),
    'objectStorageAssets3' => array_merge($objectStorageAccess, [
        'name'      => 'Profile Pictures',
        'subfolder' => 'profile_pictures',
    ]),
];

Does the volumes config file need to be changed to be compatible with future versions of Craft?

Could not open create the stream for "[image file]"

I have various volumes setup with fortrabbit Object Storage Volume, which has worked fine for a number of years; however, recently I have been seeing the error Could not open create the stream for "[image file]", in my local environment:
Screenshot 2021-12-16 at 11 50 22

When I access the image (any image) in the Assets CP I can see a broken link image but when I 'Preview' or download the image I can see the image itself:

Screenshot 2021-12-16 at 11 49 05

This prevents me from viewing the frontend of the site until I remove the images from that entry.

The issue isn't present on the production site, which uses the same object storage; however, it has started to happen on the staging site, which is also hosted on Fortrabbit and again uses the same object storage.

Is this error related to the fortrabbit Object Storage Volume plugin/setup

Thanks

Cannot install on Craft 3.6.5.1 โ€“ bump down `require`?

I'm not able to install craft-object-storage 2.0.0 on Craft 3.6.5.1 via the Craft web UI. I'm hosting Craft in a Docker container and don't have access to a shell on the server. Even if I did, I don't think shell access should be required for this.

The error stems from craft-object-storage's requirement for PHP 7.3+, and Craft 3.x's "platform": { "php": "7.2.5" } setting. This has been changed in Craft 4.x, so presumably the plugin would install, but I don't want to use a pre-release version of Craft. Shell access would allow me to run Composer manually with the --ignore-platform-reqs argument, but this isn't an option.

Does craft-object-storage actually depend on PHP 7.3+? Can this require version be bumped down, or is this Craft's problem?

Craft 4.0 support

Thanks for the awesome plugin! Can you add/prepare craft 4.0 support?

Field Layout is dropped when Installing

Hello!

When installing the v1.0.3.1 of fortrabbit Object Storage Volume on Craft 3.3.17, the Asset volumes convert from "Amazon S3" to "fortrabbit Object Storage" as expected, but the field layout options get reset. The data still exists, so I'm wondering if this could be reconnected during the afterInstall event within the plugin.

Thanks for your consideration!

Volume settings stored as plain text (in DB and Project Config)

Description

When setting up volumes, their settings (including passwords/secrets) get stored as plain text in the DB as well as in the Project Config YAML file (a new feature in Craft 3.1) although I am using the .ENV vars in volumes.php. I guess this is related or similar to this issue here: craftcms/cms#3531

Is there any chance that the plugin will provide environment variable support soon?

Additional info

  • PHP version: 7.2
  • Craft version: 3.1.5

Indexing asset files are limited to the first 1000

I uploaded ~4000 files to fortrabbit object storage using a GUI client.

I attempted to run php craft index-assets/one volumeHandle to create ~4000 asset records - it stopped at 1000.

I attempted to run php craft index-assets/one volumeHandle 1001 to start at the next record (poor mans pagination) and it started with the same list of files. Same results starting at image 3000. It seems only the first 1000 images are returned no matter what.

Cannot install plugin on version 3.0.3.1

I'm trying to install the plugin on a fresh copy of Craft v3.0.3.1, I've followed the steps listed on the README file but it throws this error:

Return value of fortrabbit\ObjectStorage\Plugin::registerRoutes() must be an instance of fortrabbit\ObjectStorage\void, none returned

I thought maybe the issue was the lack of object storage configuration on the env file but no luck, I remember having issues with the Craft 2 version of this plugin when trying to configure an Object Storage for the US region.

Here's the complete stack:

TypeError: Return value of fortrabbit\ObjectStorage\Plugin::registerRoutes() must be an instance of fortrabbit\ObjectStorage\void, none returned in /var/www/vendor/fortrabbit/craft-object-storage/src/Plugin.php:122
Stack trace:
#0 /var/www/vendor/fortrabbit/craft-object-storage/src/Plugin.php(50): fortrabbit\ObjectStorage\Plugin->registerRoutes()
#1 /var/www/vendor/yiisoft/yii2/base/BaseObject.php(109): fortrabbit\ObjectStorage\Plugin->init()
#2 /var/www/vendor/yiisoft/yii2/base/Module.php(158): yii\base\BaseObject->__construct(Array)
#3 /var/www/vendor/craftcms/cms/src/base/Plugin.php(87): yii\base\Module->__construct('fortrabbit-obje...', Object(craft\web\Application), Array)
#4 [internal function]: craft\base\Plugin->__construct('fortrabbit-obje...', Object(craft\web\Application), Array)
#5 /var/www/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#6 /var/www/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('fortrabbit\\Obje...', Array, Array)
#7 /var/www/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('fortrabbit\\Obje...', Array, Array)
#8 /var/www/vendor/craftcms/cms/src/services/Plugins.php(777): yii\BaseYii::createObject(Array, Array)
#9 /var/www/vendor/craftcms/cms/src/services/Plugins.php(443): craft\services\Plugins->createPlugin('fortrabbit-obje...')
#10 /var/www/vendor/craftcms/cms/src/controllers/PluginsController.php(48): craft\services\Plugins->installPlugin('fortrabbit-obje...')
#11 [internal function]: craft\controllers\PluginsController->actionInstallPlugin()
#12 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#13 /var/www/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#14 /var/www/vendor/craftcms/cms/src/web/Controller.php(76): yii\base\Controller->runAction('install-plugin', Array)
#15 /var/www/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('install-plugin', Array)
#16 /var/www/vendor/craftcms/cms/src/web/Application.php(267): yii\base\Module->runAction('plugins/install...', Array)
#17 /var/www/vendor/craftcms/cms/src/web/Application.php(515): craft\web\Application->runAction('plugins/install...', Array)
#18 /var/www/vendor/craftcms/cms/src/web/Application.php(251): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#19 /var/www/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#20 /var/www/web/index.php(21): yii\base\Application->run()
#21 {main}

Unable to "Sync config file with settings" when specifying type in volumes.php

Because I use file system for storage assets locally, and fortrabbit object storage in production, my volumes.php config is as follows:

<?php
$objectStorageAccess = [
    'url' => "https://" . getenv('OBJECT_STORAGE_HOST'),
    'endpoint' => "https://" . getenv('OBJECT_STORAGE_SERVER'),
    'keyId' => '$OBJECT_STORAGE_KEY',
    'secret' => '$OBJECT_STORAGE_SECRET',
    'bucket' => getenv('OBJECT_STORAGE_BUCKET'),
    'region' => getenv('OBJECT_STORAGE_REGION'),
];

return [

    '*' => [

    ],

    'dev' => [
        'images' => [
            'name' => 'Images',
            'handle' => "images",
            "type" => 'craft\volumes\Local',
            "url" => "@web/images",
            "settings" => [
                "path" => "@webroot/images",
            ],
            "hasUrls" => true,
        ],

        'files' => [
            'name' => 'Files',
            'handle' => "files",
            "type" => 'craft\volumes\Local',
            "url" => "@web/files",
            "settings" => [
                "path" => "@webroot/files",
            ],
            "hasUrls" => true,
        ],

    ],

    'production' => [
        'images' => array_merge($objectStorageAccess, [
            'type' => "fortrabbit\ObjectStorage\Volume",
            'name' => 'Images',
            'handle' => "images",
            'subfolder' => 'production/images',
        ]),

        'files' => array_merge($objectStorageAccess, [
            'type' => "fortrabbit\ObjectStorage\Volume",
            'name' => 'Files',
            'handle' => "files",
            'subfolder' => 'production/files',
        ]),

    ],

];

However, when I select "Sync config file with settings" I get the error Setting unknown property: fortrabbit\ObjectStorage\Volume::type

Dynamic subfolders

I'd like to organize assets depending on an entry. For instance, I have a channel called "Locations" and i'd like each of them to have a subfolder in /locations

assets/uploads/locations/san-diego
assets/uploads/locations/san-francisco

etc

is this possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.