Code Monkey home page Code Monkey logo

sulu-storage-bundle's Introduction

SuluStorageBundle

Build Status codecov Mutation testing badge

This unofficial bundle for Sulu CMF, provides possibility to use remote storage bundle (like AWS S3) for Sulu media files. SuluMediaBundle use Flysystem filesystem abstraction in combination with OneupFlysystemBundle.

Features

  • Use local or external service as storage for media files.
  • Possibility to use Flysystem cache adapter separately for original and format cache storage.
  • Possibility to develop own missing adapters which are supported by Flysystem.

Attention

Current version is not stable. Some errors may occur. You are using this bundle at your own risk. If you would like to report error or suggest some improvements, please send an issue on GitHub.

Note

This bundle bases on standard SuluMediaBundle and it overrides some elements of SuluMediaBundle.

Requirements

SuluMediaBundle was tested for Sulu version 1.6.x. For more information check composer.json file.

Installation

The installation description you will find here.

Supported adapters

sulu-storage-bundle's People

Contributors

pawel-brzezinski avatar mareksuscak avatar

Stargazers

Didi Abdillah Arvidev avatar Milind Singh avatar Mykhailo avatar  avatar Bartek avatar Francesco Camillini avatar Thomas Sliwa avatar

sulu-storage-bundle's Issues

S3 as main storage for images and video

config.yml:

oneup_flysystem:
    adapters:
        storage_awss3v3:
            awss3v3:
                client: storage.s3_client
                bucket: '%s3.bucket_media%'
                prefix: media
                options:
                    ACL: 'public-read'

    filesystems:
        storage_awss3v3:
            adapter: storage_awss3v3
            alias: pb_storage_awss3v3
            plugins: [ 'pb_sulu_storage.flysystem.awss3v3.content_path.plugin' ]
        media_storage:
            adapter: storage_awss3v3
            alias: custom_alias_to_media_storage
            plugins: ['pb_sulu_storage.flysystem.awss3v3.content_path.plugin']

pb_sulu_storage:
    provider: flysystem
    flysystem:
        filesystem:
            storage: pb_storage_awss3v3
            format_cache: pb_storage_awss3v3

services.yml:

    storage.s3_client:
        class: Aws\S3\S3Client
        arguments:
            - version: 'latest'
              region: 'ca-central-1'
              credentials:
                  key: '%s3.key%'
                  secret: '%s3.secret%'
              visibility: 'public'

I'm trying to move assets (image + video) from local storage to S3 storage.
Using such an config, I have assets uploaded to S3.
Images are shown fine on frontend.

To play video, I'm trying to call URL: {{ sulu_get_media_url(media) }} - it fails with error 500 as it's trying to look for asset in local storage, not S3, although storage_awss3v3 is in config (please look at the screenshot with trace, the asset url is absolute, and it's public)

image

Also, image preview is not generated from video.

Could you please put words how "video" issue can be solved for sulu 1.6? Is it necessary to store files I in local folder as well or should I override MediaStreamController?
Is it possible to build yml-config to upload everything to S3 and cache to local storage after the first request?)

ExternalUrlResolver with CachedAdapter return relative URL

AwsS3v3ExternalUrlResolver, when used with a CachedAdater, return null , then in PBFormatCache->getMediaUrl , it return the relative URL instead of external URL !

This lead to continuously ask the local URL of Sulu (uploads/media) !

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.