Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Add installer downloader and in-app upgrades backend #7583

Draft
wants to merge 57 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
208d5ae
Add initial web installer and upgrades scaffold
dlon Jan 17, 2025
365995e
Hide download button rather than disabling it
dlon Feb 3, 2025
2e664dc
Conform to design more for Windows implementation
dlon Feb 3, 2025
271fcbe
Remove libui
dlon Feb 3, 2025
5208ce0
Decouple app updater/downloader from installer-downloader frontend
dlon Feb 3, 2025
b4e6030
Move shared strings to separate module
dlon Feb 4, 2025
2536754
Add script for generating PNGs
dlon Feb 4, 2025
a67717d
Update UI
dlon Feb 4, 2025
dabfdea
Simplify downloader and factory traits
dlon Feb 5, 2025
0826811
Remove background from downloader logo
dlon Feb 5, 2025
3a83330
Fix windows-sys version
dlon Feb 5, 2025
3f1fa1d
Move downloader resources to assets directory
dlon Feb 5, 2025
394bbcc
Generalize fetch module
dlon Feb 5, 2025
79dbbf1
Add unit test for fetch
dlon Feb 5, 2025
11274fd
Handle nefarious chunk responses in mullvad-update
dlon Feb 5, 2025
4435961
Build loader main on unsupported platforms
dlon Feb 6, 2025
d1276cf
Replace `AppDownloaderFactory` trait with `From` impl (#7606)
Serock3 Feb 6, 2025
bb57865
Implement serde::Deserialize for Mullvad version type
dlon Feb 6, 2025
81165d1
Add deserializer for new version endpoint
dlon Feb 6, 2025
b076808
Test version format verification
dlon Feb 6, 2025
f63c830
Use snapshot testing for integration tests in installer-downloader
dlon Feb 6, 2025
f6a9c22
Improve test documentation
dlon Feb 7, 2025
fdea388
Implement version provider for API responses
dlon Feb 7, 2025
8135a19
Add mullvad-version-metadata tool
dlon Feb 7, 2025
038addb
Update test data
dlon Feb 7, 2025
d7e21b2
Make signing optional
dlon Feb 7, 2025
7cbf44e
Switch to regex-lite for mullvad-version
dlon Feb 7, 2025
5f73fc3
Add build script for installer-downloader
dlon Feb 7, 2025
7b7721b
Add GHA workflow for regression testing installer-downloader size
dlon Feb 7, 2025
fb3841a
fixup
dlon Feb 8, 2025
35bc933
Remove signature download step
dlon Feb 8, 2025
443378a
Add documentation to mullvad-update format module
dlon Feb 8, 2025
6031ec8
Test expired metadata
dlon Feb 8, 2025
fcbf963
Update version response format
dlon Feb 12, 2025
1b07566
Add improved API response parse tests
dlon Feb 12, 2025
4d8cc38
Always fail if there are duplicate versions
dlon Feb 12, 2025
d661b66
Add TODO note about mullvad_paths::windows::create_dir_recursive limi…
dlon Feb 13, 2025
773b074
Don't hide cancel button if download fails
dlon Feb 13, 2025
3286225
Set app download cache to a read-only directory
dlon Feb 13, 2025
2a29468
Add launch step to installer downloader
dlon Feb 13, 2025
d2cfffc
Remove installer if verification fails
dlon Feb 13, 2025
6d1353c
Decouple download directory from mullvad-update
dlon Feb 14, 2025
f273ae5
Add API client for mullvad-update
dlon Feb 14, 2025
6637aea
Implement beta downloader
dlon Feb 17, 2025
edfa773
Add arrow to 'stable link' on Windows
dlon Feb 17, 2025
ed211d4
Add improved error messages
dlon Feb 17, 2025
7d9246d
Select random mirror for downloading
dlon Feb 17, 2025
ad7165f
Print reason for error
dlon Feb 18, 2025
258d156
Do not serialize rollout if 1
dlon Feb 19, 2025
16e2ddb
Do not deserialize back canonical JSON
dlon Feb 20, 2025
9c39af3
Add version counter to metadata and rename expiry field
dlon Feb 20, 2025
108bff0
fixup: Error::source
dlon Feb 20, 2025
bb2c7cd
Support multiple signatures
dlon Feb 20, 2025
1715fff
fixup
dlon Feb 21, 2025
26f234e
fixup: ordering
dlon Feb 21, 2025
23270c3
Implement error view for macos
hulthe Feb 21, 2025
cdbb9ec
fixup: Remove + 'static
hulthe Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/actions/check-file-size/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Check file size"
description: "Fails a file exceeds a given size limit"
inputs:
artifact:
description: "Path to the file"
required: true
max_size:
description: "Maximum allowed size in bytes"
required: true
runs:
using: "composite"
steps:
- name: Check file size
shell: bash
run: |
if [ -f "${{ inputs.artifact }}" ]; then
SIZE=$(stat -c %s "${{ inputs.artifact }}")
echo "File size: $SIZE bytes"
echo "Size limit: ${{ inputs.max_size }} bytes"

if [ "$SIZE" -gt "${{ inputs.max_size }}" ]; then
echo "Error: Binary size exceeds limit."
exit 1
fi
else
echo "Error: File not found!"
exit 1
fi
80 changes: 80 additions & 0 deletions .github/workflows/downloader.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: Installer downloader - Size test
on:
pull_request:
paths:
- '**'
- '!**/**.md'
- '!.github/workflows/**'
- '.github/workflows/downloader.yml'
- '!.github/CODEOWNERS'
- '!android/**'
- '!audits/**'
- '!build.sh'
- '!ci/**'
- '!clippy.toml'
- '!deny.toml'
- '!rustfmt.toml'
- '!.yamllint'
- '!docs/**'
- '!graphics/**'
- '!desktop/**'
- '!ios/**'
- '!scripts/**'
- '!.*ignore'
- '!prepare-release.sh'
- '!**/osv-scanner.toml'

permissions: {}

jobs:
build-windows:
strategy:
matrix:
config:
- os: windows-latest
arch: x64
runs-on: ${{ matrix.config.os }}
env:
# If the file is larger than this, a regression has probably been introduced.
# You should think twice before increasing this limit.
MAX_BINARY_SIZE: 1572864
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build
shell: bash
env:
# On Windows, the checkout is on the D drive, which is very small.
# Moving the target directory to the C drive ensures that the runner
# doesn't run out of space on the D drive.
CARGO_TARGET_DIR: "C:/cargo-target"
run: ./installer-downloader/build.sh

- name: Check file size
uses: ./.github/actions/check-file-size
with:
artifact: "C:/cargo-target/release/installer-downloader.exe"
max_size: ${{ env.MAX_BINARY_SIZE }}

build-macos:
runs-on: macos-latest
env:
# TODO: Figure out a reasonable limit for macOS
# If the file is larger than this, a regression has probably been introduced.
# You should think twice before increasing this limit.
MAX_BINARY_SIZE: 2097152
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build
shell: bash
run: ./installer-downloader/build.sh

- name: Check file size
uses: ./.github/actions/check-file-size
with:
artifact: "./target/release/installer-downloader"
max_size: ${{ env.MAX_BINARY_SIZE }}
Loading
Loading