Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


This forum is in read only mode, you can no longer reply
  • Dirk De Grave 4532 posts 5977 karma points MVP 3x admin c-trib
    Mar 29, 2017 @ 11:22
    Dirk De Grave
    0

    Having multiple services in security.config, only one RemoteImageService is working fine

    hi,

    could do with some extra help getting imageprocessor to process remote images from both http and https endpoints.

    Current config so far:

    <?xml version="1.0" encoding="utf-8"?>
    <security>
      <services>
        <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />
        <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="4194304" />
            <setting key="Timeout" value="3000" />
            <setting key="Protocol" value="https" />
          </settings>
          <whitelist>
            <add url="tvnewsroom.consilium.europa.eu" />
            <!--<add url="https://newsroom.consilium.europa.eu" />-->
          </whitelist>
        </service>
        <service prefix="remote-http.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="4194304" />
            <setting key="Timeout" value="3000" />
            <setting key="Protocol" value="http" />
          </settings>
          <whitelist>
            <!--<add url="consilium.europa.eu" />-->
            <!--<add url="http://newsroom.consilium.europa.eu" />-->
            <!--<add url="http://video.consilium.europa.eu" />-->
            <add url="rackcdn.com" />
          </whitelist>
        </service>
      </services>
    </security>
    

    Some questions re: current config setup

    • Can we have two services with the same name? Or do these have to be unique? I would say yes, just after some confirmation. Basically and currently only the second one works and fetches the remote image

    • Can you have a same white listed domain in each of the services

    Example: if site A were reachable as http://site-a.com and https://site-a.com Less of an issue as for most domains, one does redirect to another, but let's assume it's not the case.

    • Do we need to specify at least one imageprocessor querystring parameter? Currently fetching a rackcdn.com image with ?width=200, but if we omit these settings, nothing happens (error at the iis level)

    Any advice on any of the topics is appreciated big time and could involve beer reward (or any other beverage you prefer)

    --Dirk

  • Dirk De Grave 4532 posts 5977 karma points MVP 3x admin c-trib
    Mar 29, 2017 @ 11:28
    Dirk De Grave
    0

    Also,

    Anyone have had ImageProcessor remote image processing working behind a proxy?

    --Dirk

  • Dirk De Grave 4532 posts 5977 karma points MVP 3x admin c-trib
    Mar 29, 2017 @ 11:36
    Dirk De Grave
    0

    Some more info... if we switch both RemoteImageService sections, it seems the last one wins!

  • James Jackson-South 488 posts 1738 karma points c-trib
    Mar 29, 2017 @ 12:21
    James Jackson-South
    100

    Hi Dirk,

    Example: if site A were reachable as http://site-a.com and https://site-a.com Less of an issue as for most domains, one does redirect to another, but let's assume it's not the case.

    Really? You should be able to use the one remote service to do both requests since http requests will redirect to https anyway. I've never seen a site that doesn't redirect.

    If you needed to use more than one you would have to create a service that inherits the remote one since only one of each type can be registered.

    Btw what version are you using? You never say.

    Cheers

    James

  • Dirk De Grave 4532 posts 5977 karma points MVP 3x admin c-trib
    Mar 29, 2017 @ 13:02
    Dirk De Grave
    0

    Hi James,

    Good remark about version, I force my team mates to always mention as much info as possible, now I'm forgetting it myself :( #slapintheface^2

    We're on

      <package id="ImageProcessor" version="2.4.5.0" targetFramework="net461" />
      <package id="ImageProcessor.Web" version="4.6.6.0" targetFramework="net461" />
      <package id="ImageProcessor.Web.Config" version="2.3.0.0" targetFramework="net461" />
    

    umb v7.5.4

    I have to go the double services route, as we'll have non https endpoints as well, think my confusion about http vs https is from the fact I couldn't get 2 services to work. I'll give your suggestion a go and provide feedback!

    Already thanks for taking the time to provide some more input!

    Beer's on the way ;-)

  • James Jackson-South 488 posts 1738 karma points c-trib
    Mar 30, 2017 @ 02:42
    James Jackson-South
    0

    Hey Dirk,

    No worries. :) Best of luck and let me know how you get on.

    Cheers

    James

    P.S bump those versions. Much improved perf in latest ones.

  • Dirk De Grave 4532 posts 5977 karma points MVP 3x admin c-trib
    Mar 30, 2017 @ 10:09
    Dirk De Grave
    0

    Hi James,

    We got it working based on your feedback, so many thanks for that!

    Upgrades > yes, we'll do, guessing it's part of v7.6 (which we want to upgrade to shortly), and if not, we'll update before final release of the website for sure (still some time left before we're there)

    So far, so good, we've got one more issue related to proxy and firewall (setup is really a black box to us), but trying to figure that one out before we start bugging the author again ;-)

    Thanks!

    --Dirk

Please Sign in or register to post replies

Write your reply to:

Draft