Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Pin and verify Auth packaging dependencies

Neeraj Gupta54e884e1e219
diff --git a/.github/workflows/auth-build.yml b/.github/workflows/auth-build.yml
index 248bb25b35..ed5df24669 100644
--- a/.github/workflows/auth-build.yml
+++ b/.github/workflows/auth-build.yml
@@ -251,14 +251,58 @@ jobs:
sudo apt-get install -y libsecret-1-dev libsodium-dev libfuse2 ninja-build libgtk-3-dev dpkg-dev pkg-config rpm patchelf libsqlite3-dev locate libayatana-appindicator3-dev libffi-dev libtiff5 xz-utils libarchive-tools libcurl4-openssl-dev
sudo updatedb --localpaths='/usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu'
- - name: Install fpm for RPM packaging
- run: sudo gem install fpm
-
- - name: Install appimagetool
+ - name: Install verified Linux packaging tools
run: |
- wget -O appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
- chmod +x appimagetool
- mv appimagetool /usr/local/bin/
+ set -euo pipefail
+
+ gem_lock="$GITHUB_WORKSPACE/mobile/apps/auth/linux/packaging/fpm-gems.sha256"
+ tools_dir="$(mktemp -d "${RUNNER_TEMP:?}/auth-linux-tools.XXXXXX")"
+ mkdir "$tools_dir/bin" "$tools_dir/downloads"
+ cd "$tools_dir/downloads"
+
+ while read -r _checksum gem_file; do
+ curl --fail --location --silent --show-error \
+ "https://rubygems.org/downloads/$gem_file" --output "$gem_file"
+ done < "$gem_lock"
+ sha256sum --check "$gem_lock"
+
+ # An isolated gem home and --local keep the entire dependency closure offline.
+ export GEM_HOME="$tools_dir/gems"
+ export GEM_PATH="$GEM_HOME"
+ gem install --local --no-document --env-shebang ./*.gem
+ cat > "$tools_dir/bin/fpm" <<'EOF'
+ #!/usr/bin/env bash
+ set -euo pipefail
+ tools_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+ export GEM_HOME="$tools_dir/gems"
+ export GEM_PATH="$GEM_HOME"
+ exec "$GEM_HOME/bin/fpm" "$@"
+ EOF
+
+ curl --fail --location --silent --show-error \
+ https://github.com/AppImage/appimagetool/releases/download/1.9.1/appimagetool-x86_64.AppImage \
+ --output appimagetool.AppImage
+ curl --fail --location --silent --show-error \
+ https://github.com/AppImage/type2-runtime/releases/download/20251108/runtime-x86_64 \
+ --output runtime-x86_64
+ sha256sum --check <<'EOF'
+ ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0 appimagetool.AppImage
+ 2fca8b443c92510f1483a883f60061ad09b46b978b2631c807cd873a47ec260d runtime-x86_64
+ EOF
+ mv appimagetool.AppImage runtime-x86_64 "$tools_dir/"
+
+ # Both Fastforge and post_process_appimage.sh must use the verified runtime.
+ cat > "$tools_dir/bin/appimagetool" <<'EOF'
+ #!/usr/bin/env bash
+ set -euo pipefail
+ tools_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+ export APPIMAGE_EXTRACT_AND_RUN=1
+ exec "$tools_dir/appimagetool.AppImage" --runtime-file "$tools_dir/runtime-x86_64" "$@"
+ EOF
+ chmod +x "$tools_dir/appimagetool.AppImage" "$tools_dir/bin/"*
+ "$tools_dir/bin/fpm" --version
+ "$tools_dir/bin/appimagetool" --version
+ printf '%s\n' "$tools_dir/bin" >> "${GITHUB_PATH:?}"
- name: Build Linux app
run: |
@@ -366,9 +410,35 @@ jobs:
shell: bash
run: |
flutter config --enable-windows-desktop
- choco install innosetup -y
flutter build windows --release
+ - name: Install verified Inno Setup
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = "Stop"
+
+ $toolsDir = Join-Path $env:RUNNER_TEMP ("auth-innosetup-" + [guid]::NewGuid())
+ New-Item -ItemType Directory -Path $toolsDir | Out-Null
+ $installer = Join-Path $toolsDir "innosetup-6.7.3.exe"
+ Invoke-WebRequest `
+ -Uri "https://github.com/jrsoftware/issrc/releases/download/is-6_7_3/innosetup-6.7.3.exe" `
+ -OutFile $installer
+ if ((Get-FileHash -LiteralPath $installer -Algorithm SHA256).Hash -ne "9c73c3bae7ed48d44112a0f48e66742c00090bdb5bef71d9d3c056c66e97b732") {
+ throw "Inno Setup installer checksum mismatch"
+ }
+
+ $installDir = Join-Path $toolsDir "compiler"
+ $process = Start-Process -FilePath $installer -Wait -PassThru -ArgumentList `
+ "/PORTABLE=1", "/CURRENTUSER", "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART", "/NOICONS", "/DIR=`"$installDir`""
+ if ($process.ExitCode -ne 0) {
+ throw "Inno Setup installation failed with exit code $($process.ExitCode)"
+ }
+ $compiler = Join-Path $installDir "ISCC.exe"
+ if (-not (Test-Path -LiteralPath $compiler -PathType Leaf)) {
+ throw "Inno Setup compiler not found: $compiler"
+ }
+ "INNO_SETUP_COMPILER=$compiler" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
+
- name: Verify Windows PE allowlist
shell: pwsh
run: |
@@ -402,7 +472,8 @@ jobs:
run: |
& ./scripts/build_windows_installer.ps1 `
-SourceDir "build/windows/x64/runner/Release" `
- -InstallerPath "artifacts/${{ env.ARTIFACT_STEM }}-installer.exe"
+ -InstallerPath "artifacts/${{ env.ARTIFACT_STEM }}-installer.exe" `
+ -CompilerPath $env:INNO_SETUP_COMPILER
- name: Sign Windows installer with Trusted Signing
uses: azure/trusted-signing-action@c7ab2a863ab5f9a846ddb8265964877ef296ee82 # v2.0.0
@@ -518,7 +589,19 @@ jobs:
- run: flutter pub get --enforce-lockfile
- name: Install code signing dependencies
- run: pip3 install codemagic-cli-tools --break-system-packages
+ run: |
+ set -euo pipefail
+
+ venv="$(mktemp -d "${RUNNER_TEMP:?}/auth-codemagic.XXXXXX")"
+ python3 -m venv "$venv"
+ "$venv/bin/python" -m pip --isolated install \
+ --disable-pip-version-check --no-cache-dir \
+ --index-url https://pypi.org/simple \
+ --require-hashes --only-binary=:all: \
+ --requirement macos/packaging/codemagic-requirements.txt
+ "$venv/bin/python" -m pip check
+ "$venv/bin/codemagic-cli-tools" --version
+ printf '%s\n' "$venv/bin" >> "${GITHUB_PATH:?}"
- name: Add provisioning profiles
run: |
diff --git a/mobile/apps/auth/linux/packaging/fpm-gems.sha256 b/mobile/apps/auth/linux/packaging/fpm-gems.sha256
new file mode 100644
index 0000000000..5e505c51b4
--- /dev/null
+++ b/mobile/apps/auth/linux/packaging/fpm-gems.sha256
@@ -0,0 +1,11 @@
+fdff482f75239239201f4d667d93424412639aad0b3b0ad4d827e7c637e0ad39 arr-pm-0.0.12.gem
+94298d32dc3c40ca15633b54e282780b49e2db0c045f602ea1907e4f63a17235 backports-3.25.3.gem
+dcc9385af8039ba8fb6e33f0a9036e9e9fedec71c842343ce8e6101776e0322d cabin-0.9.1.gem
+2fed212e5c9b60447eb5097af39d4c12c3c7e6788e8d791e9c436e0e755f4adc clamp-1.5.2.gem
+c5944793349ae03c432e1780a2ca929d60b88c7d14d52d630db0508c3a8a17d8 dotenv-2.8.1.gem
+6c6645d51e0cc687faab35441ac6ef1c6ed9b333615ac47f568dd5f9fd46a185 fpm-1.18.0.gem
+6f6759eee583dc4e00a6cc3f713cfa7c570572958ba1f5d65595046d795b832f insist-1.0.0.gem
+826a96db895819c13fffa4fa3c20b85e80b60aaec1f28f79e7db80092abdb0bc mustache-0.99.8.gem
+da8d5408885ae23c2ebcf4948bb27d6cf1f3672d5b49daebb2b71355ddb5d7bd pleaserun-0.0.34.gem
+19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 rexml-3.4.4.gem
+6ba26fa28fc50a8d59229b296a733b48d50f1473b1e3e7f5e339d5bbd829eb62 stud-0.0.23.gem
diff --git a/mobile/apps/auth/macos/packaging/codemagic-requirements.txt b/mobile/apps/auth/macos/packaging/codemagic-requirements.txt
new file mode 100644
index 0000000000..f838681db4
--- /dev/null
+++ b/mobile/apps/auth/macos/packaging/codemagic-requirements.txt
@@ -0,0 +1,96 @@
+# Hash-locked Codemagic dependencies for the macOS arm64 signing runner.
+# Review versions, provenance and advisories before accepting an update.
+certifi==2026.7.22 \
+ --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775
+cffi==2.1.1 \
+ --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \
+ --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \
+ --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \
+ --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \
+ --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \
+ --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \
+ --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \
+ --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \
+ --hash=sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be \
+ --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \
+ --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \
+ --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \
+ --hash=sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b \
+ --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \
+ --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \
+ --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4
+charset-normalizer==3.5.1 \
+ --hash=sha256:41876ee62a3dddf48ff1121ad8f0798032aa03f2fd35f21f34a4cab14f18d8d2 \
+ --hash=sha256:59171c6e45bf07d0d5cab3b0bf81d945035530f6873398b3b531c31184d46663 \
+ --hash=sha256:5b6d1386bf0096d26d3a863dc0a487a5b4eb9aa93cf5ba69683d29dde6b9d60f \
+ --hash=sha256:6df0ec430f9a831772c23ca5a224cba36517a58a84bb32c32bb59a9fa67c47f6 \
+ --hash=sha256:85de3134b5379856e323ba37c19c9256d39425f7b76a63af52b09fb4664c2e8f \
+ --hash=sha256:9085f87b0e38a2b92b8923059b4e8789fe40d9279712d15dcc670048d77079af \
+ --hash=sha256:c428c6c31eb5f4277d7f8eccaf767fbd548ddd5ce3c8b4f4cbbfab3d96b5904c \
+ --hash=sha256:d1ee1e296209fdce05b81b663250eefa02213a2da7b41bf26f7829b8ba3545aa \
+ --hash=sha256:e90251c0c7bdd54a100a0dce3c07b7e637278c93af29dbf78ebb89a58c4bac7d \
+ --hash=sha256:eda059b6bc8bc0812d626fd91a7ce01bf583df0a61296eff390fd94141a34e30 \
+ --hash=sha256:fbc597639158fd7c14d55e808718848319540f51b0e6746e3eefa59723a4a348
+codemagic-cli-tools==0.69.0 \
+ --hash=sha256:9d817ebab18d70b1506678ad69b7fd2e05b22481df9ffd125fcfd82d0f51e19a
+cryptography==50.0.1 \
+ --hash=sha256:30a125032e5642a21ff816e021152bd4e7e94f03eff3f4b7fca41cd22bc3110f \
+ --hash=sha256:9cb3cb952cf5a8abd50c782a98a89d71699715e802fe349704b47f2425b42a94 \
+ --hash=sha256:b8f852c65863251b9e3a1b8c150ce21e59b522dbb6a7d4bc80e680d38388e986 \
+ --hash=sha256:ca83d00d9e69cd5eb63f2e69c3a5a59e0cecae5ae14c6ae0b35830fe3b37bad0
+google-api-core==2.39.0 \
+ --hash=sha256:40a5d1c892bc1798f3b75ab10c665b85717979088519c714ca5774ee81d1e3c5
+google-api-python-client==2.200.0 \
+ --hash=sha256:c0c2c4072a110b7fcc30ac151744d4410cddaba99c53cb4e815463308952b638
+google-auth==2.59.0 \
+ --hash=sha256:43e47b1d3067fb90d77bd9ba21f139bb0577b3f2b9f3e2516fc00f37435efcad
+google-auth-httplib2==0.4.2 \
+ --hash=sha256:4298dd6b1415972d0c464b7177e6a69a595e7aec5b972222ecdca342f6009647
+googleapis-common-protos==1.75.4 \
+ --hash=sha256:e8eb9cffa9a9f3423090cc7a086012004196abab388a0561690e81887fd79cc1
+httplib2==0.32.0 \
+ --hash=sha256:dc6705cacdf3fb0a2aba7629fa33c90fd93e30035db0c157325826be177e4816
+idna==3.20 \
+ --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c
+oauth2client==4.1.3 \
+ --hash=sha256:b8a81cc5d60e2d364f0b1b98f958dbd472887acaf1a5b05e21c28c31a2d6d3ac
+opentelemetry-api==1.45.0 \
+ --hash=sha256:80e068aba7cd56c8b58512d6a36f8d25cb1dfaa0c0a4cc1c938ccf9f362d9cb3
+packaging==26.3 \
+ --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c
+proto-plus==1.28.4 \
+ --hash=sha256:4b01341272f8a348db3f003b6143109f83ab43091019d5181b3fcdf500ab32aa
+protobuf==7.36.2 \
+ --hash=sha256:bdb3a345d48db958e6ce1f18e508beb0cc981d64f24088427549c866cd039f1e \
+ --hash=sha256:cbc70b17ee27e28894c7fee8bb04be1abead49e936bc70eb60052531eee2079e
+psutil==7.2.2 \
+ --hash=sha256:1a7b04c10f32cc88ab39cbf606e117fd74721c831c98a27dc04578deb0c16979 \
+ --hash=sha256:2edccc433cbfa046b980b0df0171cd25bcaeb3a68fe9022db0979e7aa74a826b \
+ --hash=sha256:7b6d09433a10592ce39b13d7be5a54fbac1d1228ed29abc880fb23df7cb694c9 \
+ --hash=sha256:e78c8603dcd9a04c7364f1a3e670cea95d51ee865e4efb3556a3a63adef958ea \
+ --hash=sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486 \
+ --hash=sha256:eed63d3b4d62449571547b60578c5b2c4bcccc5387148db46e0c2313dad0ee00
+pyasn1==0.6.4 \
+ --hash=sha256:deda9277cfd454080ec40b207fb6df82206a3a2688735233cdcd8d3d565f088b
+pyasn1_modules==0.4.2 \
+ --hash=sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a
+pycparser==3.0 \
+ --hash=sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992
+PyJWT==2.15.1 \
+ --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193
+pyparsing==3.3.3 \
+ --hash=sha256:ece8c00a69cf01b45d0b1dedabb469c90d8caf996d4fda40f147627a122849a4
+python-dateutil==2.9.0.post0 \
+ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427
+requests==2.34.2 \
+ --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0
+rsa==4.9.1 \
+ --hash=sha256:68635866661c6836b8d39430f97a996acbd61bfa49406748ea243539fe239762
+six==1.17.0 \
+ --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274
+typing_extensions==4.16.0 \
+ --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8
+uritemplate==4.2.0 \
+ --hash=sha256:962201ba1c4edcab02e60f9a0d3821e82dfc5d2d6662a21abd533879bdb8a686
+urllib3==2.8.0 \
+ --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3
diff --git a/mobile/apps/auth/scripts/build_windows_installer.ps1 b/mobile/apps/auth/scripts/build_windows_installer.ps1
index f90e6c6ae3..54b63a568e 100644
--- a/mobile/apps/auth/scripts/build_windows_installer.ps1
+++ b/mobile/apps/auth/scripts/build_windows_installer.ps1
@@ -3,7 +3,9 @@ param(
[string] $SourceDir,
[Parameter(Mandatory = $true)]
- [string] $InstallerPath
+ [string] $InstallerPath,
+
+ [string] $CompilerPath
)
$ErrorActionPreference = "Stop"
@@ -78,13 +80,20 @@ Filename: "{app}\auth.exe"; Description: "{cm:LaunchProgram,Ente Auth}"; Flags:
$utf8WithBom = [System.Text.UTF8Encoding]::new($true)
[System.IO.File]::WriteAllText($issPath, $iss, $utf8WithBom)
-$iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
-if (-not (Test-Path -LiteralPath $iscc -PathType Leaf)) {
- $isccCommand = Get-Command "ISCC.exe" -ErrorAction SilentlyContinue
- if (-not $isccCommand) {
- throw "Inno Setup compiler not found. Install Inno Setup 6 before running this script."
+$iscc = $CompilerPath
+if ($PSBoundParameters.ContainsKey("CompilerPath")) {
+ if (-not $iscc -or -not (Test-Path -LiteralPath $iscc -PathType Leaf)) {
+ throw "Inno Setup compiler not found: $iscc"
+ }
+} else {
+ $iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
+ if (-not (Test-Path -LiteralPath $iscc -PathType Leaf)) {
+ $isccCommand = Get-Command "ISCC.exe" -ErrorAction SilentlyContinue
+ if (-not $isccCommand) {
+ throw "Inno Setup compiler not found. Install Inno Setup 6 before running this script."
+ }
+ $iscc = $isccCommand.Source
}
- $iscc = $isccCommand.Source
}
& $iscc $issPath