Repository navigation
Install
Role. omnisnap install firefox: download the official Mozilla Firefox build for this OS and architecture, verify it, unpack it into the Omnisnap cache, and make it discoverable. A machine with only Blink browsers cannot compare engine families; this gives it Gecko. It is opt-in: no other command downloads anything. Module install, package internal/install.
omnisnap install firefox [--channel release|esr] [--version <v>]
omnisnap uninstall firefox [--channel release|esr]
When a job has only one engine family, the CLI prints a hint naming omnisnap install firefox (run.go).
Firefox, in order. Nothing is written into the cache before both checks pass.
-
Version. Without
--version, ask Mozilla's version feed (product-details.mozilla.org) for the channel's latest (ResolveVersion). -
Disk space. The archive's size from a
HEADrequest; refuse to start with less thandiskFactortimes that free: 6x on Windows (the download, the carved 7z archive and the unpackedcore/, about 4x), 5x on Linux and macOS (the download and the unpacked tree). The refusal states the free space and the space needed. Measured on 153.8.0esr for Linux: 82 MB download, 310 MB unpacked (3.78x);TestInstallESRFromMozillalogs the ratio on each run. -
Download from
ftp.mozilla.org/pub/firefox/releases/into the cache'sdownloads/folder, resuming a partial file with aRangerequest (download). Progress and size are printed. -
Verify. Fetch the release's
SHA512SUMSandSHA512SUMS.asc; verify the detached OpenPGP signature against Mozilla's release key, which is pinned in the binary (mozilla-key.asc), in pure Go: RFC 4880 v4 RSA signatures, PKCS#1 v1.5, no gpg (VerifyDetached). Then check the archive's SHA-512 against its line in the signed sums (listed under its release path, since macOS and Windows archives are renamed on download). -
Unpack into a temp dir inside the cache, then move it into place:
- Linux:
.tar.xz, decompressed withxz(1)(Go's standard library has no xz decoder, and the project takes no dependency for one); - macOS: the
.dmgmounted read-only,Firefox.appcopied out, detached; - Windows: Omnisnap downloads
Firefox Setup <v>.exe. That is a 7-Zip self-extracting archive: a PE stub, then a 7z archive (LZMA + BCJ2, the browser undercore/, the NSISsetup.exebeside it), then the Authenticode signature. Mozilla's Windows Installer package only wraps this same.exeand runs it, so an administrative install of it copies nothing (backlog B4). The install never runs anything from the download, writes nothing outside the cache, and needs no administrator rights:-
find7zscans the verified.exefor the 7z signature. A hit counts only with a valid start header (major version 0, a matching start-header CRC, an archive that ends inside the file), so a stray copy of the signature bytes is skipped. -
carve7zcopies exactly the archive to<tmp>/firefox.7z. -
extract7ztries%SystemRoot%\System32\tar.exe(bsdtar) by its full path, never ataronPATH, since Git Bash's GNU tar cannot read 7z. It then tries 7-Zip (7zonPATH, or%ProgramFiles%\7-Zip\7z.exe). An attempt counts only if it leavescore/firefox.exe, and the temp dir is emptied between attempts. When neither works, the error names each attempt and says to install 7-Zip from https://www.7-zip.org. -
finalizemovescore/to<version>/firefox/.setup.exeis deleted with the temp dir and never run.
-
- Linux:
-
Mark the install with
omnisnap-source.json(what was downloaded, and when).
The browsers cache (CacheDir) is %LOCALAPPDATA%\omnisnap\browsers on Windows, ~/Library/Caches/omnisnap/browsers on macOS, and $XDG_CACHE_HOME/omnisnap/browsers (or ~/.cache/omnisnap/browsers) elsewhere; downloads go in its downloads/ folder. Warmed templates live next to it, under omnisnap/templates/. Discovery finds them as source omnisnap-cache, with ESR under its own id.
Key rotation by Mozilla means a new Omnisnap release with the new key. TestMozillaKeyIsTheReleaseKey pins the fingerprint.
A tampered archive, tampered sums, a bad signature, a full disk or a failed unpack stop the install before anything reaches the cache. An interrupted download stays in downloads/ so the next attempt resumes it; once the download is complete, a failed check or a failed unpack deletes it (on Windows, "install 7-Zip and retry" downloads the setup again).
-
install_test.go, against a local server with a fake Firefox fromtestdata/installand sums signed by a test key:TestInstallVerifiesAndUnpacks,TestInstallRejectsTamperedArchive,TestInstallRejectsTamperedSums,TestDownloadResumes,TestInstallRefusesLowDisk(just below, well below and exactly at this OS's disk factor). On Windows the fixture is a setup.exein Mozilla's shape (stub with a decoy signature, LZMA + BCJ2 7z archive, trailing signature bytes), built with 7-Zip at test time (buildSetupExe); on macOS a DMG built withhdiutil; on Linux the committed.tar.xz. -
sfx_test.go, on every OS with no tools:TestFind7zSkipsADecoyAndCarvesExactly,TestFind7zAcrossTheChunkBoundary,TestCarve7zRejects(corrupt CRC, truncated, no signature, only a decoy), andTestExtract7zChainwith fake extractors (this test binary re-run): the first works; the first exits 0 without the browser and the second works; both fail; 7-Zip missing; no extractors. -
sfx_fixture_test.go:TestCarveAndExtractARealArchivebuilds a real archive with 7-Zip and extracts it with bsdtar and 7-Zip; it skips without 7-Zip. -
fixture_windows_test.go:TestWindowsExtractorsEachAlonerunstar.exeand 7-Zip each alone on the fixture and logs which one works on the runner; at least one must. Onwindows-latest(2026-11-26, run 45868538448), both unpack Mozilla's archive:tar.exe(C:\Windows\System32\tar.exe) and 7-Zip (C:\ProgramData\Chocolatey\bin\7z.exe). -
uninstall_windows_test.go:Uninstallremoves afirefox.exeheld open for 200 ms, and gives up on one held throughout. It retries for about a second because a Firefox closed a moment ago can still hold its executable on Windows (the network test uninstalls right after closing the browser). -
verify_test.go: a real Mozilla signature verifies; tampered data, a corrupt signature and a garbage key are rejected. -
network_test.go(networktag):TestInstallESRFromMozillainstalls a real ESR from Mozilla. It installs Mozilla's real ESR, discovers it, launches it and uninstalls it, leaving nothing. Theinstall.ymlworkflow runs it on Linux and Windows: weekly, by hand, and on pull requests that touchinternal/install/orinternal/discovery/(Testing and CI). It also logs the unpacked size against the download. Discovery keeps the first browser it finds per id, so on a machine with a system Firefox ESR the cache copy is not the one listed and the test fails at discovery. The CI runners have no system ESR. On Windows it also checks that the install changes no registry key:Software\Mozillaand theUninstallkeys (what "Apps & features" lists), compared before and after the install and before the launch, since Firefox writes its own keys when it starts (network_registry_windows_test.go).registryChangesblames any change under HKLM or the Uninstall keys, and a line underHKCU\Software\Mozillathat names the browser cache. OtherHKCU\Software\Mozillachanges are logged as another Firefox's: the runner image's Firefox inC:\Program Filescan start on its own mid-test and write its Launcher keys (v0.2.0-rc.1's run 46008712513).TestRegistryChangescovers that diff on every OS.
-
uninstall --channelis ignored. The flag is accepted and validated, butUninstallremoves every cached Firefox build, whatever the channel. -
Windows needs a 7z-capable
tar.exeor 7-Zip. Unpacking runs Windows' owntar.exe, then 7-Zip. Atar.exebuilt without LZMA (Windows 10's libarchive 3.5.2) fails, and the user has to install 7-Zip. -
Linux needs
xz(1). The spec's "no external tool" is about signature verification, which is pure Go; unpacking a.tar.xzon Linux runsxz.
-
internal/cli/install.go:omnisnap installanduninstall -
internal/install/install.go:Firefox: the whole install, end to end -
internal/install/mozilla.go: channels, targets, version resolution, archive URLs -
internal/install/download.go: the download, its progress and the checksum -
internal/install/verify.go: the OpenPGP check of SHA512SUMS against the pinned key -
internal/install/embed.go: Mozilla's release signing key, embedded -
internal/install/cache.go: the cache layout, what is installed, andUninstall(its removals retried for about a second) -
internal/install/unpack_linux.go: unpacking on Linux (needsxz) -
internal/install/unpack_darwin.go: unpacking on macOS -
internal/install/sfx.go: finding and copying out the 7z archive in Windows' setup.exe, and the extractor chain -
internal/install/unpack_windows.go: unpacking on Windows (carve, thentar.exe, then 7-Zip) -
internal/install/disk_unix.go: free disk space, on Unix -
internal/install/disk_windows.go: free disk space, on Windows
This wiki is published from docs/internals/ on main. Edits made here are overwritten on the next publish: change the pages there, in a pull request. The specs are normative; where a page and a spec disagree, the page says what the code does.
Start
Contracts
Capture side
Analysis side
Output
Quality