Git Product home page Git Product logo

Comments (9)

ElijahGlover avatar ElijahGlover commented on August 16, 2024 1

I havent tested with 7.3.x. can you paste in your config?

from umbraco-s3-provider.

SleeperSmith avatar SleeperSmith commented on August 16, 2024

Web.config

  <location path="media">
    <system.webServer>  
      <handlers>  
        <remove name="StaticFileHandler" />  
        <add name="StaticFileHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.StaticFileHandler" />  
      </handlers>  
    </system.webServer>  
  </location>  
  <umbracoConfiguration>  
    <FileSystemProviders configSource="config\FileSystemProviders.s3.config" xdt:Transform="Replace" />  
  </umbracoConfiguration>  

FileSystemProviders.s3.config

<?xml version="1.0"?>
<FileSystemProviders>
  <Provider alias="media" type="Umbraco.Storage.S3.BucketFileSystem, Umbraco.Storage.S3">
    <Parameters>
      <!-- S3 Bucket Name - Used For Making API Requests -->
      <add key="bucketName" value="test-bucket" />
      <!-- S3 Bucket Hostname - Used For Storage In Umbraco's Database (Can be blank if using the bundled file provider) -->
      <add key="bucketHostName" value="" />
      <!-- S3 Object Key Prefix -->
      <add key="bucketKeyPrefix" value="media" />
      <!-- AWS Region Endpoint (us-east-1/us-west-1/ap-southeast-2) -->
      <add key="region" value="ap-southeast-2" />
    </Parameters>
  </Provider>
</FileSystemProviders>
    public class MvcApplication : UmbracoApplication 
    {
        private readonly ILog _logger = LogManager.GetLogger(typeof(MvcApplication));
        private BackgroundJobServer _backgroundJobServer;

        protected override void OnApplicationStarted(object sender, EventArgs e)
        {
            log4net.Config.XmlConfigurator.Configure();
            base.OnApplicationStarted(sender, e);

            var mediaPath = ConfigurationManager.AppSettings["MediaPath"];
            if (!string.IsNullOrWhiteSpace(mediaPath))
            {
                Umbraco.Storage.S3.FileSystemVirtualPathProvider.ConfigureMedia(mediaPath);
            }

            Application_Start();
            _logger.Info("Application Started");
        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            //WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            //RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AutoMapperConfig.Configure();
        }

        protected new void Application_End(object sender, EventArgs e)
        {
            if (_backgroundJobServer != null)
                _backgroundJobServer.Dispose();
            base.Application_End(sender, e);
        }

    }

from umbraco-s3-provider.

SleeperSmith avatar SleeperSmith commented on August 16, 2024

Found the problem. ImageProcessor handler just doesn't work with VPP.

Seems like Umbraco 7.2.x just pass media url straight through to the configured VPP while 7.3.x pass all media url request to the image processor with or without query string?

from umbraco-s3-provider.

SleeperSmith avatar SleeperSmith commented on August 16, 2024

@ElijahGlover , just wondering if there's a recommended approach to fix this problem? Do you plan on looking into this issue? (this seems more a problem from the Image Processor handler than the s3 provider...)

from umbraco-s3-provider.

ElijahGlover avatar ElijahGlover commented on August 16, 2024

@SleeperSmith recommended approch to resolve is to use Image Processor Remote Files feature listed in the docs. http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/ This workaround will only resolve any images you have embeded locally in html.

When I orignally created this plugin the backoffice would generate thumbnails when uploading the image. That changed early v7. I'm have not looked under the hood of the editor/media services. Please let me know if you have ideas to resolve this issue.

@James_M_South on twitter might have some ideas.

from umbraco-s3-provider.

JimBobSquarePants avatar JimBobSquarePants commented on August 16, 2024

Hi @SleeperSmith @ElijahGlover

ImageProcessor.Web should work fine with the VPP, you need to make sure that you have enabled the CloudImageService for it to intercept image requests though.

Check out the documentation at my Azure FileSystem implementation. https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure#combining-with-imageprocessor.

Set the Host property to

<setting key="Host" value="http://[YOUR_BUCKET_PUBLIC_URL]/media/"/>

And ImageProcessor.Web should correctly intercept and serve any images with the path beginning with /media/

On the note of ImageProcessor.Web capturing all image requests, if you update the installed version via Nuget it will intercept only requests with a querystring. I made intercepting all images optional as it was causing problem in some environments.

Hope that helps

James

from umbraco-s3-provider.

SleeperSmith avatar SleeperSmith commented on August 16, 2024

@JimBobSquarePants O_O Did you search for all issue on github with image processor in it repeatedly like once every few minutes or you just happen to crash the party with impeccable timing.

Anyway, much thanks, I'll give this a shot. We have servers on both AWS and Azure so this will be very handy.

from umbraco-s3-provider.

JimBobSquarePants avatar JimBobSquarePants commented on August 16, 2024

😄 Nah... @ElijahGlover grabbed me on Twitter, Supposed to be having a night off but I couldn't help myself to get involved between watching old movies and stuffing my face with M&M's.

Good luck, any issues and I'll do my best to help.

from umbraco-s3-provider.

ElijahGlover avatar ElijahGlover commented on August 16, 2024

I've documented changes required to make backoffice work with ImageProcessor, along with a bug fix released as part of 1.0.23.

from umbraco-s3-provider.

Related Issues (20)

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.