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 54 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e52f0d8
Add initial web installer and upgrades scaffold
dlon Jan 17, 2025
ffbbe4d
Hide download button rather than disabling it
dlon Feb 3, 2025
5142486
Conform to design more for Windows implementation
dlon Feb 3, 2025
dfa6b89
Remove libui
dlon Feb 3, 2025
3bf06b3
Decouple app updater/downloader from installer-downloader frontend
dlon Feb 3, 2025
27bf5ab
Move shared strings to separate module
dlon Feb 4, 2025
28c09e4
Add script for generating PNGs
dlon Feb 4, 2025
d46c935
Update UI
dlon Feb 4, 2025
393274f
Simplify downloader and factory traits
dlon Feb 5, 2025
1afa409
Remove background from downloader logo
dlon Feb 5, 2025
e1b5f3c
Fix windows-sys version
dlon Feb 5, 2025
1b36bfe
Move downloader resources to assets directory
dlon Feb 5, 2025
e0224a8
Generalize fetch module
dlon Feb 5, 2025
9130b5b
Add unit test for fetch
dlon Feb 5, 2025
177bd0f
Handle nefarious chunk responses in mullvad-update
dlon Feb 5, 2025
6e3a63b
Build loader main on unsupported platforms
dlon Feb 6, 2025
d1c45e9
Replace `AppDownloaderFactory` trait with `From` impl (#7606)
Serock3 Feb 6, 2025
04e73d0
Implement serde::Deserialize for Mullvad version type
dlon Feb 6, 2025
fe35882
Add deserializer for new version endpoint
dlon Feb 6, 2025
7a7e7eb
Test version format verification
dlon Feb 6, 2025
13edaf8
Use snapshot testing for integration tests in installer-downloader
dlon Feb 6, 2025
c599e51
Improve test documentation
dlon Feb 7, 2025
7586a15
Implement version provider for API responses
dlon Feb 7, 2025
9ecc284
Add mullvad-version-metadata tool
dlon Feb 7, 2025
5be36f6
Update test data
dlon Feb 7, 2025
4b1cacd
Make signing optional
dlon Feb 7, 2025
2b38373
Switch to regex-lite for mullvad-version
dlon Feb 7, 2025
bf0bc92
Add build script for installer-downloader
dlon Feb 7, 2025
1b75590
Add GHA workflow for regression testing installer-downloader size
dlon Feb 7, 2025
54d586b
fixup
dlon Feb 8, 2025
3d166a0
Remove signature download step
dlon Feb 8, 2025
c42e0d1
Add documentation to mullvad-update format module
dlon Feb 8, 2025
cd9ff6f
Test expired metadata
dlon Feb 8, 2025
bebd811
DELETE ME: update mullvad-version
dlon Feb 12, 2025
a8a66c9
Update version response format
dlon Feb 12, 2025
8220f46
Add improved API response parse tests
dlon Feb 12, 2025
2f31795
Always fail if there are duplicate versions
dlon Feb 12, 2025
6033f3b
Add TODO note about mullvad_paths::windows::create_dir_recursive limi…
dlon Feb 13, 2025
d8d464e
Don't hide cancel button if download fails
dlon Feb 13, 2025
6495286
Set app download cache to a read-only directory
dlon Feb 13, 2025
d3bf7c6
Add launch step to installer downloader
dlon Feb 13, 2025
dab5b9f
Remove installer if verification fails
dlon Feb 13, 2025
6bf3f6c
Decouple download directory from mullvad-update
dlon Feb 14, 2025
22c2279
Add API client for mullvad-update
dlon Feb 14, 2025
b244c78
Implement beta downloader
dlon Feb 17, 2025
c8dca7f
Add arrow to 'stable link' on Windows
dlon Feb 17, 2025
64650e8
Add improved error messages
dlon Feb 17, 2025
a72844c
Select random mirror for downloading
dlon Feb 17, 2025
d783cd9
Print reason for error
dlon Feb 18, 2025
acc273d
Do not serialize rollout if 1
dlon Feb 19, 2025
76fbeb2
Do not deserialize back canonical JSON
dlon Feb 20, 2025
b2dd10e
Add version counter to metadata and rename expiry field
dlon Feb 20, 2025
9606c21
fixup: Error::source
dlon Feb 20, 2025
1984920
Support multiple signatures
dlon Feb 20, 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