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

WOPI App Name is admin configurable, but we hardcoded it #10306

Closed
butonic opened this issue Oct 15, 2024 · 9 comments
Closed

WOPI App Name is admin configurable, but we hardcoded it #10306

butonic opened this issue Oct 15, 2024 · 9 comments
Assignees
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug

Comments

@butonic
Copy link
Member

butonic commented Oct 15, 2024

The collaboration service uses the hardcoded strings collabora and onlyoffice to identify the kind of CS3 app provider.

For the app url:

if strings.ToLower(s.config.App.Name) == "collabora" {
// collabora provides only one action per extension. usual options
// are "view" (checked above), "edit" or "view_comment" (this last one
// is exclusive of collabora)

For the language:

switch strings.ToLower(s.config.App.Name) {
case "collabora":
q.Add("lang", lang)
case "onlyoffice":
q.Add("ui", lang)

The type determines the properties returned in the GetFileInfo call:

switch strings.ToLower(f.cfg.App.Name) {
case "collabora":
info = &fileinfo.Collabora{}
case "onlyoffice":
info = &fileinfo.OnlyOffice{}
default:
info = &fileinfo.Microsoft{}
}

We noticed this when reviewing cs3org/reva#4882 (review)

All of these checks will break when the app name has been changed to eg: WebOffice.

The app Name really is a display name that is used by clients. We should introduce a product property on the cs3 api that we can use to handle product specific differences.

@butonic butonic added the Priority:p2-high Escalation, on top of current planning, release blocker label Oct 15, 2024
@butonic butonic moved this from Qualification to Prio 2 in Infinite Scale Team Board Oct 15, 2024
@butonic
Copy link
Member Author

butonic commented Oct 15, 2024

cc @micbar

@jvillafanez
Copy link
Member

#10335 should do for the most part. We still need to send the provider to reva in order to use the templates.
The easiest option might be to send it during app registration (https://github.com/owncloud/ocis/blob/master/services/collaboration/pkg/helpers/registration.go#L64C26-L71), but we'd need to change the cs3apis.

Since the names can change, we'll need to take care of weird chars. Right now, it seems that there is a problem if the App.Name contains a space (web shows the name with the space correctly):

ocis-1           | {"level":"error","service":"gateway","pkg":"rgrpc","traceid":"9d09077404f9a5d7b9439dfa75eea898","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0","from":"tcp://172.20.0.6:46954","uri":"/cs3.gateway.v1beta1.GatewayAPI/OpenInApp","start":"17/Oct/2024:09:03:32 +0000","end":"17/Oct/2024:09:03:32 +0000","time_ns":3028322,"code":"Unknown","time":"2024-10-17T09:03:32Z","message":"gateway: error calling findAppProvider: error: not found: app 'Colla%20Bora' not found"}
ocis-1           | {"level":"error","service":"frontend","pkg":"rhttp","traceid":"89ad0050261880f7a41e38115f9390c9","request-id":"ba3dcabb-95c4-46e1-943d-8a7194f64531","error":"rpc error: code = Unknown desc = gateway: error calling findAppProvider: error: not found: app 'Colla%20Bora' not found","time":"2024-10-17T09:03:32Z","message":"Error contacting the requested application, please use a different one or try again later"}
ocis-1           | {"level":"error","service":"frontend","pkg":"rhttp","traceid":"89ad0050261880f7a41e38115f9390c9","host":"127.0.0.1","method":"POST","uri":"/app/open?file_id=79788a3d-c825-4287-983e-da76f535b8a8%24744811fc-08de-468a-9caf-b25a792faa28%219f5ba531-b6ba-4aa5-93a8-64431614fce5&lang=en&app_name=Colla%2520Bora&view_mode=write","url":"/open?file_id=79788a3d-c825-4287-983e-da76f535b8a8%24744811fc-08de-468a-9caf-b25a792faa28%219f5ba531-b6ba-4aa5-93a8-64431614fce5&lang=en&app_name=Colla%2520Bora&view_mode=write","proto":"HTTP/1.1","status":500,"size":134,"start":"17/Oct/2024:09:03:32 +0000","end":"17/Oct/2024:09:03:32 +0000","time_ns":17015094,"time":"2024-10-17T09:03:32Z","message":"http"}

There could also be problems with the service names (https://github.com/owncloud/ocis/blob/master/services/collaboration/pkg/helpers/registration.go#L69 among others) if the name contains "." or weird chars. We should decide what to do with those.

Finally, this seems a breaking change for Microsoft and OnlyOffice installations (we're using Collabora as default, so they're lucky they won't be hit). If you're using OnlyOffice as app name, Collabora will be used as provider name (assuming you haven't changed it yet), so some features are expected to break. Adding the env variable and restarting the system should be enough to fix the problem though.

@micbar
Copy link
Contributor

micbar commented Oct 25, 2024

Next step: Start PR on the CS3API to add the ProductName Property on the app.

@2403905 2403905 self-assigned this Oct 31, 2024
@2403905
Copy link
Contributor

2403905 commented Oct 31, 2024

@micbar There are a lot of changes in a go-sc3 https://github.com/cs3org/go-cs3apis/compare/062c4e3046cb..d50e291
Are we still compatible?
Should we bump go-cs3api?

@2403905
Copy link
Contributor

2403905 commented Nov 4, 2024

I prepared the cs3api bump for reva cs3org/reva#4906
I don't see any braking changes cs3api.

@2403905
Copy link
Contributor

2403905 commented Nov 4, 2024

@micbar @kobergj The cs3api PR
cs3org/cs3apis#237

@micbar
Copy link
Contributor

micbar commented Nov 5, 2024

PR has been merged #10335

@wkloucek
Copy link
Contributor

wkloucek commented Nov 7, 2024

I struggle to use it: owncloud/ocis-charts#799 (comment)

@micbar
Copy link
Contributor

micbar commented Nov 7, 2024

Fixed by cs3org/reva#4918

@micbar micbar closed this as completed Nov 7, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Infinite Scale Team Board Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug
Projects
Status: Done
Development

No branches or pull requests

5 participants