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

Add Uppy Companion to wopi example #6702

Merged
merged 2 commits into from
Feb 6, 2024
Merged

Add Uppy Companion to wopi example #6702

merged 2 commits into from
Feb 6, 2024

Conversation

dschmidt
Copy link
Member

@dschmidt dschmidt commented Jul 3, 2023

Description

Add Uppy Companion to wopi example, so cloud imports work as soon as the importer app is shipped with oC Web.

Related Issue

Motivation and Context

Cloud imports need the Uppy Companion microservice.

How Has This Been Tested?

Tested locally with my own build of oC Web.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@dschmidt dschmidt requested review from micbar and wkloucek July 3, 2023 16:50
@update-docs
Copy link

update-docs bot commented Jul 3, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Comment on lines 60 to 66
COMPANION_DOMAIN=
COMPANION_ONEDRIVE_KEY=
COMPANION_ONEDRIVE_SECRET=
Copy link
Contributor

@wkloucek wkloucek Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would this look like for the continuous deployments? How is ist related to WOPI / Office integration in oCIS?

To me it feels like this needs a dedicated example, which probably has no continuous deployment because of the missing secret management for our continuous deployments

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked @micbar and he wanted me to add it to the wopi example, so it's "full featured".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But will it work when COMPANION_ONEDRIVE_SECRET and COMPANION_ONEDRIVE_KEY is unset?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, OneDrive integration obviously won't ... but e.g. https://uppy.io/docs/url/ would

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh ok, would be nice to add this as comments to the parameters. I didn't know and thought it's needed to make it work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... we most likely will need to add a setting to enable certain integrations in the ui, but the way the import is configured is about to change anyway, so it's probably not worth adding it now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm yeah, well - I thought that was kinda self explanatory, no other variables in .env have that kind of comment although they are empty and everything works

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i enabled only "Public Link".

@tbsbdr
Copy link

tbsbdr commented Jul 24, 2023

@micbar I'd like to reference the wopi deployment example in the releasenotes, but would not drive documentation further for this feature. ok for you?

@micbar
Copy link
Contributor

micbar commented Jul 24, 2023

I am still not decided if we should deploy it in the continouus deployments at all.

It was a big effort doing it for the example deployment.

@dschmidt
Copy link
Member Author

We could also just deploy the public link provider...

@mmattel
Copy link
Contributor

mmattel commented Aug 7, 2023

@micbar SonarCloud seems to be "unwilling" to continue, not only here. I tried before with a rebase and it "hung". I think the important two are green...

@micbar
Copy link
Contributor

micbar commented Aug 7, 2023

Example is incomplete. Not sufficient. We need to check what we can do with the config file templating.

@nicholas-wilson-au
Copy link

This is highlighted in our release notes https://doc.owncloud.com/docs/next/ocis_release_notes.html and is still open. We should remove this from the release notes if there is no way for our customers to use this feature.

@marciofeld
Copy link

I tried to deploy the Upload Companion in my test environment, but nothing changed on the Web Interface. I'm pretty sure I made everything correct.

Is that working with v4.0.0+?

@dschmidt
Copy link
Member Author

I tried to deploy the Upload Companion in my test environment, but nothing changed on the Web Interface. I'm pretty sure I made everything correct.

Is that working with v4.0.0+?

I'm sorry, this PR was probably misleading. We changed the way the importer is configured after this PR was sent and then noone made a decision how to progress here, so it got stale and outdated.
In the long run the env var might do the right thing again, until then you need to provide your own config.json - and have a companionUrl setting there.

{
...
  "external_apps": [
    {
      "id": "importer",
      "path": "web-app-importer",
      "config": {
        "companionUrl": "https://your.companion.url/",
        "webdavCloudType": "owncloud"
      }
    }
  ]
...
}

@mmattel
Copy link
Contributor

mmattel commented Oct 19, 2023

@dschmidt can you fix that PR so it can be merged and the example becomes available?

@dschmidt
Copy link
Member Author

I can, but I need a decision we actually want that.

Quoting @micbar :

I am still not decided if we should deploy it in the continouus deployments at all.

@mmattel
Copy link
Contributor

mmattel commented Oct 19, 2023

This is somehow rediculous.
On the one hand we add it to the changelog
Then we provide a PR making it avaiable, but the PR is somehow not complete
A user asks about a working example
We provide that here
And then we discuss about making the PR complete for deployment
I dont get that ...?

@micbar
Copy link
Contributor

micbar commented Oct 19, 2023

@mmattel Like i said there is a technical blocker.

@marciofeld
Copy link

I tried to deploy the Upload Companion in my test environment, but nothing changed on the Web Interface. I'm pretty sure I made everything correct.
Is that working with v4.0.0+?

I'm sorry, this PR was probably misleading. We changed the way the importer is configured after this PR was sent and then noone made a decision how to progress here, so it got stale and outdated. In the long run the env var might do the right thing again, until then you need to provide your own config.json - and have a companionUrl setting there.

{
...
  "external_apps": [
    {
      "id": "importer",
      "path": "web-app-importer",
      "config": {
        "companionUrl": "https://your.companion.url/",
        "webdavCloudType": "owncloud"
      }
    }
  ]
...
}

Thanks @dschmidt !
Could you let me know the path of this config.json file?

@dschmidt
Copy link
Member Author

In the Web dev setup we do it like this:

https://github.com/owncloud/web/blob/b7f1c5dd5ddd7faa62e1fddbb8ae18e67093d011/docker-compose.yml#L16
https://github.com/owncloud/web/blob/b7f1c5dd5ddd7faa62e1fddbb8ae18e67093d011/docker-compose.yml#L69

so basically you need to mount it to your container and use the WEB_UI_CONFIG_FILE env var to point oCIS to it
I would recommend to download your config.json from https://your.ocis.url/config.json, then add the section I pasted above and then mount it to your container...

I'm sorry this is so hard right now...

@marciofeld
Copy link

Thanks @dschmidt ! I successfully managed to deploy the Cloud Import Feature.

I have an OwnCloud v10 remote instance and I tried to import files using a generated Public URL from it, but it didn't work.
I tried with and without Password, but in both cases it returned a error message Connection with Companion failed, as you can see in the screenshot below:

image

Please find the latest Companion container log lines below:

::ffff:172.31.11.165 - - [19/Oct/2023:21:33:41 +0000] "OPTIONS /webdavPublicLink/list/?publicLinkURL=<PUBLIC_URL_HIDDEN> HTTP/1.1" 204 0 "<INFINITESCALE_URL_HIDDEN>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
companion: 2023-10-19T21:33:42.110Z [info] companion.client.version uppy client version @uppy/companion-client=3.2.0
companion: 2023-10-19T21:33:42.111Z [warn] 8e508542-6949-4229-bf2d-e291d49d5e16 provider.middleware.invalid invalid provider options detected. Provider will not be loaded
::ffff:172.31.11.165 - - [19/Oct/2023:21:33:42 +0000] "GET /webdavPublicLink/list/?publicLinkURL=<PUBLIC_URL_HIDDEN> HTTP/1.1" 400 11 "<INFINITESCALE_URL_HIDDEN>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"

@dschmidt
Copy link
Member Author

Thanks @dschmidt ! I successfully managed to deploy the Cloud Import Feature.

Cool, good to hear!

Please find the latest Companion container log lines below:

::ffff:172.31.11.165 - - [19/Oct/2023:21:33:41 +0000] "OPTIONS /webdavPublicLink/list/?publicLinkURL=<PUBLIC_URL_HIDDEN> HTTP/1.1" 204 0 "<INFINITESCALE_URL_HIDDEN>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
companion: 2023-10-19T21:33:42.110Z [info] companion.client.version uppy client version @uppy/companion-client=3.2.0
companion: 2023-10-19T21:33:42.111Z [warn] 8e508542-6949-4229-bf2d-e291d49d5e16 provider.middleware.invalid invalid provider options detected. Provider will not be loaded
::ffff:172.31.11.165 - - [19/Oct/2023:21:33:42 +0000] "GET /webdavPublicLink/list/?publicLinkURL=<PUBLIC_URL_HIDDEN> HTTP/1.1" 400 11 "<INFINITESCALE_URL_HIDDEN>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"

The error message comes from here: https://github.com/owncloud/uppy/blob/f3ce884e43d6dd8732a0cafb8d32ee8ba9a12d9b/packages/%40uppy/companion/src/server/provider/index.js#L118 -> https://github.com/owncloud/uppy/blob/f3ce884e43d6dd8732a0cafb8d32ee8ba9a12d9b/packages/%40uppy/companion/src/server/provider/index.js#L25

So apparently you don't seem to have server.host and server.protocol configured. See Companion documentation here: https://uppy.io/docs/companion/#server

@marciofeld
Copy link

Thanks again @dschmidt !
I've been reading all the Uppy Companion docs and also all the OCIS docker-compose examples.

I'm still in doubt about how to solve this last error since I would like to import data from OwnCloud v10 to Infinite Scale v4, where my OwnCloud relies on EBS Volumes to store data while my Infinite Scale relies on S3 Buckets.

On Companion docs, there are environment variables available for these services: BOX, DROPBOX, FACEBOOK, GOOGLE DRIVE, INSTAGRAM, ONEDRIVE and ZOOM. I don't have any option to insert an API Key for External URL, which is the option I might use to import files from the external OwnCloud instance.

How could I proceed? Or in this case, Uppy Companion won't be able to help me importing data from OwnCloud?

@micbar
Copy link
Contributor

micbar commented Oct 21, 2023

We added a feature to uppy companion where you can import from an ownCloud 10 public link. It is not yet upstream.

Isn't it @dschmidt ?

@dschmidt
Copy link
Member Author

We added a feature to uppy companion where you can import from an ownCloud 10 public link. It is not yet upstream.

Isn't it @dschmidt ?

Correct, upstream is working on it. I think they haven't decided whether they want to integrate it fully into their product, but they are working on providing the necessary apis at least.

transloadit/uppy#4621

@micbar micbar self-assigned this Dec 11, 2023
@micbar
Copy link
Contributor

micbar commented Dec 11, 2023

Note to myself: Maybe change the ocis config to make it configurable via ENV

@micbar micbar force-pushed the uppy-companion branch 2 times, most recently from 6a994fc to f0c7983 Compare February 1, 2024 11:53
Copy link

sonarqubecloud bot commented Feb 1, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@micbar micbar requested a review from wkloucek February 1, 2024 14:46
@micbar
Copy link
Contributor

micbar commented Feb 1, 2024

@wkloucek @rhafer @dschmidt The three different web config files are not so nice.

Will be improved by #8339

Copy link
Contributor

@dragonchaser dragonchaser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@micbar micbar merged commit d3d4d59 into master Feb 6, 2024
2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the uppy-companion branch February 6, 2024 14:44
ownclouders pushed a commit that referenced this pull request Feb 6, 2024
Add Uppy Companion to wopi example
@dschmidt
Copy link
Member Author

dschmidt commented Feb 6, 2024

🎉

Thanks for taking this over the finish line

ownclouders pushed a commit that referenced this pull request Feb 7, 2024
Add Uppy Companion to wopi example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants