mozilla / policy-templates

Policy Templates for Firefox
Mozilla Public License 2.0
1.15k stars 415 forks source link

[MacOS] Policy template as a symlink? #1056

Closed jabkoo closed 10 months ago

jabkoo commented 1 year ago

I don't know how smart this is, but I was hoping I could store a policy template as one of my MacOS dotfiles I can symlink.

Unfortunately, that doesn't seem to work. Initially I thought the issue was that I wasn't storing my .plist file as a binary, but after copying non-binary version to ~/Library/Preferences it does work just fine. Apparently Firefox converts and overwrites this file to binary on startup anyway, I think.

Then I had tried symlinking binary file, but result did not change. I had also tried clearing immutable flags with chflags nouchg, but did not help.

So I wanted to ask is it even possible to get it working with a symlink somehow? Or should I ditch that idea?

mkaply commented 1 year ago

Can you give a little more detail on exactly what you're trying to do?

jabkoo commented 1 year ago

Can you give a little more detail on exactly what you're trying to do?

Sure, sorry if I my explanation was too broad.

Actually, today I've tried to test it with a hard link instead of symbolic link by using ln -fn "~/dotfiles/firefox/org.mozilla.firefox.plist" "~/Library/Preferences/org.mozilla.firefox.plist" and this way it is working correctly. Made me wonder if the issue is with Firefox not having permissions to access and/or modify the template policy in my dotfiles folder, but I've used chflags nouchg again to clear immutable flags and even gave Firefox Full Disk Access in Settings, but still not working with a symbolic link.

Let me know if I'm making sense.

If you believe it might not be possible with a symbolic link, I will be satisfied with my hard link solution.

Edit: I've also ran Firefox with browser.policies.loglevel set to debug, as described in https://support.mozilla.org/en-US/kb/debugging-policy-issues, but it is now showing any logs

mkaply commented 10 months ago

For some reason I decided to spend some time on this and I'm list :)

Putting that file in ~/Library/Preferences doesn't work for me because org.mozilla.firefox.plist is a binary plist,. not an XML plist (and the binary data gets added to the file).

Anyway, all that being said, are you ok with me just closing this as I don't think other folks will want to do this.

jabkoo commented 10 months ago

Sure, we can close that. Like I said, I'm satisfied with my solution with a hard link.

Thanks for putting some time and effort to this anyway :)