Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for using HttpResolver #5

Merged
merged 2 commits into from
Aug 15, 2018
Merged

Conversation

dannylamb
Copy link
Contributor

GitHub Issue: Part of Islandora/documentation#769

What does this Pull Request do?

Updates the file information service to return the full http path (e.g. everything after the base url) instead of a file path. With the Flysystem and Cantaloupe config changes in place, this lets you proxy all your images no matter where they live (public, private, fedora, etc...) through Cantaloupe and display them with openseadragon.

How should this be tested?

Test as part of Islandora/documentation#92

Interested parties

@Islandora-CLAW/committers

@whikloj
Copy link
Member

whikloj commented Jul 13, 2018

I may be reading this wrong but this seems to still pass a file path on the local server, do we not want to pass the full URI to cantaloupe? In case the cantaloupe server is somewhere else.

@dannylamb
Copy link
Contributor Author

dannylamb commented Aug 1, 2018

@whikloj My understanding of the flow is:

  • We pass a relative path to the file.
  • The viewer makes the request to Cantaloupe using what is set in admin/config/media/openseadragon.
  • The full URL is constructed by Cantaloupe using the value of HttpResolver.BasicLookupStrategy.url_prefix in its properties file (which is set to Drupal's root in Flysystem Install Islandora-Devops/islandora-playbook#72).

In theory that should work in a multi-server setup, though I haven't set up an experiment to confirm.

@dannylamb
Copy link
Contributor Author

Also, looks like I need to patch up some tests here and bump us up to 7.1+

@dannylamb
Copy link
Contributor Author

@whikloj Ok, I think I see what you were saying. What I had worked because of dumb luck, and it was trying to break off the relative path twice. Once from me looking for http, and once from you looking for something from the root filesystem.

I am now returning the full path as 'full_path' and updated the logic in the .module file to try and break off the base url. I also touched up the tests.

@whikloj
Copy link
Member

whikloj commented Aug 7, 2018

Looking in here it still seems like if you have https://repo.islandora.org as your CLAW site and https://cantaloupe.islandora.org as your Cantaloupe server, when you view an image Cantaloupe is handed the file path to the image on https://repo.islandora.org disk rather than a URL to access the image at... or I could be slow on the uptake.

If I am right, then it could be a separate issue to resolve. I just don't want to lose it.

@dannylamb
Copy link
Contributor Author

No filepaths are used. The FileInformation service returns https://repo.islandora.org/some/image as the 'full_path' entry in an array. Then in the .module that gets transformed to http://cantaloupe.islandora.org/iiif2/some%2Fimage and passed to OpenSeadragon.

@whikloj whikloj merged commit 235db99 into Islandora:8.x-1.x Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants