I just about have companion working but there is a crucial step I’m missing… Uploads from the local filesystem work fine direct to tusd.
When I upload a file from google drive, it makes it to companion scratch space, but never gets transferred to tusd.(the reference solution). The upload hangs forever, even though companion has a complete copy.
Both companion and tusd are behind NGINX reverse proxy.
Does the request to transfer the file from companion to tusd come directly from companion? If so, I am giving companion the wrong tusd address.
What I think I’m doing is to expose tusd as https://cuahsi-dev-1.hydroshare.org/upload and companion as https://cuahsi-dev-1.hydroshare.org/companion.
The problem is that – according to the JavaScript debugging console, the tusd URL that is given to companion is the same external one that is declared to the js-client. Since companion is running behind a proxy, it can’t contact tusd that way.
I think the way I have to fix this is to make it possible for companion to contact `tusd’ via the public URL even though it is behind the proxy. Is this correct?
I’m having incredible trouble convincing uppy companion, that tusd is running at a subURL https://cuahsi-dev-1.hydroshare.org/upload/... It seems to strip that off and redirects to https://cuahsi-dev-1.hydroshare.org/connect/... URL without the upload prefix.
Is there any way I can convince if to use that prefix when working through the callbacks after google drive authentication and permission?
It seems that in a lot of ways, uppy companion presumes that tusd is running at the root of the hrml hierarchy…
Does it work if you assign one subdomain for each companion and tusd? If not, does it work if you try to instead upload to Transloadit’s demo tus tusd.tusdemo.net?
We have it running the same way behind an apache reverse proxy, our main problem was our upload url wasn’t configured properly
We are still none the wiser how an uploaded file gets from companion to tusd. How does companion know the tusd endpoint?
can the tusd endpoint be explicitly set in companion?
would love some clarification
It’s complicated. Let me look at my notes. The answer is not easy. I’m putting the finishing touches on our uppy deployment so it won’t take too long, but I can’t give a definitive answer without looking back on my detailed set of discoveries. I’ll get back to you on this.
Good luck finishing your implementation. just about to look at changing the file uploaded to the original filename - have you done this?
No worries, found the answer i was looking for to my orginial question
You specify the endpoint option to the Tus plugin in the uppy client. Then Uppy will send this endpoint to Companion, and companion will upload from the provider (e.g. google drive) to that tus endpoint. Note that you will restrict the allowed urls in companion with the option “uploadUrls” / COMPANION_UPLOAD_URLS