owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.41k stars 184 forks source link

fix: copy app name if product name isn't provided #10490

Closed jvillafanez closed 2 weeks ago

jvillafanez commented 2 weeks ago

Description

This is mostly to help with the upgrade from OCIS 6 to 7. The COLLABORATION_APP_PRODUCT is new in OCIS 7 and is needed in order to identify the target product (Collabora, OnlyOffice) and distinguish it from the app name, which could be a brand (CoolBox3, PrivateOffice, etc)

In OCIS 6, the COLLABORATION_APP_NAME acted as product name, so it was mostly limited to "Collabora", "OnlyOffice" and "Microsoft" values, but this won't be the case any longer.

The problem comes during the upgrade, where the product name might not be filled yet. This means that an "OnlyOffice" product (set in COLLABORATION_APP_NAME) might be mistakenly consider as a "Collabora" product (the default). This mistake could cause issues: so far we've detected that the "OnlyOffice" editor would open in view-only mode despite the user having enough permissions.

In order to make things easier, if the product name is not filled, the app name will be copied over.

After the upgrade from 6 to 7, it is expected that, if there is a change in the COLLABORATION_APP_NAME, the COLLABORATION_APP_PRODUCT should be filled and / or adjusted.

Related Issue

Related to https://github.com/owncloud/ocis/issues/10479

Motivation and Context

Less friction with the upgrade.

How Has This Been Tested?

Manually tested by removing the COLLABORATION_APP_PRODUCT env variable. The OnlyOffice installation (with "OnlyOffice" as COLLABORATION_APP_NAME) can edit the files.

Screenshots (if appropriate):

Types of changes

Checklist:

update-docs[bot] commented 2 weeks ago

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.

micbar commented 2 weeks ago

@jvillafanez Can you add this PR URL to the changelog from the last PR please?

Other than that, good solution.

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud