Islandora-Collaboration-Group / ISLE

Islandora Enterprise (ISLE) is a community project that addresses two of the most significant pain-points in Islandora: installation and maintenance.
https://Islandora-Collaboration-Group.github.io/ISLE/
GNU General Public License v3.0
32 stars 34 forks source link

Development needed for Cantaloupe upgrade from 4.0.3 to 4.1.5 #376

Closed g7morris closed 4 years ago

g7morris commented 4 years ago

Issue description

I started poking at a potential Cantaloupe upgrade from 4.0.3 to 4.1.5.

Additionally, I was curious if we could implement the XACML / delegates.rb fix outlined here https://groups.google.com/forum/#!msg/islandora/oW_luXn4BNE/bMerf3q_AwAJ

I was able to change the version number in the Dockerfile and got a local build running.

I changed the delegates.rb code to:

  def httpsource_resource_info(options = {})
    logger = Java::edu.illinois.library.cantaloupe.script.Logger
    require 'cgi'
    values = CGI::unescape(context['identifier']).split('~')
    if values.length != 2
      return nil
    end
    token = context['request_headers']['x-islandora-token']
    logger.info("Token #{token}.")
    pid = values[0]
    dsid = values[1]
    return { 'uri' => "http://apache/islandora/object/#{pid}/datastream/#{dsid}/view?token=#{token}"
  end

More research will be required for this fix to proceed.


Questions:

For an issue, describe steps to reproduce the issue

System setup (OS information, software versions, etc):

Steps:

  1. Edit Line 16 of the ISLE image-services Dockerfile and change the ${CANTALOUPE_VERSION:-4.0.3} to `${CANTALOUPE_VERSION:-4.1.5}
  2. Change the delegates.rb code to
    ```bash
    def httpsource_resource_info(options = {})
    logger = Java::edu.illinois.library.cantaloupe.script.Logger
    require 'cgi'
    values = CGI::unescape(context['identifier']).split('~')
    if values.length != 2
      return nil
    end
    token = context['request_headers']['x-islandora-token']
    logger.info("Token #{token}.")
    pid = values[0]
    dsid = values[1]
    return { 'uri' => "http://apache/islandora/object/#{pid}/datastream/#{dsid}/view?token=#{token}"
    end
  3. build the image and push to your docker image repo
  4. update the docker-compose.demo.yml and change the image-services image to your newly built image
  5. docker-compose up -d
  6. Run the installer script docker exec -it isle-apache-ld bash /utility-scripts/isle_drupal_build_tools/isle_islandora_installer.sh
  7. Login as the Drupal admin account and within https://isle.localdomain/admin/islandora/islandora_viewers/openseadragon click the Add token as header checkbox (changes to green when clicked) which means "Instead of sending the token as a query parameter, it will be sent in the X-ISLANDORA-TOKEN header."
  8. Change the IIF Identifier from the original value of [islandora_openseadragon:pid]~[islandora_openseadragon:dsid]~[islandora_openseadragon:token] to the new suggested value of [islandora_openseadragon:pid]~[islandora_openseadragon:dsid] and click the Save button at the bottom of the form.
  9. ingest a sample tif file and view results
What's the expected result?
What's the actual result?

Additional details / screenshots

Cantaloupe 500 error from logs

receiver is null

java.lang.NullPointerException: receiver is null
    at org.jruby.embed.jsr223.JRubyEngine.invokeMethod(JRubyEngine.java:208)
    at edu.illinois.library.cantaloupe.script.DelegateProxy.invokeUncached(DelegateProxy.java:363)
    at edu.illinois.library.cantaloupe.script.DelegateProxy.invoke(DelegateProxy.java:330)
    at edu.illinois.library.cantaloupe.script.DelegateProxy.invoke(DelegateProxy.java:315)
    at edu.illinois.library.cantaloupe.script.DelegateProxy.authorize(DelegateProxy.java:174)
    at edu.illinois.library.cantaloupe.auth.DelegateAuthorizer.authorize(DelegateAuthorizer.java:30)
    at edu.illinois.library.cantaloupe.resource.AbstractResource.authorize(AbstractResource.java:243)
    at edu.illinois.library.cantaloupe.resource.iiif.v2.InformationResource.doGET(InformationResource.java:62)
    at edu.illinois.library.cantaloupe.resource.HandlerServlet.handle(HandlerServlet.java:98)
    at edu.illinois.library.cantaloupe.resource.HandlerServlet.doGet(HandlerServlet.java:36)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:364)
    at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:170)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
g7morris commented 4 years ago

Please review the following for inclusion in ISLE release 1.5.0:

These images will need to be rebuilt with new settings: https://github.com/Islandora-Collaboration-Group/isle-apache/pull/15 https://github.com/Islandora-Collaboration-Group/isle-imageservices/pull/14

g7morris commented 4 years ago

This issue has been completed by the recent releases of 1.5.0 and 1.5.1. Closing ticket.