Closed Bug 1700279 Opened 5 years ago Closed 5 years ago

ExtensionSettings policy fails json validation

Categories

(Thunderbird :: General, defect)

defect

Tracking

(thunderbird_esr78+ fixed, thunderbird88 wontfix)

RESOLVED FIXED
89 Branch
Tracking Status
thunderbird_esr78 + fixed
thunderbird88 --- wontfix

People

(Reporter: luca, Assigned: john)

References

Details

Attachments

(3 files, 2 obsolete files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0

Steps to reproduce:

I added the following snippet to HKLM\Software\Policies\Thunderbird\ExtensionSettings:

{
"uBlock0@raymondhill.net": {
"installation_mode": "force_installed",
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
}
}

Actual results:

The error console shows the errors
JsonSchemaValidator.jsm: Object expected but not received JsonSchemaValidator.jsm:303
Enterprise Policies: Invalid parameters specified for ExtensionSettings. EnterprisePolicies.js:161

Expected results:

The extension should have been installed as per the specified policy.
No matter what I put in HKLM\Software\Policies\Thunderbird\ExtensionSettings I always get the same error.
The same snippet works with firefox.

Component: Untriaged → General

See https://github.com/drlellinger/thunderbird-policies for policy templates and registry keys.

Thunderbird policy keys is different then Firefox

Adding Install value had worked in Thunderbird 78.7.1
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Thunderbird\Extensions\Install /v 2 /t REG_SZ /d "https://addons.thunderbird.net/thunderbird/downloads/latest/lookout-fix-version/addon-711780-latest.xpi" /f

For an invalid policy the error message is different (I don't remember exactly), so I gather that ExtensionSettings is valid.
In fact the table in the link you posted mentions ExtensionSettings.
It also seems that Extensions is going to be deprecated, I don't want to be redoing everything again when that happens (I had everything working with sideloaded extensions, sadly that option has been removed in thunderbird 78).

It also seems that Extensions is going to be deprecated

Do you have a source for that? Because we were going to suggest to use this, which worked for me:

{
  "policies": {
    "Extensions": {
      "Install": ["https://addons.thunderbird.net/thunderbird/downloads/latest/tbsync/addon-773590-latest.xpi"],
      "Locked":  ["tbsync@jobisoft.de"]
    }
  }
}

I used TbSync in this example, but it also worked with other add-ons.

Do you have a source for that?

https://github.com/mozilla/policy-templates#extensions

"While this policy is not technically deprecated, it is recommended that you use the ExtensionSettings policy. It has the same functionality and adds more. It does not support native paths, though, so you'll have to use file:/// URLs."

So, while the text says that it's not deprecated, I read it as "we will deprecate it when you least expect it".

Besides, I also read it as "ExtensionSettings is the new! improved! method that everybody should use (until we change idea again, that is)."

It seems that https://github.com/mozilla/policy-templates#extensions is in templates for Firefox.

Is any new link for Thunderbird 78 templates downloads

I do not know how often these get updated, but we have this:
https://github.com/thundernest/policy-templates

Which is not identical to the one linked in Comment 1. One difference is the missing "ExtensionSettings" key, which I was not able to get working at all in TB78.

Assignee: nobody → john

One difference is the missing "ExtensionSettings" key, which I was not able to get working at all in TB78.

And the reason for this is: It is almost not implemented. It was ported from Firefox two years ago and never received an update. We currently support only this:
https://searchfox.org/comm-central/source/mail/components/enterprisepolicies/schemas/policies-schema.json#261-273

This patch gets us back on track.

Attached image Why.PNG

This patch also introduces a new link (behind Why? in the picture), which we need to create:
https://support.thunderbird.net/thunderbird/88.0a1/WINNT/en-US/cant-remove-addon

See Also: → 1701573
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/43c63923dbc5
Add support for ExtensionSettings enterprise policy. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

We are close to release of next ESR. Is it worth backporting this patch to 78?

Seems this broke comm/mail/components/enterprisepolicies/tests/browser/browser_policy_extensionsettings.js except for on linux.

Depends on: 1702778

Fixed in bug 1702778.

(In reply to John Bieling (:TbSync) from comment #11)

We are close to release of next ESR. Is it worth backporting this patch to 78?

I thought thunderbird had no ESR version

from https://www.thunderbird.net/es-ES/organizations/

"Unlike the Mozilla Firefox ESR, Thunderbird does not provide a separate ESR release. This is because the regular Thunderbird release is already an ESR release. "

I wanted to say, that we are close to release the next version of Thunderbird. To distinguish it from Beta and Daily, I tend to call that version ESR, as it is based on the Firefox ESR. Did not want to cause confusions.

Ok, then I'd appreciate this fix could be in the next release, so I can start deploying it to my users (still on 60.x where I could deply the extensions alongside the exe)

So no backport to 78.

(In reply to Luca Olivetti from comment #0)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0

Steps to reproduce:

I added the following snippet to HKLM\Software\Policies\Thunderbird\ExtensionSettings:

{
"uBlock0@raymondhill.net": {
"installation_mode": "force_installed",
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
}
}

Actual results:

The error console shows the errors
JsonSchemaValidator.jsm: Object expected but not received JsonSchemaValidator.jsm:303
Enterprise Policies: Invalid parameters specified for ExtensionSettings. EnterprisePolicies.js:161

Expected results:

The extension should have been installed as per the specified policy.
No matter what I put in HKLM\Software\Policies\Thunderbird\ExtensionSettings I always get the same error.
The same snippet works with firefox.

Luca, how did you open "the error console" you mentioned?

In my localized version is in the menu Eines -> Eines per a desenvolupadors -> Consola d'errors (in english it should be Tools -> Developer Tools -> Error console)

(In reply to John Bieling (:TbSync) from comment #17)

So no backport to 78.

I see here https://wiki.mozilla.org/Release_Management/Calendar (here https://wiki.mozilla.org/Releases it says that thunderbird approximately follows the ESR schedule) that the next release (91?) is planned for the end of 2021.
When I talked about the next release I thought it came sooner, though if it's too much effor to backport it to 78 I suppose I can keep my users on 60 just a little bit longer.

Keeping your users on TB60 is of course not what we want. Next merge day is 2021-04-19 where the patch will land in Beta. I will give him a few weeks and then backport it to TB78.

Flags: needinfo?(john)
Target Milestone: --- → 89 Branch
Flags: needinfo?(john)
Flags: needinfo?(john)

Uplift has to wait till end of May with the release of TB78.11.0.

Comment on attachment 9219131 [details] [diff] [review]
bug1700279_add_support_for_ExtensionSettings_enterprise_policy_esr78.11.0.patch

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
TB78 has no full support of enterprise policies

Testing completed (on c-c, etc.):
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=064e988705a07f690d2ca8bab5209db7e3688c30

Risk to taking this patch (and alternatives if risky):
Low

Note: This is a request for 78.11.0. or later.

Flags: needinfo?(john)
Attachment #9219131 - Flags: approval-comm-esr78?

Comment on attachment 9219131 [details] [diff] [review]
bug1700279_add_support_for_ExtensionSettings_enterprise_policy_esr78.11.0.patch

[Triage Comment]
Approved for esr78

Attachment #9219131 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: