Bug 139233 - macOS : no (not-ugly) way to set global config
Summary: macOS : no (not-ugly) way to set global config
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: x86-64 (AMD64) macOS (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: macOS-UI-polish
  Show dependency treegraph
 
Reported: 2020-12-25 19:06 UTC by François
Modified: 2022-09-04 02:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description François 2020-12-25 19:06:39 UTC
Description:
I'm trying to deploy some settings (like "do not check updates online") for the users of a company.

The only way I got it working is by putting some config excerpt in /Applications/LibreOffice.app/Contents/Resources/registry directory which is really ugly (it will be overridden every time LO is updated).

I would expect LO to look in /Library/Application Support/LibreOffice/registry, for example.

Notice that putting the very same file in the user profile doesn't work either.

Actual Results:
LO only consider overriding config files if they are stored in LibreOffice.app. (at least for online update).

Expected Results:
Respect (mac)OS paths and conventions.


Reproducible: Always


User Profile Reset: No



Additional Info:
Using LO 7.0.3.1 under macOS 11.1.
Comment 1 Roman Kuznetsov 2020-12-26 22:42:40 UTC
Tor, what do you think about it?
Comment 2 How can I remove my account? 2020-12-26 23:19:50 UTC
Well, adding or editing files inside the app bundle is definitely wrong. If that works, it means that the OS apparently doesn't check the integrity of an app bundle as well as it should. I would expect and hope that doing modifications inside the app bundle would break its digital signature.

Anyway, I am not sure why this would be a macOS-only enhancement request. Can the required functionality not be achieved on other platforms either by just editing files in the user profile? Ah, but I see, is the problem, that you want to do it for all users, perhaps for once who haven't necessarily even run LibreOffice yet on a machine, not just yourself? It is quite possible that there is no sane way to do that on any platform. (Where with "sane" I mean having some place outside the app installation ("app bundle" on macOS) for such modifications.)
Comment 3 Jan-Marek Glogowski 2020-12-27 20:27:36 UTC
Just FYI: LO configuration is normally deployed using an extension, like in https://wiki.documentfoundation.org/File:LibreOffice_config_extension_writing.pdf

Now AFAIK "unopkg --shared" extension deployment is broken on MacOS and you normally have to re-register shared extensions after update, so it's a bit inconvenient that way, but Munich / LiMux used it for years for deployment, so at least it's proven on Linux and Windows.
Comment 4 Alex Thurgood 2020-12-28 09:35:15 UTC
Confirming, but unfortunately to be expected in view of the way we currently inegrate Apple's notarisation process of the app bundle into the release of LO.

This is a similar problem to the one we have for lang packs, which modify the in-bundle notarisation and cause the OS to flag it as unsafe.
Comment 5 François 2020-12-29 11:23:32 UTC
(In reply to Tor Lillqvist from comment #2)
> Well, adding or editing files inside the app bundle is definitely wrong. If
> that works, it means that the OS apparently doesn't check the integrity of
> an app bundle as well as it should. I would expect and hope that doing
> modifications inside the app bundle would break its digital signature.

Of course it does. You have to bypass it.

 
> Anyway, I am not sure why this would be a macOS-only enhancement request.
> Can the required functionality not be achieved on other platforms either by
> just editing files in the user profile?

I tried several things (like putting the file in `$LO_USER_PROFILE/registry/`) but couldn't get it working. The documentation also doesn't give any hint about where to put things (which is probably another issue worth a bug report).


> Ah, but I see, is the problem, that
> you want to do it for all users, perhaps for once who haven't necessarily
> even run LibreOffice yet on a machine, not just yourself? It is quite
> possible that there is no sane way to do that on any platform. (Where with
> "sane" I mean having some place outside the app installation ("app bundle"
> on macOS) for such modifications.)

Not sure what you mean here, but we have :

  - For Linux : Freedesktop's XDG Base Directory Specification https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html. AFAIK, almost all programming languages and GUI frameworks (QT, GTK...) provide APIs or libraries to deal with this. Also, `$XDG_CONFIG_DIRS` is supposed to have a `/etc/<whatever>` config dir which is common to all users.

  - For macOS : two main APIs are provided : `CFPreferences` and `NSUserDefaults`. "All users" settings generally go in `/Library/Preferences` while specific user settings generally go in `/Users/<user>/Library/Preferences`. Data used by the app are now stored in `/Users/<user>/Containers/<app_bundle_id>/`.
  
  - For Windows : I think apps are supposed to use the `%ALLUSERSPROFILE%` for settings common to all users and `%APPDATA%` for specific user settings.

So yes, there are definitely sane places outside the app bundle for such modifications :)

It would be a real improvement if LibreOffice could conform to the different OSes specifications.
Comment 6 How can I remove my account? 2020-12-29 11:45:26 UTC
Great, so we are just waiting for your patches then.
Comment 7 François 2020-12-29 15:20:44 UTC
(In reply to Tor Lillqvist from comment #6)
> Great, so we are just waiting for your patches then.

🙄🤷‍♂️