Open cslzchen opened 6 years ago
Note: this PR cannot be tested locally since Office rendering service requires a public available file. Here is what shows up locally, and sandboxing does not cause any issue. src
is https://view.officeapps.live.com/op/embed.aspx?src=http%3A//192.168.168.167%3A7777/v1/resources/2n3gt/providers/osfstorage/5a283b61a4a094002587bea3
as expected. The error is due to the service having no access to the local file.
Here is what shows up locally when hard-coding a staging download url with with iframe sandboxing turned on. src
is empty for iframe
due to sandboxing.
Here is what shows up locally when hard-coding a staging download url with iframe sandboxing turned off. src
is "https://view.officeapps.live.com/op/embed.aspx?src=https%3A//staging-files.osf.io/v1/resources/swy3c/providers/osfstorage/5a29638421b9f2000d8f0a16"
.
Ticket
https://openscience.atlassian.net/browse/SVCS-488 OSF side PR: https://github.com/CenterForOpenScience/osf.io/pull/8002
Purpose
This ticket replaces https://github.com/CenterForOpenScience/modular-file-renderer/pull/282. Credit goes to @AddisonSchiller 🎆🎆.
.docx
rendering is very intensive on the OSF. By using Microsoft's online rendering service to render publicly available.docx
files, we can remove a lot of pressure from theunoconv
container.Changes
public_file
query param. This query param is optional.public_file=True
denotes that the file is public (the project it belongs to is public) , whilepublic_file=False
denotes that it is private. All other values forpublic_file
cause errors to be raised.ProviderMetadata
now has anis_public
flag, with default value set toFalse
.Side Effects
iframe
sandboxing may cause issue, need to verify on staging.QA Notes
The Office365 renderer does not use the
.pdf
renderer likeunoconv
used to, so the pdfs that get made by this renderer may not display exactly the same. More QA notes to come. There is also aREADME.md
in the renderer with more information about testing.Deployment Notes