firefox: do not allow lossy silent downgrades

I just lost my cookies and container state due to accidental rollback of
Firefox. I had snapshots, so I'm fine, but firefox should *not* be doing that.
The user should explicitly opt into this by either setting that env var
themselves or by using `-allow-downgrade`; as upstream intends.

This partially reverts 87e261843c.

I made this an overrideable option since this would be quite annoying to
override otherwise in case people actually want it to behave like that.

(cherry picked from commit 73e297c4a0)
This commit is contained in:
Atemu
2026-08-08 15:51:08 +02:00
committed by github-actions[bot]
parent 3544d17d53
commit f4b2813dbb
2 changed files with 11 additions and 1 deletions

View File

@@ -409,6 +409,11 @@
- The full-text search backend changed from Whoosh to Tantivy. The search index is rebuilt automatically on the first start after upgrading, which can take a while for large document sets.
- Some settings changed or were removed (for example, an external database now needs an explicit `PAPERLESS_DBENGINE`); review your `services.paperless.settings` against the migration guide.
- `firefox` no longer defaults to allowing silent downgrades that can lead to loss of important browser state.
This matches the behaviour which upstream Firefox has intended since version 67.
In case of an intended or necessary downgrade, users are advised to use the [`-allow-downgrade` CLI argument](https://wiki.mozilla.org/Firefox/CommandLineOptions#-allow-downgrade) or `MOZ_ALLOW_DOWNGRADE=1` environment variable to accept the risk of data loss and continue using the profile.
Users who frequently downgrade Firefox versions can use the `allowDowngrade` override to restore the previous behaviour of setting the environment variable by default.
- `services.alps` has been rewritten, see [upstream repository](https://github.com/migadu/alps) for configuration.
- Nginx no longer includes the unmaintained dav module per default.

View File

@@ -76,6 +76,10 @@ let
libName ? browser.libName or applicationName, # Important for tor package or the like
nixExtensions ? null,
hasMozSystemDirPatch ? (lib.hasPrefix "firefox" pname && !lib.hasSuffix "-bin" pname),
# Using a profile last written to by a newer version of firefox is
# possible in many cases but can lead to partial data loss without
# warning. This flag allows opting into that behaviour.
allowDowngrade ? false,
}:
let
@@ -329,7 +333,8 @@ let
"--set"
"MOZ_LEGACY_PROFILES"
"1"
]
++ lib.optionals allowDowngrade [
"--set"
"MOZ_ALLOW_DOWNGRADE"
"1"