Giter Site home page Giter Site logo

opencart_elfinder's Introduction

elFinder- Opencart - Minio S3 - Plugin S3fs

Exemple de remplacement du FileManager Opencart standard (upload image + summernote) par Elfinder

New Features !

  • Optimisation admin/catalog ModelToolImage.php avec jpegoptim / optipng / cwebp
  • Rajout format image Webp system/library/image.php

Core

  • Opencart 3.0.3.8 standard (php:7.4-fpm-alpine / mysql:8.0)
  • Elfinder 2.1.61 standard (compatible with Opencart jQuery/UI: 2.1.1/1.11.4)
  • Testé avec Minio RELEASE.2022-05-19T18-20-59Z + montage s3fs-volume-plugin via docker plugin
  • Docker CE - version 20.10.17

Installation (hors vqmod/ocmod)

  • git clone https://github.com/picsouds/opencart_elfinder.git
  • Copier l'ensemble du répertoire upload en écrasant les fichiers
  • Donner le droit d'accès admin
        extension/module/elfinder
        extension/module/elfinderconnector
    
  • Installer les 2 extensions (activation par défaut lors de l'installation)
  • Rafraîchir le cache (cache opencart / cache navigateur)

Configuration

  • Configuration du connector elFinder dans upload/admin/controller/extension/module/elfinderconnector.php
  • Si "HTTP Basic Authentication" n'est pas utilisé via $_SERVER['PHP_AUTH_USER'], supprimer la ligne
    'attributes'	=> array( array( 'pattern'=>'/.+/', 'hidden'=>(isset($_SERVER['PHP_AUTH_USER']))? false     : true ))
    
  • Configuration du client elFinder dans admin/view/template/extension/module/elfinder.twig

Exemple configuration (docker plugin) avec play.minio.io

docker plugin install --alias s3fs mochoa/s3fs-volume-plugin --grant-all-permissions --disable
docker plugin set s3fs AWSACCESSKEYID=Q3AM3UQ867SPQQA43P2F
docker plugin set s3fs AWSSECRETACCESSKEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
docker plugin enable s3fs

Exemple docker-compose.yml

volumes:
  shared:
    driver: s3fs:latest
    driver_opts:
    s3fsopts: nonempty,allow_other,use_path_request_style,url=https://play.minio.io:9000,uid=$UID,gid=$GID
    name: "bucket_de_play.minio.io"   

Puis définir un point de montage entre le volume shared et le répertoire image opencart

php-fpm:    
  ...        
  volumes:
     - type: volume
       source: shared
       target: /var/www/opencart/upload/image/minio
    ...
nginx:
  ...
  volumes:
     - type: volume
       source: shared
       target: /var/www/opencart/upload/image/minio
  ...

Free Software, Hell Yeah!

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.